Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60b108d7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix RTL issue in RelativeLayout"

parents c952978b bcd3520b
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -833,13 +833,19 @@ public class RelativeLayout extends ViewGroup {
                if (!wrapContent) {
                    centerHorizontal(child, params, myWidth);
                } else {
                    params.mLeft = mPaddingLeft + params.leftMargin;
                    params.mRight = params.mLeft + child.getMeasuredWidth();
                    positionAtEdge(child, params, myWidth);
                }
                return true;
            } else {
                // This is the default case. For RTL we start from the right and for LTR we start
                // from the left. This will give LEFT/TOP for LTR and RIGHT/TOP for RTL.
                positionAtEdge(child, params, myWidth);
            }
        }
        return rules[ALIGN_PARENT_END] != 0;
    }

    private void positionAtEdge(View child, LayoutParams params, int myWidth) {
        if (isLayoutRtl()) {
            params.mRight = myWidth - mPaddingRight - params.rightMargin;
            params.mLeft = params.mRight - child.getMeasuredWidth();
@@ -848,9 +854,6 @@ public class RelativeLayout extends ViewGroup {
            params.mRight = params.mLeft + child.getMeasuredWidth();
        }
    }
        }
        return rules[ALIGN_PARENT_END] != 0;
    }

    private boolean positionChildVertical(View child, LayoutParams params, int myHeight,
            boolean wrapContent) {
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layoutDirection="ltr"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

@@ -34,6 +33,7 @@
            android:layoutDirection="ltr"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:paddingTop="@dimen/timepicker_radial_picker_top_margin"
            android:orientation="horizontal">