mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-03 07:14:59 +08:00
Implement RemoveClippedSubviews for Nodes
Summary: RN has an optimization in which a ScrollView (or similar ViewGroups) can ask to remove clipped subviews from the View hierarchy. This patch implements this optimization for Nodes, but instead of adding and removing the Views, it attaches and detaches Views instead. Note that this patch does not handle overflow: visible. This is addressed in a stacked patch on top of this patch (to simplify the review process). Reviewed By: astreet Differential Revision: D3235050
This commit is contained in:
@@ -13,6 +13,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
import com.facebook.react.bridge.Callback;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.uimanager.NoSuchNativeViewException;
|
||||
import com.facebook.react.uimanager.PixelUtil;
|
||||
import com.facebook.react.uimanager.UIViewOperationQueue;
|
||||
|
||||
@@ -180,8 +181,15 @@ import com.facebook.react.uimanager.UIViewOperationQueue;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
// Measure native View
|
||||
mNativeViewHierarchyManager.measure(mReactTag, MEASURE_BUFFER);
|
||||
try {
|
||||
// Measure native View
|
||||
mNativeViewHierarchyManager.measure(mReactTag, MEASURE_BUFFER);
|
||||
} catch (NoSuchNativeViewException noSuchNativeViewException) {
|
||||
// Invoke with no args to signal failure and to allow JS to clean up the callback
|
||||
// handle.
|
||||
mCallback.invoke();
|
||||
return;
|
||||
}
|
||||
|
||||
float nativeViewX = MEASURE_BUFFER[0];
|
||||
float nativeViewY = MEASURE_BUFFER[1];
|
||||
|
||||
Reference in New Issue
Block a user