diff options
| author | 2022-04-12 22:05:51 +0000 | |
|---|---|---|
| committer | 2022-04-12 22:06:16 +0000 | |
| commit | 76bbf7a7311ca558149ea2c4444e990d066b1144 (patch) | |
| tree | b9c617886be35c460144eb21c2a368252dcee077 | |
| parent | 71163eeeb30fe70943ec6e2ed377b349075627b0 (diff) | |
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
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java | 3 |
1 files changed, 3 insertions, 0 deletions
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 25fe8b9e0da3..ff3c0834cf62 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, |