Merge "Ensure that ViewGroup.getChildVisibleRect(...) is recursive." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
376f9f4bd6
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user