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

Commit 8f7707c8 authored by Alison Cichowlas's avatar Alison Cichowlas Committed by android-build-merger
Browse files

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

am: e3fa94c1

Change-Id: Ia625908f656523e00526b8d0754b796dac4abeb0
parents 4bdfb400 e3fa94c1
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);