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

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

Merge "Maintain order in GlobalActions when rotating to/from seascape." into pi-dev

parents 623658e1 f8e71cd4
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -175,9 +175,6 @@ public class HardwareUiLayout extends FrameLayout implements Tunable {
                mRotatedBackground = true;
                mBackground.setRotatedBackground(true);
                LinearLayout linearLayout = (LinearLayout) mChild;
                if (to == ROTATION_SEASCAPE) {
                    swapOrder(linearLayout);
                }
                if (mSwapOrientation) {
                    linearLayout.setOrientation(LinearLayout.HORIZONTAL);
                }
@@ -188,9 +185,6 @@ public class HardwareUiLayout extends FrameLayout implements Tunable {
                mRotatedBackground = false;
                mBackground.setRotatedBackground(false);
                LinearLayout linearLayout = (LinearLayout) mChild;
                if (from == ROTATION_SEASCAPE) {
                    swapOrder(linearLayout);
                }
                if (mSwapOrientation) {
                    linearLayout.setOrientation(LinearLayout.VERTICAL);
                }
@@ -199,15 +193,6 @@ public class HardwareUiLayout extends FrameLayout implements Tunable {
        }
    }

    private void swapOrder(LinearLayout linearLayout) {
        ArrayList<View> children = new ArrayList<>();
        for (int i = 0; i < linearLayout.getChildCount(); i++) {
            children.add(0, linearLayout.getChildAt(0));
            linearLayout.removeViewAt(0);
        }
        children.forEach(v -> linearLayout.addView(v));
    }

    private void rotateRight() {
        rotateRight(this);
        rotateRight(mChild);