Don't wrap unknown virtual nodes with AndroidView
Summary: Currently, we wrap all unknown shadow nodes with AndroidView. This works great, except when the shadow node is virtual, i.e. it *doesn't* mount to a View. In this case, we just need to keep it in the hierarchy as is. Fixes ARTSurfaceView not working correctly in groups. Reviewed By: ahmedre Differential Revision: D2933325
This commit is contained in:
parent
4bff818706
commit
8702a75b96
|
@ -79,8 +79,10 @@ import com.facebook.react.uimanager.ViewManager;
|
|||
@Override
|
||||
public void addChildAt(CSSNode child, int i) {
|
||||
super.addChildAt(child, i);
|
||||
if (child instanceof FlatShadowNode) {
|
||||
((FlatShadowNode) child).forceMountToView();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPadding(int spacingType, float padding) {
|
||||
|
|
|
@ -110,7 +110,7 @@ public class FlatUIImplementation extends UIImplementation {
|
|||
@Override
|
||||
protected ReactShadowNode createShadowNode(String className) {
|
||||
ReactShadowNode cssNode = super.createShadowNode(className);
|
||||
if (cssNode instanceof FlatShadowNode) {
|
||||
if (cssNode instanceof FlatShadowNode || cssNode.isVirtual()) {
|
||||
return cssNode;
|
||||
}
|
||||
|
||||
|
@ -122,6 +122,7 @@ public class FlatUIImplementation extends UIImplementation {
|
|||
ReactShadowNode cssNode,
|
||||
int rootViewTag,
|
||||
@Nullable ReactStylesDiffMap styles) {
|
||||
if (cssNode instanceof FlatShadowNode) {
|
||||
FlatShadowNode node = (FlatShadowNode) cssNode;
|
||||
|
||||
if (styles != null) {
|
||||
|
@ -132,6 +133,9 @@ public class FlatUIImplementation extends UIImplementation {
|
|||
int tag = cssNode.getReactTag();
|
||||
mStateBuilder.ensureBackingViewIsCreated(node, tag, styles);
|
||||
}
|
||||
} else {
|
||||
super.handleCreateView(cssNode, rootViewTag, styles);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -139,6 +143,7 @@ public class FlatUIImplementation extends UIImplementation {
|
|||
ReactShadowNode cssNode,
|
||||
String className,
|
||||
ReactStylesDiffMap styles) {
|
||||
if (cssNode instanceof FlatShadowNode) {
|
||||
FlatShadowNode node = (FlatShadowNode) cssNode;
|
||||
|
||||
node.handleUpdateProperties(styles);
|
||||
|
@ -147,6 +152,9 @@ public class FlatUIImplementation extends UIImplementation {
|
|||
int tag = cssNode.getReactTag();
|
||||
mStateBuilder.ensureBackingViewIsCreated(node, tag, styles);
|
||||
}
|
||||
} else {
|
||||
super.handleUpdateView(cssNode, className, styles);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue