Fix calculation of RelativeLayout width in RTL mode
Fixes: 37035671
Test: Manual
Test: bit CtsWidgetTestCases:.RelativeLayoutTest
Change-Id: I82feecdba7d1ed1198580758ab1f68932bb50aa7
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java
index 33e6521..75fc538 100644
--- a/core/java/android/widget/RelativeLayout.java
+++ b/core/java/android/widget/RelativeLayout.java
@@ -486,7 +486,7 @@
if (targetSdkVersion < Build.VERSION_CODES.KITKAT) {
width = Math.max(width, myWidth - params.mLeft);
} else {
- width = Math.max(width, myWidth - params.mLeft - params.leftMargin);
+ width = Math.max(width, myWidth - params.mLeft + params.leftMargin);
}
} else {
if (targetSdkVersion < Build.VERSION_CODES.KITKAT) {