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

Commit 66b33cb5 authored by Mady Mellor's avatar Mady Mellor
Browse files

Set the linear layout direction based on initial config

Bug: 230077443
Test: - enable feature on phone
      - drag a notification from the shade
      => observe that the drop zones match current orientation
      - repeat in opposite orientation
      - repeat on tablet
Change-Id: I90fbb09d36bda7b66563dc4b4ac8fe1ec9d0cb31
parent 889241a5
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -105,6 +105,10 @@ public class DragLayout extends LinearLayout {
                MATCH_PARENT));
                MATCH_PARENT));
        ((LayoutParams) mDropZoneView1.getLayoutParams()).weight = 1;
        ((LayoutParams) mDropZoneView1.getLayoutParams()).weight = 1;
        ((LayoutParams) mDropZoneView2.getLayoutParams()).weight = 1;
        ((LayoutParams) mDropZoneView2.getLayoutParams()).weight = 1;
        int orientation = getResources().getConfiguration().orientation;
        setOrientation(orientation == Configuration.ORIENTATION_LANDSCAPE
                ? LinearLayout.HORIZONTAL
                : LinearLayout.VERTICAL);
        updateContainerMargins(getResources().getConfiguration().orientation);
        updateContainerMargins(getResources().getConfiguration().orientation);
    }
    }