mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Initiate Hotseat drag from long pressing corresponding Taskbar item
When you long press on the taskbar hotseat item, the following happens: - We start a system drag and drop with an invisible drag shadow - We create a new DragOptions with the simulatedDndStartPoint set to the drag down position, and tell Launcher to use that for the next drag - We perform a long click on the equivalent Hotseat item in Launcher - We pass the drag events of that operation to Launcher's DragController This allows Launcher to handle the entire drag operation, including the pre-drag (with popup), and taskbar already hides when the drag starts. Test: Long press items in taskbar hotseat, able to drag them to workspace Bug: 179886115 Bug: 171917176 Change-Id: I576b80cb1bd0225cdc91cf7689fdee0481265109
This commit is contained in:
@@ -170,7 +170,14 @@ public class TaskbarController {
|
||||
|
||||
@Override
|
||||
public View.OnLongClickListener getItemOnLongClickListener() {
|
||||
return mDragController::startDragOnLongClick;
|
||||
return view -> {
|
||||
if (mLauncher.hasBeenResumed() && view.getTag() instanceof ItemInfo) {
|
||||
alignRealHotseatWithTaskbar();
|
||||
return mDragController.startWorkspaceDragOnLongClick(view);
|
||||
} else {
|
||||
return mDragController.startSystemDragOnLongClick(view);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user