Skip to content

Commit fbc21e1

Browse files
author
Fabrice Di Meglio
committed
Fix bug #7325234 LayoutParams are not resolved correctly (Settings apps looks broken on Manta in Arabic)
- fix LayoutParams resolution for LinearLayout only - apply onResolveLayoutDirection() in both measureHorizontal() and measureVertical() Change-Id: I5fcded9a79cd9aaeb0e12da7fd14176b71ba2fb6
1 parent 64182d8 commit fbc21e1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/java/android/widget/LinearLayout.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,8 @@ void measureVertical(int widthMeasureSpec, int heightMeasureSpec) {
648648

649649
int largestChildHeight = Integer.MIN_VALUE;
650650

651+
final int layoutDirection = getLayoutDirection();
652+
651653
// See how tall everyone is. Also remember max width.
652654
for (int i = 0; i < count; ++i) {
653655
final View child = getVirtualChildAt(i);
@@ -667,6 +669,7 @@ void measureVertical(int widthMeasureSpec, int heightMeasureSpec) {
667669
}
668670

669671
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) child.getLayoutParams();
672+
lp.onResolveLayoutDirection(layoutDirection);
670673

671674
totalWeight += lp.weight;
672675

@@ -989,6 +992,8 @@ void measureHorizontal(int widthMeasureSpec, int heightMeasureSpec) {
989992

990993
int largestChildWidth = Integer.MIN_VALUE;
991994

995+
final int layoutDirection = getLayoutDirection();
996+
992997
// See how wide everyone is. Also remember max height.
993998
for (int i = 0; i < count; ++i) {
994999
final View child = getVirtualChildAt(i);
@@ -1009,6 +1014,7 @@ void measureHorizontal(int widthMeasureSpec, int heightMeasureSpec) {
10091014

10101015
final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams)
10111016
child.getLayoutParams();
1017+
lp.onResolveLayoutDirection(layoutDirection);
10121018

10131019
totalWeight += lp.weight;
10141020

0 commit comments

Comments
 (0)