mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Add undo snackbar for deleting items
- Add methods to ModelWriter to prepareForUndoDelete, then enqueueDeleteRunnable, followed by commitDelete or abortDelete. - Add Snackbar floating view - Show Undo snackbar when dropping or flinging to delete target; if the undo action is clicked, we abort the delete, otherwise we commit it. Bug: 24238108 Change-Id: I9997235e1f8525cbb8b1fa2338099609e7358426
This commit is contained in:
@@ -264,6 +264,10 @@ public abstract class ButtonDropTarget extends TextView
|
||||
*/
|
||||
@Override
|
||||
public void onDrop(final DragObject d, final DragOptions options) {
|
||||
if (options.isFlingToDelete) {
|
||||
// FlingAnimation handles the animation and then calls completeDrop().
|
||||
return;
|
||||
}
|
||||
final DragLayer dragLayer = mLauncher.getDragLayer();
|
||||
final Rect from = new Rect();
|
||||
dragLayer.getViewRectRelativeToSelf(d.dragView, from);
|
||||
|
||||
Reference in New Issue
Block a user