mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Prevent dropping a drag from TaskbarAllApps in Overview
* Don't close TaskbarAllApps once drag starts (see comment in code regarding needing multiple shared drag layers) * Hide app menu split options for taskbar in overview * One TODO is that the animation needs to be tweaked because the scale of the icon when it's returned is too large. * I think maybe we have to change the TaskbarDragController#mDragIconSize since that gets directly set from a resource. Unclear. Test: Dragged in TaskbarAllApps in overivew and in split select, app returned to original position and not taskbar Bug: 251747761 Change-Id: I785f34b0bdb0b0abfc440450494074f8dfe7c31a
This commit is contained in:
@@ -48,6 +48,8 @@ public final class TaskbarAllAppsController {
|
||||
private AppInfo[] mApps;
|
||||
private int mAppsModelFlags;
|
||||
private List<ItemInfo> mPredictedApps;
|
||||
private boolean mDisallowGlobalDrag;
|
||||
private boolean mDisallowLongClick;
|
||||
|
||||
/** Initialize the controller. */
|
||||
public void init(TaskbarControllers controllers, boolean allAppsVisible) {
|
||||
@@ -78,6 +80,14 @@ public final class TaskbarAllAppsController {
|
||||
}
|
||||
}
|
||||
|
||||
public void setDisallowGlobalDrag(boolean disableDragForOverviewState) {
|
||||
mDisallowGlobalDrag = disableDragForOverviewState;
|
||||
}
|
||||
|
||||
public void setDisallowLongClick(boolean disallowLongClick) {
|
||||
mDisallowLongClick = disallowLongClick;
|
||||
}
|
||||
|
||||
/** Updates the current predictions. */
|
||||
public void setPredictedApps(List<ItemInfo> predictedApps) {
|
||||
if (!FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get()) {
|
||||
@@ -123,6 +133,12 @@ public final class TaskbarAllAppsController {
|
||||
mAppsView.getFloatingHeaderView()
|
||||
.findFixedRowByType(PredictionRowView.class)
|
||||
.setPredictedApps(mPredictedApps);
|
||||
// 1 alternative that would be more work:
|
||||
// Create a shared drag layer between taskbar and taskbarAllApps so that when dragging
|
||||
// starts and taskbarAllApps can close, but the drag layer that the view is being dragged in
|
||||
// doesn't also close
|
||||
overlayContext.getDragController().setDisallowGlobalDrag(mDisallowGlobalDrag);
|
||||
overlayContext.getDragController().setDisallowLongClick(mDisallowLongClick);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user