Fix bug #7621927 Radio button/TextView drawable regression in 4.2
- as we remove the 9 patch padding trick, we need also to do the correct
positioning of the radio / checkbox / star during draw
Change-Id: I02b67bef9c0f2dc1c0c65361de14ab20ce9b881d
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index 421a324..452ad1b 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -248,6 +248,15 @@
return padding;
}
+ /**
+ * @hide
+ */
+ @Override
+ public int getHorizontalOffsetForDrawables() {
+ final Drawable buttonDrawable = mButtonDrawable;
+ return (buttonDrawable != null) ? buttonDrawable.getIntrinsicWidth() : 0;
+ }
+
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);