@@ -3666,15 +3666,10 @@ public void onClick(View v) {
36663666 // Padding from the background drawable is stored at this point in mUserPaddingLeftInitial
36673667 // and mUserPaddingRightInitial) so drawable padding will be used as ultimate default if
36683668 // defined.
3669- if (startPaddingDefined) {
3670- mUserPaddingLeftInitial = startPadding;
3671- } else if (leftPaddingDefined) {
3669+ if (leftPaddingDefined) {
36723670 mUserPaddingLeftInitial = leftPadding;
36733671 }
3674- if (endPaddingDefined) {
3675- mUserPaddingRightInitial = endPadding;
3676- }
3677- else if (rightPaddingDefined) {
3672+ if (rightPaddingDefined) {
36783673 mUserPaddingRightInitial = rightPadding;
36793674 }
36803675 }
@@ -11559,8 +11554,10 @@ protected void onAttachedToWindow() {
1155911554
1156011555 /**
1156111556 * Resolve all RTL related properties.
11557+ *
11558+ * @hide
1156211559 */
11563- void resolveRtlPropertiesIfNeeded() {
11560+ public void resolveRtlPropertiesIfNeeded() {
1156411561 if (!needRtlPropertiesResolution()) return;
1156511562
1156611563 // Order is important here: LayoutDirection MUST be resolved first
@@ -11584,8 +11581,12 @@ void resolveRtlPropertiesIfNeeded() {
1158411581 onRtlPropertiesChanged(getLayoutDirection());
1158511582 }
1158611583
11587- // Reset resolution of all RTL related properties.
11588- void resetRtlProperties() {
11584+ /**
11585+ * Reset resolution of all RTL related properties.
11586+ *
11587+ * @hide
11588+ */
11589+ public void resetRtlProperties() {
1158911590 resetResolvedLayoutDirection();
1159011591 resetResolvedTextDirection();
1159111592 resetResolvedTextAlignment();
@@ -14195,7 +14196,7 @@ public void unscheduleDrawable(Drawable who) {
1419514196 *
1419614197 * @hide
1419714198 */
14198- public void resolveDrawables() {
14199+ protected void resolveDrawables() {
1419914200 if (mBackground != null) {
1420014201 mBackground.setLayoutDirection(getLayoutDirection());
1420114202 }
@@ -14218,7 +14219,10 @@ public void resolveDrawables() {
1421814219 public void onResolveDrawables(int layoutDirection) {
1421914220 }
1422014221
14221- private void resetResolvedDrawables() {
14222+ /**
14223+ * @hide
14224+ */
14225+ protected void resetResolvedDrawables() {
1422214226 mPrivateFlags2 &= ~PFLAG2_DRAWABLE_RESOLVED;
1422314227 }
1422414228
@@ -14804,14 +14808,14 @@ public void resetPaddingToInitialValues() {
1480414808 if (isRtlCompatibilityMode()) {
1480514809 mPaddingLeft = mUserPaddingLeftInitial;
1480614810 mPaddingRight = mUserPaddingRightInitial;
14811+ return;
14812+ }
14813+ if (isLayoutRtl()) {
14814+ mPaddingLeft = (mUserPaddingEnd >= 0) ? mUserPaddingEnd : mUserPaddingLeftInitial;
14815+ mPaddingRight = (mUserPaddingStart >= 0) ? mUserPaddingStart : mUserPaddingRightInitial;
1480714816 } else {
14808- if (isLayoutRtl()) {
14809- mPaddingLeft = mUserPaddingRightInitial;
14810- mPaddingRight = mUserPaddingLeftInitial;
14811- } else {
14812- mPaddingLeft = mUserPaddingLeftInitial;
14813- mPaddingRight = mUserPaddingRightInitial;
14814- }
14817+ mPaddingLeft = (mUserPaddingStart >= 0) ? mUserPaddingStart : mUserPaddingLeftInitial;
14818+ mPaddingRight = (mUserPaddingEnd >= 0) ? mUserPaddingEnd : mUserPaddingRightInitial;
1481514819 }
1481614820 }
1481714821
0 commit comments