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
This commit is contained in:
Mady Mellor
2022-04-12 22:05:51 +00:00
parent 71163eeeb3
commit 76bbf7a731

View File

@@ -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,