mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Log undo button click
Also fix a bug where we logged workspace swipe upon clicking undo, since rebinding the pages causes us to reset mCurrentPage = 0 followed by setCurrentPage(pageBoundFirst). Since the page isn't actually visibly changing, we shouldn't log in that case. Bug: 118758133 Change-Id: Ie87164a8c7c278680f67dee75657210bd33408a4
This commit is contained in:
@@ -16,6 +16,9 @@
|
||||
|
||||
package com.android.launcher3;
|
||||
|
||||
import static com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.TAP;
|
||||
import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.UNDO;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
@@ -121,8 +124,12 @@ public class DeleteDropTarget extends ButtonDropTarget {
|
||||
int itemPage = mLauncher.getWorkspace().getCurrentPage();
|
||||
onAccessibilityDrop(null, item);
|
||||
ModelWriter modelWriter = mLauncher.getModelWriter();
|
||||
Runnable onUndoClicked = () -> {
|
||||
modelWriter.abortDelete(itemPage);
|
||||
mLauncher.getUserEventDispatcher().logActionOnControl(TAP, UNDO);
|
||||
};
|
||||
Snackbar.show(mLauncher, R.string.item_removed, R.string.undo,
|
||||
modelWriter::commitDelete, () -> modelWriter.abortDelete(itemPage));
|
||||
modelWriter::commitDelete, onUndoClicked);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user