Bring back OnBackPressedHandler

- Bring back OnBackPressedHandler so we can support lower version

TODO : Recreate OnBackAnimationCallback
This commit is contained in:
MrSluffy committed 2023-12-16 18:59:08 +08:00
1 parent cc8f9828ab
commit 4276067c6c
7 files changed
+79 -36

No files matched your search

@@ -168,13 +168,14 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
protected void onAttachedToWindow() {
super.onAttachedToWindow();
mActivityContext.addOnDeviceProfileChangeListener(this);
// TODO LAWNCHAIR
if (FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get()) {
mAppsView.getAppsRecyclerViewContainer().setOutlineProvider(mViewOutlineProvider);
mAppsView.getAppsRecyclerViewContainer().setClipToOutline(true);
OnBackInvokedDispatcher dispatcher = findOnBackInvokedDispatcher();
if (dispatcher != null) {
dispatcher.registerOnBackInvokedCallback(
OnBackInvokedDispatcher.PRIORITY_DEFAULT, this);
OnBackInvokedDispatcher.PRIORITY_DEFAULT, null);
}
}
}
@@ -188,7 +189,7 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
mAppsView.getAppsRecyclerViewContainer().setClipToOutline(false);
OnBackInvokedDispatcher dispatcher = findOnBackInvokedDispatcher();
if (dispatcher != null) {
dispatcher.unregisterOnBackInvokedCallback(this);
dispatcher.unregisterOnBackInvokedCallback(null);
}
}
}