Predictive back: widget to all apps

This CL adds a layer of OnBackPressedHanlderRouter to Launcher:
1. 4 OnBackPressedHandler(s) are added in such order: auto cancel action mode handler, drag handler, view handler and state handler
2. first handler who can handle back will handle the entire back gesture
3. Let WidgetsFullSheet to handle widget to all apps transition

Bug: b/260956481
Test: manual
Change-Id: Idbce3dcec746226dd68aaabaddc8fe01334e9673
This commit is contained in:
Fengjiang Li
2023-01-12 16:20:58 -08:00
parent 74484f4a99
commit 6bb8d79549
12 changed files with 177 additions and 53 deletions

View File

@@ -125,9 +125,13 @@ public abstract class BaseDraggingActivity extends BaseActivity
mCurrentActionMode = null;
}
protected boolean isInAutoCancelActionMode() {
return mCurrentActionMode != null && AUTO_CANCEL_ACTION_MODE == mCurrentActionMode.getTag();
}
@Override
public boolean finishAutoCancelActionMode() {
if (mCurrentActionMode != null && AUTO_CANCEL_ACTION_MODE == mCurrentActionMode.getTag()) {
if (isInAutoCancelActionMode()) {
mCurrentActionMode.finish();
return true;
}