Merge "Fix NPE of predictive back in TaskbarAllAppsSlideInView" into udc-dev am: 216ae0f7ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22717961 Change-Id: I483fc364cfed0f6ce1c7e6f86c72786dc2bf6373 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
+17
-10
@@ -71,13 +71,6 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
|
|||||||
} else {
|
} else {
|
||||||
mTranslationShift = TRANSLATION_SHIFT_OPENED;
|
mTranslationShift = TRANSLATION_SHIFT_OPENED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get()) {
|
|
||||||
mAppsView.getAppsRecyclerViewContainer().setOutlineProvider(mViewOutlineProvider);
|
|
||||||
mAppsView.getAppsRecyclerViewContainer().setClipToOutline(true);
|
|
||||||
findOnBackInvokedDispatcher().registerOnBackInvokedCallback(
|
|
||||||
OnBackInvokedDispatcher.PRIORITY_DEFAULT, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The apps container inside this view. */
|
/** The apps container inside this view. */
|
||||||
@@ -88,9 +81,6 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
|
|||||||
@Override
|
@Override
|
||||||
protected void handleClose(boolean animate) {
|
protected void handleClose(boolean animate) {
|
||||||
handleClose(animate, mAllAppsCallbacks.getCloseDuration());
|
handleClose(animate, mAllAppsCallbacks.getCloseDuration());
|
||||||
if (FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get()) {
|
|
||||||
findOnBackInvokedDispatcher().unregisterOnBackInvokedCallback(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -121,12 +111,29 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
|
|||||||
protected void onAttachedToWindow() {
|
protected void onAttachedToWindow() {
|
||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
mActivityContext.addOnDeviceProfileChangeListener(this);
|
mActivityContext.addOnDeviceProfileChangeListener(this);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDetachedFromWindow() {
|
protected void onDetachedFromWindow() {
|
||||||
super.onDetachedFromWindow();
|
super.onDetachedFromWindow();
|
||||||
mActivityContext.removeOnDeviceProfileChangeListener(this);
|
mActivityContext.removeOnDeviceProfileChangeListener(this);
|
||||||
|
if (FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get()) {
|
||||||
|
mAppsView.getAppsRecyclerViewContainer().setOutlineProvider(null);
|
||||||
|
mAppsView.getAppsRecyclerViewContainer().setClipToOutline(false);
|
||||||
|
OnBackInvokedDispatcher dispatcher = findOnBackInvokedDispatcher();
|
||||||
|
if (dispatcher != null) {
|
||||||
|
dispatcher.unregisterOnBackInvokedCallback(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ public final class FeatureFlags {
|
|||||||
// TODO(Block 10): Clean up flags
|
// TODO(Block 10): Clean up flags
|
||||||
public static final BooleanFlag ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION = getDebugFlag(270614790,
|
public static final BooleanFlag ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION = getDebugFlag(270614790,
|
||||||
"ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION", DISABLED,
|
"ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION", DISABLED,
|
||||||
"Enables predictive back aniamtion from all apps and widgets to home");
|
"Enables predictive back animation from all apps and widgets to home");
|
||||||
|
|
||||||
// TODO(Block 11): Clean up flags
|
// TODO(Block 11): Clean up flags
|
||||||
public static final BooleanFlag ENABLE_TWO_PANEL_HOME = getDebugFlag(270392643,
|
public static final BooleanFlag ENABLE_TWO_PANEL_HOME = getDebugFlag(270392643,
|
||||||
|
|||||||
Reference in New Issue
Block a user