mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Create a new DragOptions for every drag operation
Previously we were reusing the same DragOptions which led to some bad states. Test: Drag items around, ensure nothing disappears from Workspace Bug: 182079330 Change-Id: I8d6027bc984db8c770841bb560735604689ad0ff
This commit is contained in:
@@ -85,7 +85,7 @@ public abstract class BaseQuickstepLauncher extends Launcher
|
||||
private @Nullable TaskbarController mTaskbarController;
|
||||
private final TaskbarStateHandler mTaskbarStateHandler = new TaskbarStateHandler(this);
|
||||
// Will be updated when dragging from taskbar.
|
||||
private DragOptions mWorkspaceDragOptions = new DragOptions();
|
||||
private @Nullable DragOptions mNextWorkspaceDragOptions = null;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -274,11 +274,16 @@ public abstract class BaseQuickstepLauncher extends Launcher
|
||||
|
||||
@Override
|
||||
public DragOptions getDefaultWorkspaceDragOptions() {
|
||||
return mWorkspaceDragOptions;
|
||||
if (mNextWorkspaceDragOptions != null) {
|
||||
DragOptions options = mNextWorkspaceDragOptions;
|
||||
mNextWorkspaceDragOptions = null;
|
||||
return options;
|
||||
}
|
||||
return super.getDefaultWorkspaceDragOptions();
|
||||
}
|
||||
|
||||
public void setWorkspaceDragOptions(DragOptions dragOptions) {
|
||||
mWorkspaceDragOptions = dragOptions;
|
||||
public void setNextWorkspaceDragOptions(DragOptions dragOptions) {
|
||||
mNextWorkspaceDragOptions = dragOptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user