mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
When undoing a removal, always return to the page it came from
We were already returning to the current page, but this wasn't always right, e.g. when removing the last item on the last page. So now we mark the page the item was removed from, and bind that page first when undo is clicked. This also addresses an issue where we incorrectly returned to the first page if currentPage = INVALID_RESTORE_PAGE, which happens if there are no items on the first page. Bug: 118846684 Change-Id: I4ec1f64b24ba1cc308ce08bfb3111b5981fae99b
This commit is contained in:
@@ -349,12 +349,12 @@ public class ModelWriter {
|
||||
mDeleteRunnables.clear();
|
||||
}
|
||||
|
||||
public void abortDelete() {
|
||||
public void abortDelete(int pageToBindFirst) {
|
||||
mPreparingToUndo = false;
|
||||
mDeleteRunnables.clear();
|
||||
// We do a full reload here instead of just a rebind because Folders change their internal
|
||||
// state when dragging an item out, which clobbers the rebind unless we load from the DB.
|
||||
mModel.forceReload();
|
||||
mModel.forceReload(pageToBindFirst);
|
||||
}
|
||||
|
||||
private class UpdateItemRunnable extends UpdateItemBaseRunnable {
|
||||
|
||||
Reference in New Issue
Block a user