mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Do not start drag from pre-drag if cancelled during animation.
This change affects the preDragCondition for icons that do not have a popup menu. The condition assumes we are still in pre-drag after DragView is finished animating, but the user can cancel the drag in this time (e.g. by releasing their finger early). Test: Manual. Holding and releasing on suspended icon does not crash, while holding and dragging still works as expected. Fix: 258233476 Change-Id: Ic76f785cffcbfe0fe51eb1473022f2dc34563070
This commit is contained in:
@@ -207,8 +207,13 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im
|
||||
|
||||
if (FeatureFlags.ENABLE_TASKBAR_POPUP_MENU.get()
|
||||
&& !shouldStartDrag(0)) {
|
||||
// Immediately close the popup menu.
|
||||
mDragView.setOnAnimationEndCallback(() -> callOnDragStart());
|
||||
mDragView.setOnAnimationEndCallback(() -> {
|
||||
// Drag might be cancelled during the DragView animation, so check
|
||||
// mIsPreDrag again.
|
||||
if (mIsInPreDrag) {
|
||||
callOnDragStart();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user