From 7b1a6f76de4470f6ad7ca7ec49cde50b1cf962ad Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Fri, 16 Aug 2013 15:03:35 -0700 Subject: [PATCH] Fix padding resolution BUG: 10361243 Change-Id: I61b03c08b45ca9c921bf787274bdbb3f174bbc7e --- core/java/android/view/View.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 747e8eae192b9..b000c93bcd4cc 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -12076,12 +12076,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @hide */ public void resolvePadding() { + final int resolvedLayoutDirection = getLayoutDirection(); + if (!isRtlCompatibilityMode()) { // Post Jelly Bean MR1 case: we need to take the resolved layout direction into account. // If start / end padding are defined, they will be resolved (hence overriding) to // left / right or right / left depending on the resolved layout direction. // If start / end padding are not defined, use the left / right ones. - int resolvedLayoutDirection = getLayoutDirection(); switch (resolvedLayoutDirection) { case LAYOUT_DIRECTION_RTL: if (mUserPaddingStart != UNDEFINED_PADDING) { @@ -12110,11 +12111,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } mUserPaddingBottom = (mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom; - - onRtlPropertiesChanged(resolvedLayoutDirection); } internalSetPadding(mUserPaddingLeft, mPaddingTop, mUserPaddingRight, mUserPaddingBottom); + onRtlPropertiesChanged(resolvedLayoutDirection); mPrivateFlags2 |= PFLAG2_PADDING_RESOLVED; }