Merge "Ensure that ViewGroup.getChildVisibleRect(...) is recursive." into nyc-dev

am: 376f9f4bd6

* commit '376f9f4bd6ba2e117f0356161c767225f47f2745':
  Ensure that ViewGroup.getChildVisibleRect(...) is recursive.

Change-Id: I35ef50e803c17df3911bee580e604992768df484
This commit is contained in:
Abodunrinwa Toki
2016-05-16 09:44:05 +00:00
committed by android-build-merger

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 * @hide
*/ */
public boolean getChildVisibleRect( 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)); (int) Math.ceil(rect.right), (int) Math.ceil(rect.bottom));
if ((forceParentCheck || rectIsVisible) && mParent != null) { 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; return rectIsVisible;
} }