From 1c35b08c9308adfc8dde562f97b29ca6d5d21dcf Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Fri, 11 Jul 2014 15:37:15 -0700 Subject: [PATCH] Add ViewGroup#getClipToPadding() It's kind of silly that we've gone this long without a good way to query this since it makes writing custom views that properly handle EdgeEffects, etc. a real pain. Change-Id: I08e1cdf9ec7b8ec3c287c22a5aa19d07a166a4e0 --- api/current.txt | 1 + core/java/android/view/ViewGroup.java | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/api/current.txt b/api/current.txt index 78c3917e6ca02..e1cc501c0df93 100644 --- a/api/current.txt +++ b/api/current.txt @@ -33640,6 +33640,7 @@ package android.view { method protected boolean getChildStaticTransformation(android.view.View, android.view.animation.Transformation); method public boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point); method public boolean getClipChildren(); + method public boolean getClipToPadding(); method public int getDescendantFocusability(); method public android.view.View getFocusedChild(); method public android.view.animation.LayoutAnimationController getLayoutAnimation(); diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index edc9971863586..ac70066a28511 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -3332,6 +3332,17 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } + /** + * Check if this ViewGroup is configured to clip child views to its padding. + * + * @return true if this ViewGroup clips children to its padding, false otherwise + * + * @attr ref android.R.styleable#ViewGroup_clipToPadding + */ + public boolean getClipToPadding() { + return hasBooleanFlag(FLAG_CLIP_TO_PADDING); + } + /** * {@inheritDoc} */