mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 02:38:20 +00:00
Cleaning up drag state management.
When the drag is started, the UI automatically goes into spring loaded mode. On a successful
drop, it is the responsibility of the {@link DropTarget} to exit out of the spring loaded
mode. If the drop was cancelled for some reason, the UI will automatically exit out of this mode.
Bug: 34692289
Change-Id: Ic611739a43bb8d9279b587aaee3039326c143e8b
This commit is contained in:
@@ -59,9 +59,6 @@ public interface DropTarget {
|
||||
/** The object is part of an accessible drag operation */
|
||||
public boolean accessibleDrag;
|
||||
|
||||
/** Post drag animation runnable */
|
||||
public Runnable postAnimationRunnable = null;
|
||||
|
||||
/** Indicates that the drag operation was cancelled */
|
||||
public boolean cancelled = false;
|
||||
|
||||
@@ -105,7 +102,14 @@ public interface DropTarget {
|
||||
boolean isDropEnabled();
|
||||
|
||||
/**
|
||||
* Handle an object being dropped on the DropTarget
|
||||
* Handle an object being dropped on the DropTarget.
|
||||
*
|
||||
* This will be called only if this target previously returned true for {@link #acceptDrop}. It
|
||||
* is the responsibility of this target to exit out of the spring loaded mode (either
|
||||
* immediately or after any pending animations).
|
||||
*
|
||||
* If the drop was cancelled for some reason, onDrop will never get called, the UI will
|
||||
* automatically exit out of this mode.
|
||||
*/
|
||||
void onDrop(DragObject dragObject, DragOptions options);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user