Ensure that ViewGroup.getChildVisibleRect(...) is recursive.

This change fixes the issue where
getChildVisibleRect(View, Rect, Point, boolean) call isn't recursive.
The method was introduced in I49550ed4082bcbdcfe4643b962b50f3308092525

Bug: 28514727
Change-Id: Ib6b0fb67ca6c700b44f645319c23b1213a2742d4
This commit is contained in:
Abodunrinwa Toki
2016-05-13 19:26:03 +01:00
parent a63801a7c2
commit cb66406d33

View File

@@ -5482,6 +5482,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
}
/**
* @param forceParentCheck true to guarantee that this call will propagate to all ancestors,
* false otherwise
*
* @hide
*/
public boolean getChildVisibleRect(
@@ -5541,7 +5544,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
(int) Math.ceil(rect.right), (int) Math.ceil(rect.bottom));
if ((forceParentCheck || rectIsVisible) && mParent != null) {
rectIsVisible = mParent.getChildVisibleRect(this, r, offset);
if (mParent instanceof ViewGroup) {
rectIsVisible = ((ViewGroup) mParent)
.getChildVisibleRect(this, r, offset, forceParentCheck);
} else {
rectIsVisible = mParent.getChildVisibleRect(this, r, offset);
}
}
return rectIsVisible;
}