summaryrefslogtreecommitdiffstats
path: root/graphics/java/android
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2013-11-06 15:32:01 -0800
committerFabrice Di Meglio <fdimeglio@google.com>2013-11-06 15:32:01 -0800
commitf7a93ef3847258157d144dfefaa5757128cc807d (patch)
treec9836a9e7aa1b367a7d5ea51aad8f7fee32cb501 /graphics/java/android
parentbe0b05a028ebc1b49ed32b79d53af384106c31a3 (diff)
downloadframeworks_base-f7a93ef3847258157d144dfefaa5757128cc807d.zip
frameworks_base-f7a93ef3847258157d144dfefaa5757128cc807d.tar.gz
frameworks_base-f7a93ef3847258157d144dfefaa5757128cc807d.tar.bz2
Fix bug #11537133 Hideycling looks broken (KOT36), missing left padding
- enforce the Drawable boolean getPadding(Rect) contract for NinePatchDrawable and DrawableContainer. - as NinePatchDrawable was not enforcing it, the consequence was that the mUserPaddingLeftInitial / mUserPaddingRitghInitial were reset to "0" (even if they got the correct value before the reset). Change-Id: I1efe7fad5f89c0ca47f90189f6d89940e0e9c6ae
Diffstat (limited to 'graphics/java/android')
-rw-r--r--graphics/java/android/graphics/drawable/DrawableContainer.java3
-rw-r--r--graphics/java/android/graphics/drawable/NinePatchDrawable.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java
index 60e2376..d31f220 100644
--- a/graphics/java/android/graphics/drawable/DrawableContainer.java
+++ b/graphics/java/android/graphics/drawable/DrawableContainer.java
@@ -88,9 +88,10 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
@Override
public boolean getPadding(Rect padding) {
final Rect r = mDrawableContainerState.getConstantPadding();
- boolean result = true;
+ boolean result;
if (r != null) {
padding.set(r);
+ result = (r.left | r.top | r.bottom | r.right) != 0;
} else {
if (mCurrDrawable != null) {
result = mCurrDrawable.getPadding(padding);
diff --git a/graphics/java/android/graphics/drawable/NinePatchDrawable.java b/graphics/java/android/graphics/drawable/NinePatchDrawable.java
index ab34c0f..9c57a2c 100644
--- a/graphics/java/android/graphics/drawable/NinePatchDrawable.java
+++ b/graphics/java/android/graphics/drawable/NinePatchDrawable.java
@@ -244,7 +244,7 @@ public class NinePatchDrawable extends Drawable {
} else {
padding.set(mPadding);
}
- return true;
+ return (padding.left | padding.top | padding.right | padding.bottom) != 0;
}
/**