Loading core/java/android/view/View.java +9 −1 Original line number Diff line number Diff line Loading @@ -719,6 +719,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ private static boolean sIgnoreMeasureCache = false; /** * Ignore the clipBounds of this view for the children. */ static boolean sIgnoreClipBoundsForChildren = false; /** * This view does not want keystrokes. Use with TAKES_FOCUS_MASK when * calling setFlags. Loading Loading @@ -2963,7 +2968,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Current clip bounds. to which all drawing of this view are constrained. */ private Rect mClipBounds = null; Rect mClipBounds = null; private boolean mLastIsOpaque; Loading Loading @@ -3511,6 +3516,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // of whether a layout was requested on that View. sIgnoreMeasureCache = targetSdkVersion < KITKAT; // Older apps may need this to ignore the clip bounds sIgnoreClipBoundsForChildren = targetSdkVersion < L; sCompatibilityDone = true; } } Loading core/java/android/view/ViewGroup.java +14 −4 Original line number Diff line number Diff line Loading @@ -2962,14 +2962,24 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } int saveCount = 0; int clipSaveCount = 0; final boolean clipToPadding = (flags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK; boolean hasClipBounds = mClipBounds != null && !sIgnoreClipBoundsForChildren; boolean clippingNeeded = clipToPadding || hasClipBounds; if (clippingNeeded) { clipSaveCount = canvas.save(); } if (clipToPadding) { saveCount = canvas.save(); canvas.clipRect(mScrollX + mPaddingLeft, mScrollY + mPaddingTop, mScrollX + mRight - mLeft - mPaddingRight, mScrollY + mBottom - mTop - mPaddingBottom); } if (hasClipBounds) { canvas.clipRect(mClipBounds.left, mClipBounds.top, mClipBounds.right, mClipBounds.bottom); } // We will draw our child's animation, let's reset the flag Loading Loading @@ -3010,8 +3020,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager onDebugDraw(canvas); } if (clipToPadding) { canvas.restoreToCount(saveCount); if (clippingNeeded) { canvas.restoreToCount(clipSaveCount); } // mGroupFlags might have been updated by drawChild() Loading Loading
core/java/android/view/View.java +9 −1 Original line number Diff line number Diff line Loading @@ -719,6 +719,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ private static boolean sIgnoreMeasureCache = false; /** * Ignore the clipBounds of this view for the children. */ static boolean sIgnoreClipBoundsForChildren = false; /** * This view does not want keystrokes. Use with TAKES_FOCUS_MASK when * calling setFlags. Loading Loading @@ -2963,7 +2968,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Current clip bounds. to which all drawing of this view are constrained. */ private Rect mClipBounds = null; Rect mClipBounds = null; private boolean mLastIsOpaque; Loading Loading @@ -3511,6 +3516,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // of whether a layout was requested on that View. sIgnoreMeasureCache = targetSdkVersion < KITKAT; // Older apps may need this to ignore the clip bounds sIgnoreClipBoundsForChildren = targetSdkVersion < L; sCompatibilityDone = true; } } Loading
core/java/android/view/ViewGroup.java +14 −4 Original line number Diff line number Diff line Loading @@ -2962,14 +2962,24 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } int saveCount = 0; int clipSaveCount = 0; final boolean clipToPadding = (flags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK; boolean hasClipBounds = mClipBounds != null && !sIgnoreClipBoundsForChildren; boolean clippingNeeded = clipToPadding || hasClipBounds; if (clippingNeeded) { clipSaveCount = canvas.save(); } if (clipToPadding) { saveCount = canvas.save(); canvas.clipRect(mScrollX + mPaddingLeft, mScrollY + mPaddingTop, mScrollX + mRight - mLeft - mPaddingRight, mScrollY + mBottom - mTop - mPaddingBottom); } if (hasClipBounds) { canvas.clipRect(mClipBounds.left, mClipBounds.top, mClipBounds.right, mClipBounds.bottom); } // We will draw our child's animation, let's reset the flag Loading Loading @@ -3010,8 +3020,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager onDebugDraw(canvas); } if (clipToPadding) { canvas.restoreToCount(saveCount); if (clippingNeeded) { canvas.restoreToCount(clipSaveCount); } // mGroupFlags might have been updated by drawChild() Loading