From 520f70bd57e8211a375990a9e0d805a0a738b176 Mon Sep 17 00:00:00 2001 From: Ahmed El-Helw Date: Fri, 22 Jul 2016 15:14:46 -0700 Subject: [PATCH] Fix measureInWindow for view-backed Nodes Summary: This patch fixes measureInWindow for Nodes backed by Views. Whereas the intention was to call the super implementation when we have a Node backed by a View, we instead called the super implementation of measure, which doesn't measure relative to window. Differential Revision: D3607890 --- .../java/com/facebook/react/flat/FlatUIImplementation.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatUIImplementation.java b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatUIImplementation.java index 161419319..0aaaed255 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatUIImplementation.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatUIImplementation.java @@ -195,7 +195,11 @@ public class FlatUIImplementation extends UIImplementation { FlatShadowNode node = (FlatShadowNode) resolveShadowNode(reactTag); if (node.mountsToView()) { mStateBuilder.ensureBackingViewIsCreated(node); - super.measure(reactTag, callback); + if (relativeToWindow) { + super.measureInWindow(reactTag, callback); + } else { + super.measure(reactTag, callback); + } return; }