diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2012-09-28 16:12:14 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-28 16:12:15 -0700 |
commit | be290dd850c8e2c31830e2a87205499586f55353 (patch) | |
tree | 381aece8959c170da2275df28e169ff9dff2c733 /core/java | |
parent | 106a69271dd303baae1c428e269e1ec62994ff57 (diff) | |
parent | 15bbde41dafd592b8d45a7ee6003c1f0b439cb68 (diff) | |
download | frameworks_base-be290dd850c8e2c31830e2a87205499586f55353.zip frameworks_base-be290dd850c8e2c31830e2a87205499586f55353.tar.gz frameworks_base-be290dd850c8e2c31830e2a87205499586f55353.tar.bz2 |
Merge "Fix bug #7199562 UI mirroring for RTL locales (Arabic, Hebrew, Farsi): Play settings" into jb-mr1-dev
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/widget/CheckedTextView.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java index bc78adc..cea1fd5 100644 --- a/core/java/android/widget/CheckedTextView.java +++ b/core/java/android/widget/CheckedTextView.java @@ -46,6 +46,9 @@ public class CheckedTextView extends TextView implements Checkable { private int mCheckMarkWidth; private boolean mNeedRequestlayout; + private int initialPaddingLeft = -1; + private int initialPaddingRight = -1; + private static final int[] CHECKED_STATE_SET = { R.attr.state_checked }; @@ -176,10 +179,22 @@ public class CheckedTextView extends TextView implements Checkable { protected void internalSetPadding(int left, int top, int right, int bottom) { super.internalSetPadding(left, top, right, bottom); setBasePadding(isLayoutRtl()); + initialPaddingLeft = mPaddingLeft; + initialPaddingRight = mPaddingRight; } @Override public void onPaddingChanged(int layoutDirection) { + updatePadding(); + } + + @Override + public void onRtlPropertiesChanged() { + super.onRtlPropertiesChanged(); + updatePadding(); + } + + private void updatePadding() { int newPadding = (mCheckMarkDrawable != null) ? mCheckMarkWidth + mBasePadding : mBasePadding; mNeedRequestlayout |= (mPaddingRight != newPadding); @@ -193,7 +208,7 @@ public class CheckedTextView extends TextView implements Checkable { mNeedRequestlayout = false; } } - + @Override public void setPadding(int left, int top, int right, int bottom) { super.setPadding(left, top, right, bottom); |