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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user