Skip to content

Commit 47fb191

Browse files
author
Fabrice Di Meglio
committed
Fix bug #7199562 UI mirroring for RTL locales (Arabic, Hebrew, Farsi): Play settings
- do not need those variables. Use what we already have in View. - reset padding to initial values before changing it. Change-Id: Ib396b3dca6e98a94d83a538a9b594b5eb426c453
1 parent 343e113 commit 47fb191

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

core/java/android/view/View.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14775,6 +14775,14 @@ public boolean isPaddingRelative() {
1477514775
return (mUserPaddingStart != UNDEFINED_PADDING || mUserPaddingEnd != UNDEFINED_PADDING);
1477614776
}
1477714777

14778+
/**
14779+
* @hide
14780+
*/
14781+
public void resetPaddingToInitialValues() {
14782+
mPaddingLeft = mUserPaddingLeftInitial;
14783+
mPaddingRight = mUserPaddingRightInitial;
14784+
}
14785+
1477814786
/**
1477914787
* @hide
1478014788
*/

core/java/android/widget/CheckedTextView.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ public class CheckedTextView extends TextView implements Checkable {
4646
private int mCheckMarkWidth;
4747
private boolean mNeedRequestlayout;
4848

49-
private int initialPaddingLeft = -1;
50-
private int initialPaddingRight = -1;
51-
5249
private static final int[] CHECKED_STATE_SET = {
5350
R.attr.state_checked
5451
};
@@ -179,8 +176,6 @@ public Drawable getCheckMarkDrawable() {
179176
protected void internalSetPadding(int left, int top, int right, int bottom) {
180177
super.internalSetPadding(left, top, right, bottom);
181178
setBasePadding(isLayoutRtl());
182-
initialPaddingLeft = mPaddingLeft;
183-
initialPaddingRight = mPaddingRight;
184179
}
185180

186181
@Override
@@ -190,6 +185,7 @@ public void onRtlPropertiesChanged(int layoutDirection) {
190185
}
191186

192187
private void updatePadding() {
188+
resetPaddingToInitialValues();
193189
int newPadding = (mCheckMarkDrawable != null) ?
194190
mCheckMarkWidth + mBasePadding : mBasePadding;
195191
mNeedRequestlayout |= (mPaddingRight != newPadding);

0 commit comments

Comments
 (0)