Clip all views when removing clipping subviews, rather than just FlatViewGroup views.

Summary: Currently only FlatViewGroup children were clipped, rather than all offscreen Android views.

Reviewed By: ahmedre

Differential Revision: D3462002
This commit is contained in:
Seth Kirby
2016-06-21 19:08:50 -07:00
committed by Ahmed El-Helw
parent 241fd0869d
commit 88dfd75aa7
2 changed files with 58 additions and 43 deletions

View File

@@ -148,8 +148,8 @@ import com.facebook.react.uimanager.ViewManagerRegistry;
if (view instanceof FlatViewGroup) {
FlatViewGroup flatViewGroup = (FlatViewGroup) view;
if (flatViewGroup.getRemoveClippedSubviews()) {
Collection<FlatViewGroup> detachedViews = flatViewGroup.getDetachedViews();
for (FlatViewGroup detachedChild : detachedViews) {
Collection<View> detachedViews = flatViewGroup.getDetachedViews();
for (View detachedChild : detachedViews) {
// we can do super here because removeClippedSubviews is currently not recursive. if/when
// we become recursive one day, this should call vanilla dropView to be recursive as well.
super.dropView(detachedChild);