Fix animations home
- To prevent surface thrashing, we no longer hide the home activity before
starting the transition home. This prevents the launcher from being added
to the remote animation target list, which means that we default to
skipping the launcher animation. As a workaround, we special case the
flow and force the animation to run when starting the recents animation.
Bug: 74405472
Test: Go home from an app, ensure there is an animation.
Change-Id: Ifd2b39444fdeab323ee79a368b580a6264c3e5b9
diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java
index cf2d79f..ae631a4 100644
--- a/src/com/android/launcher3/BaseActivity.java
+++ b/src/com/android/launcher3/BaseActivity.java
@@ -39,6 +39,9 @@
protected SystemUiController mSystemUiController;
private boolean mStarted;
+ // When the recents animation is running, the visibility of the Launcher is managed by the
+ // animation
+ private boolean mForceInvisible;
private boolean mUserActive;
public DeviceProfile getDeviceProfile() {
@@ -100,6 +103,7 @@
@Override
protected void onStop() {
mStarted = false;
+ mForceInvisible = false;
super.onStop();
}
@@ -126,6 +130,22 @@
}
/**
+ * Used to set the override visibility state, used only to handle the transition home with the
+ * recents animation.
+ * @see LauncherAppTransitionManagerImpl.getWallpaperOpenRunner()
+ */
+ public void setForceInvisible(boolean invisible) {
+ mForceInvisible = invisible;
+ }
+
+ /**
+ * @return Wether this activity should be considered invisible regardless of actual visibility.
+ */
+ public boolean isForceInvisible() {
+ return mForceInvisible;
+ }
+
+ /**
* Sets the device profile, adjusting it accordingly in case of multi-window
*/
protected void setDeviceProfile(DeviceProfile dp) {