mirror of
https://github.com/status-im/react-native.git
synced 2025-02-19 12:57:00 +00:00
Remove unnecessary view mounting when views are clipped.
Summary: Reduced view attaching by 93% in mountViews. Reviewed By: ahmedre Differential Revision: D3477555
This commit is contained in:
parent
e5c81e1c1b
commit
298a3f947b
@ -492,13 +492,14 @@ import com.facebook.react.views.view.ReactClippingViewGroupHelper;
|
||||
addViewInLayout(view, -1, ensureLayoutParams(view.getLayoutParams()), true);
|
||||
} else {
|
||||
View view = ensureViewHasNoParent(viewResolver.getView(-viewToAdd));
|
||||
attachViewToParent(view, -1, ensureLayoutParams(view.getLayoutParams()));
|
||||
if (mRemoveClippedSubviews) {
|
||||
mClippedSubviews.remove(-viewToAdd);
|
||||
DrawView drawView = mDrawViewMap.get(-viewToAdd);
|
||||
if (drawView != null) {
|
||||
drawView.isViewGroupClipped = false;
|
||||
DrawView drawView = Assertions.assertNotNull(mDrawViewMap.get(-viewToAdd));
|
||||
// If the view is clipped, we don't need to attach it.
|
||||
if (!drawView.isViewGroupClipped) {
|
||||
attachViewToParent(view, -1, ensureLayoutParams(view.getLayoutParams()));
|
||||
}
|
||||
} else {
|
||||
attachViewToParent(view, -1, ensureLayoutParams(view.getLayoutParams()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user