From 76bbf7a7311ca558149ea2c4444e990d066b1144 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Tue, 12 Apr 2022 22:05:51 +0000 Subject: [PATCH] Fix drag to split in RTL The code assumes that the views are in LTR order, so when the device is in RTL, the wrong view gets highlighted. The code thinks dropzone1 is on the left side, but in RTL it'd be on the right. Fix for this is to just always layout the views in LTR. Bug: 228530510 Test: manual - put the device in RTL and drag an app into split => verify that the highlight is on the correct side Change-Id: I05e548143ed7042c4151252b46fa1b96d8ac7409 --- .../Shell/src/com/android/wm/shell/draganddrop/DragLayout.java | 3 +++ 1 file changed, 3 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 25fe8b9e0da31..ff3c0834cf624 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 @@ -94,6 +94,9 @@ public class DragLayout extends LinearLayout { mDividerSize = context.getResources().getDimensionPixelSize( R.dimen.split_divider_bar_width); + // Always use LTR because we assume dropZoneView1 is on the left and 2 is on the right when + // showing the highlight. + setLayoutDirection(LAYOUT_DIRECTION_LTR); mDropZoneView1 = new DropZoneView(context); mDropZoneView2 = new DropZoneView(context); addView(mDropZoneView1, new LinearLayout.LayoutParams(MATCH_PARENT,