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

Commit 0abeff2d authored by Lucas Dupin's avatar Lucas Dupin Committed by android-build-merger
Browse files

Merge "Fix RTL actions alignment" into pi-dev

am: 4024376f

Change-Id: I56687a07b00914386b018a4e67bdf17300e6b5c1
parents 04655bca 4024376f
Loading
Loading
Loading
Loading
+11 −13
Original line number Diff line number Diff line
@@ -206,7 +206,17 @@ public class NotificationActionListLayout extends LinearLayout {
        final boolean centerAligned = (mGravity & Gravity.CENTER_HORIZONTAL) != 0;

        int childTop;
        int childLeft = centerAligned ? left + (right - left) / 2 - mTotalWidth / 2 : 0;
        int childLeft;
        if (centerAligned) {
            childLeft = mPaddingLeft + left + (right - left) / 2 - mTotalWidth / 2;
        } else {
            childLeft = mPaddingLeft;
            int absoluteGravity = Gravity.getAbsoluteGravity(Gravity.START, getLayoutDirection());
            if (absoluteGravity == Gravity.RIGHT) {
                childLeft += right - left - mTotalWidth;
            }
        }


        // Where bottom of child should go
        final int height = bottom - top;
@@ -216,18 +226,6 @@ public class NotificationActionListLayout extends LinearLayout {

        final int count = getChildCount();

        final int layoutDirection = getLayoutDirection();
        switch (Gravity.getAbsoluteGravity(Gravity.START, layoutDirection)) {
            case Gravity.RIGHT:
                childLeft += mPaddingLeft + right - left - mTotalWidth;
                break;

            case Gravity.LEFT:
            default:
                childLeft += mPaddingLeft;
                break;
        }

        int start = 0;
        int dir = 1;
        //In case of RTL, start drawing from the last child.