mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add support for custom AndroidViews
Summary: This diff adds an `AndroidView` as a proxy for custom Views in FlatUIImplementation. Any ReactShadowNode that FlatUIImplementation doesn't recognize (because they don't extend from FlatShadowNode) will be wrapped with AndroidView to ensure that it measures and displays correctly. While not perfect, this is the easiest way to support custom Views (EditTexts, DrawerLayouts, ScrollViews etc). Reviewed By: ahmedre Differential Revision: D2751716
This commit is contained in:
committed by
Ahmed El-Helw
parent
1da7049426
commit
dbe9cc333c
@@ -76,6 +76,16 @@ public class FlatUIImplementation extends UIImplementation {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ReactShadowNode createShadowNode(String className) {
|
||||
ReactShadowNode cssNode = super.createShadowNode(className);
|
||||
if (cssNode instanceof FlatShadowNode) {
|
||||
return cssNode;
|
||||
}
|
||||
|
||||
ViewManager viewManager = resolveViewManager(className);
|
||||
return new AndroidView(viewManager);
|
||||
}
|
||||
|
||||
protected void handleCreateView(
|
||||
ReactShadowNode cssNode,
|
||||
int rootViewTag,
|
||||
|
||||
Reference in New Issue
Block a user