mirror of
https://github.com/status-im/react-native.git
synced 2025-02-21 05:38:10 +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);
|
addViewInLayout(view, -1, ensureLayoutParams(view.getLayoutParams()), true);
|
||||||
} else {
|
} else {
|
||||||
View view = ensureViewHasNoParent(viewResolver.getView(-viewToAdd));
|
View view = ensureViewHasNoParent(viewResolver.getView(-viewToAdd));
|
||||||
attachViewToParent(view, -1, ensureLayoutParams(view.getLayoutParams()));
|
|
||||||
if (mRemoveClippedSubviews) {
|
if (mRemoveClippedSubviews) {
|
||||||
mClippedSubviews.remove(-viewToAdd);
|
DrawView drawView = Assertions.assertNotNull(mDrawViewMap.get(-viewToAdd));
|
||||||
DrawView drawView = mDrawViewMap.get(-viewToAdd);
|
// If the view is clipped, we don't need to attach it.
|
||||||
if (drawView != null) {
|
if (!drawView.isViewGroupClipped) {
|
||||||
drawView.isViewGroupClipped = false;
|
attachViewToParent(view, -1, ensureLayoutParams(view.getLayoutParams()));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
attachViewToParent(view, -1, ensureLayoutParams(view.getLayoutParams()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user