mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-07 09:27:29 +08:00
ForceMountToView when Opacity or other View-specific properties are applied to a FlatShadowNode
Summary: @public There are some properties, such as alpha or scale that we ONLY handle on a View level. This means that whenever we encounter a FlatShadowNode with this property, it should be mapped to a View. This diff is doing exactly this. Reviewed By: ahmedre Differential Revision: D2694495
This commit is contained in:
committed by
Ahmed El-Helw
parent
0d042c2ef4
commit
1da7049426
@@ -79,10 +79,15 @@ public class FlatUIImplementation extends UIImplementation {
|
||||
protected void handleCreateView(
|
||||
ReactShadowNode cssNode,
|
||||
int rootViewTag,
|
||||
CatalystStylesDiffMap styles) {
|
||||
int tag = cssNode.getReactTag();
|
||||
@Nullable CatalystStylesDiffMap styles) {
|
||||
FlatShadowNode node = (FlatShadowNode) cssNode;
|
||||
|
||||
if (styles != null) {
|
||||
node.handleUpdateProperties(styles);
|
||||
}
|
||||
|
||||
if (node.mountsToView()) {
|
||||
int tag = cssNode.getReactTag();
|
||||
mStateBuilder.ensureBackingViewIsCreated(node, tag, styles);
|
||||
}
|
||||
}
|
||||
@@ -92,9 +97,12 @@ public class FlatUIImplementation extends UIImplementation {
|
||||
ReactShadowNode cssNode,
|
||||
String className,
|
||||
CatalystStylesDiffMap styles) {
|
||||
int tag = cssNode.getReactTag();
|
||||
FlatShadowNode node = (FlatShadowNode) cssNode;
|
||||
|
||||
node.handleUpdateProperties(styles);
|
||||
|
||||
if (node.mountsToView()) {
|
||||
int tag = cssNode.getReactTag();
|
||||
mStateBuilder.ensureBackingViewIsCreated(node, tag, styles);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user