summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorPhil Dubach <phillipd@google.com>2009-07-08 09:43:49 -0700
committerPhil Dubach <phillipd@google.com>2009-07-08 09:43:49 -0700
commit90cfa9df3f3b586eae49ee2d2533a05238d391a4 (patch)
tree1f37854e8ed63d59692b4f969eca97e8e235f20b /graphics
parent0d725f7d5a7efd9dc63f6ddb67a619d659bb4428 (diff)
downloadframeworks_base-90cfa9df3f3b586eae49ee2d2533a05238d391a4.zip
frameworks_base-90cfa9df3f3b586eae49ee2d2533a05238d391a4.tar.gz
frameworks_base-90cfa9df3f3b586eae49ee2d2533a05238d391a4.tar.bz2
Fix ShapeDrawable.inflateTag() to accept proper dimension specs for padding
ShapeDrawable.inflateTag() handles the 'padding' tag with the standard attributes android:left, etc. The attribute values for these standard attributes should be dimension specifications, e.g. '4dp'. ShapeDrawable.inflateTag() was wrongly parsing the attribute values as plain integers.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/drawable/ShapeDrawable.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/graphics/java/android/graphics/drawable/ShapeDrawable.java b/graphics/java/android/graphics/drawable/ShapeDrawable.java
index d24194f..6677a35 100644
--- a/graphics/java/android/graphics/drawable/ShapeDrawable.java
+++ b/graphics/java/android/graphics/drawable/ShapeDrawable.java
@@ -278,10 +278,15 @@ public class ShapeDrawable extends Drawable {
if (name.equals("padding")) {
TypedArray a = r.obtainAttributes(attrs,
com.android.internal.R.styleable.ShapeDrawablePadding);
- setPadding(a.getInt(com.android.internal.R.styleable.ShapeDrawablePadding_left, 0),
- a.getInt(com.android.internal.R.styleable.ShapeDrawablePadding_top, 0),
- a.getInt(com.android.internal.R.styleable.ShapeDrawablePadding_right, 0),
- a.getInt(com.android.internal.R.styleable.ShapeDrawablePadding_bottom, 0));
+ setPadding(
+ a.getDimensionPixelOffset(
+ com.android.internal.R.styleable.ShapeDrawablePadding_left, 0),
+ a.getDimensionPixelOffset(
+ com.android.internal.R.styleable.ShapeDrawablePadding_top, 0),
+ a.getDimensionPixelOffset(
+ com.android.internal.R.styleable.ShapeDrawablePadding_right, 0),
+ a.getDimensionPixelOffset(
+ com.android.internal.R.styleable.ShapeDrawablePadding_bottom, 0));
a.recycle();
return true;
}