From 66b33cb5d182bf6aa16740e0a94939e3954f9aa0 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Fri, 12 Aug 2022 15:55:35 -0700 Subject: 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 --- .../Shell/src/com/android/wm/shell/draganddrop/DragLayout.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java index ff3c0834cf62..497a6f696df8 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java @@ -105,6 +105,10 @@ public class DragLayout extends LinearLayout { MATCH_PARENT)); ((LayoutParams) mDropZoneView1.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); } -- cgit v1.2.3-59-g8ed1b