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:
1 parent
1654c9e1c0
commit
6a71a5bd77
21 files changed
+344
-53
No files matched your search
@@ -819,7 +819,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
|
||||
if (!removeScreens.isEmpty()) {
|
||||
// Update the model if we have changed any screens
|
||||
LauncherModel.updateWorkspaceScreenOrder(mLauncher, mScreenOrder);
|
||||
mLauncher.getModelWriter().enqueueDeleteRunnable(
|
||||
() -> LauncherModel.updateWorkspaceScreenOrder(mLauncher, mScreenOrder));
|
||||
|
||||
}
|
||||
|
||||
if (pageShift >= 0) {
|
||||
@@ -2848,7 +2850,6 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
*/
|
||||
public void onDropCompleted(final View target, final DragObject d,
|
||||
final boolean success) {
|
||||
|
||||
if (success) {
|
||||
if (target != this && mDragInfo != null) {
|
||||
removeWorkspaceItem(mDragInfo.cell);
|
||||
|
||||
Reference in new issue
Block a user