summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BaseActivity.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-06-05 16:00:34 -0700
committerSunny Goyal <sunnygoyal@google.com>2018-06-05 16:47:54 -0700
commit1c63c72c1a4baa3a9d31e3d8aed645b667ce37ca (patch)
treeb6f1f3e881f8107006f54246728542441cf977a9 /src/com/android/launcher3/BaseActivity.java
parentd936f6a5e92859e2ab7ab798889b1abbaa556a22 (diff)
downloadandroid_packages_apps_Trebuchet-1c63c72c1a4baa3a9d31e3d8aed645b667ce37ca.tar.gz
android_packages_apps_Trebuchet-1c63c72c1a4baa3a9d31e3d8aed645b667ce37ca.tar.bz2
android_packages_apps_Trebuchet-1c63c72c1a4baa3a9d31e3d8aed645b667ce37ca.zip
Adding a pending invisibility flag, which is used to indicate that the launcher
is not really invisible, but consider it invisible for window transitions When a recents animation is cancelled, the callback can be received before or after the wallpaper animation. To ensure that wallpaper animaiton runs properly, we keep the launcher forceInvisible=true, only for that particular animaiton and false everywhere Bug: 109735443 Change-Id: I5b22cc3327c8cd53a836d10e09fc88ae103becfc
Diffstat (limited to 'src/com/android/launcher3/BaseActivity.java')
-rw-r--r--src/com/android/launcher3/BaseActivity.java25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java
index e117deb81..a4b6f5b05 100644
--- a/src/com/android/launcher3/BaseActivity.java
+++ b/src/com/android/launcher3/BaseActivity.java
@@ -44,13 +44,25 @@ public abstract class BaseActivity extends Activity implements UserEventDelegate
public static final int INVISIBLE_BY_STATE_HANDLER = 1 << 0;
public static final int INVISIBLE_BY_APP_TRANSITIONS = 1 << 1;
+ public static final int INVISIBLE_BY_PENDING_FLAGS = 1 << 2;
+
+ // This is not treated as invisibility flag, but adds as a hint for an incomplete transition.
+ // When the wallpaper animation runs, it replaces this flag with a proper invisibility
+ // flag, INVISIBLE_BY_PENDING_FLAGS only for the duration of that animation.
+ public static final int PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION = 1 << 3;
+
+ private static final int INVISIBLE_FLAGS =
+ INVISIBLE_BY_STATE_HANDLER | INVISIBLE_BY_APP_TRANSITIONS | INVISIBLE_BY_PENDING_FLAGS;
+ public static final int STATE_HANDLER_INVISIBILITY_FLAGS =
+ INVISIBLE_BY_STATE_HANDLER | PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION;
public static final int INVISIBLE_ALL =
- INVISIBLE_BY_STATE_HANDLER | INVISIBLE_BY_APP_TRANSITIONS;
+ INVISIBLE_FLAGS | PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION;
@Retention(SOURCE)
@IntDef(
flag = true,
- value = {INVISIBLE_BY_STATE_HANDLER, INVISIBLE_BY_APP_TRANSITIONS})
+ value = {INVISIBLE_BY_STATE_HANDLER, INVISIBLE_BY_APP_TRANSITIONS,
+ INVISIBLE_BY_PENDING_FLAGS, PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION})
public @interface InvisibilityFlags{}
private final ArrayList<OnDeviceProfileChangeListener> mDPChangeListeners = new ArrayList<>();
@@ -208,7 +220,7 @@ public abstract class BaseActivity extends Activity implements UserEventDelegate
/**
* Used to set the override visibility state, used only to handle the transition home with the
* recents animation.
- * @see LauncherAppTransitionManagerImpl.getWallpaperOpenRunner()
+ * @see LauncherAppTransitionManagerImpl#getWallpaperOpenRunner()
*/
public void addForceInvisibleFlag(@InvisibilityFlags int flag) {
mForceInvisible |= flag;
@@ -218,12 +230,15 @@ public abstract class BaseActivity extends Activity implements UserEventDelegate
mForceInvisible &= ~flag;
}
-
/**
* @return Wether this activity should be considered invisible regardless of actual visibility.
*/
public boolean isForceInvisible() {
- return mForceInvisible != 0;
+ return hasSomeInvisibleFlag(INVISIBLE_FLAGS);
+ }
+
+ public boolean hasSomeInvisibleFlag(int mask) {
+ return (mForceInvisible & mask) != 0;
}
public interface MultiWindowModeChangedListener {