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:
Denis Koroskin
2015-12-15 14:29:58 -08:00
committed by Ahmed El-Helw
parent 0d042c2ef4
commit 1da7049426
2 changed files with 37 additions and 3 deletions

View File

@@ -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);
}
}