mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Adding support for keyboard based drag and drop
For keyboard DnD, we use Accessible DnD implementation. A placeholder FloatingView draws the focus indicator for the virtual views Test: Visible Bug: 178781566 Change-Id: I632fc7377dffa1e05e3f0a9c3ad18641deb5a1a4
This commit is contained in:
@@ -131,7 +131,10 @@ public class DropTargetBar extends FrameLayout
|
||||
int width = MeasureSpec.getSize(widthMeasureSpec);
|
||||
int height = MeasureSpec.getSize(heightMeasureSpec);
|
||||
|
||||
if (mIsVertical) {
|
||||
int visibleCount = getVisibleButtonsCount();
|
||||
if (visibleCount == 0) {
|
||||
// do nothing
|
||||
} else if (mIsVertical) {
|
||||
int widthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY);
|
||||
int heightSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST);
|
||||
|
||||
@@ -142,7 +145,6 @@ public class DropTargetBar extends FrameLayout
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int visibleCount = getVisibleButtonsCount();
|
||||
int availableWidth = width / visibleCount;
|
||||
boolean textVisible = true;
|
||||
for (ButtonDropTarget buttons : mDropTargets) {
|
||||
@@ -165,7 +167,10 @@ public class DropTargetBar extends FrameLayout
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
if (mIsVertical) {
|
||||
int visibleCount = getVisibleButtonsCount();
|
||||
if (visibleCount == 0) {
|
||||
// do nothing
|
||||
} else if (mIsVertical) {
|
||||
int gap = getResources().getDimensionPixelSize(R.dimen.drop_target_vertical_gap);
|
||||
int start = gap;
|
||||
int end;
|
||||
@@ -178,7 +183,6 @@ public class DropTargetBar extends FrameLayout
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int visibleCount = getVisibleButtonsCount();
|
||||
int frameSize = (right - left) / visibleCount;
|
||||
|
||||
int start = frameSize / 2;
|
||||
|
||||
Reference in New Issue
Block a user