diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2018-04-11 15:30:46 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2018-04-11 17:08:31 -0700 |
commit | 7eff40ff2df3acea49aeba04dc78322a2b4b6208 (patch) | |
tree | 2783f1b195cc1c7060b144693b713cff82716bb7 /src/com/android/launcher3/BaseActivity.java | |
parent | e9f31c101493ecb366a93667e8a9a7dc90538d3b (diff) | |
download | android_packages_apps_Trebuchet-7eff40ff2df3acea49aeba04dc78322a2b4b6208.tar.gz android_packages_apps_Trebuchet-7eff40ff2df3acea49aeba04dc78322a2b4b6208.tar.bz2 android_packages_apps_Trebuchet-7eff40ff2df3acea49aeba04dc78322a2b4b6208.zip |
Several app transition fixes:
> If launcher already started, creating the state transition only after threshold crossed, so that previous animations are not cancelled
> Not posting animaiton callbacks at the front of the queue, as that sometimes causes it get executed before onNewIntent
> Farking the activity as forceInvisible while launching an opaque app, so that quickly pressing home/back runs the reverse animation
> Not running state animations when force-invisible is true
Bug: 77830325
Bug: 77898806
Change-Id: I50a7e915ca35fd6aeb284c8f321ecca74396fe98
Diffstat (limited to 'src/com/android/launcher3/BaseActivity.java')
-rw-r--r-- | src/com/android/launcher3/BaseActivity.java | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java index c15cde5f9..1f1ef9ad7 100644 --- a/src/com/android/launcher3/BaseActivity.java +++ b/src/com/android/launcher3/BaseActivity.java @@ -16,12 +16,15 @@ package com.android.launcher3; +import static java.lang.annotation.RetentionPolicy.SOURCE; + import android.app.Activity; import android.content.Context; import android.content.ContextWrapper; import android.content.Intent; import android.content.res.Configuration; import android.graphics.Point; +import android.support.annotation.IntDef; import android.view.Display; import android.view.View.AccessibilityDelegate; @@ -29,10 +32,22 @@ import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener; import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.util.SystemUiController; +import java.lang.annotation.Retention; import java.util.ArrayList; public abstract class BaseActivity extends Activity { + 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_ALL = + INVISIBLE_BY_STATE_HANDLER | INVISIBLE_BY_APP_TRANSITIONS; + + @Retention(SOURCE) + @IntDef( + flag = true, + value = {INVISIBLE_BY_STATE_HANDLER, INVISIBLE_BY_APP_TRANSITIONS}) + public @interface InvisibilityFlags{} + private final ArrayList<OnDeviceProfileChangeListener> mDPChangeListeners = new ArrayList<>(); private final ArrayList<MultiWindowModeChangedListener> mMultiWindowModeChangedListeners = new ArrayList<>(); @@ -42,10 +57,11 @@ public abstract class BaseActivity extends Activity { protected SystemUiController mSystemUiController; private boolean mStarted; + private boolean mUserActive; + // When the recents animation is running, the visibility of the Launcher is managed by the // animation - private boolean mForceInvisible; - private boolean mUserActive; + @InvisibilityFlags private int mForceInvisible; public DeviceProfile getDeviceProfile() { return mDeviceProfile; @@ -114,7 +130,7 @@ public abstract class BaseActivity extends Activity { @Override protected void onStop() { mStarted = false; - mForceInvisible = false; + mForceInvisible = 0; super.onStop(); } @@ -153,15 +169,20 @@ public abstract class BaseActivity extends Activity { * recents animation. * @see LauncherAppTransitionManagerImpl.getWallpaperOpenRunner() */ - public void setForceInvisible(boolean invisible) { - mForceInvisible = invisible; + public void addForceInvisibleFlag(@InvisibilityFlags int flag) { + mForceInvisible |= flag; + } + + public void clearForceInvisibleFlag(@InvisibilityFlags int flag) { + mForceInvisible &= ~flag; } + /** * @return Wether this activity should be considered invisible regardless of actual visibility. */ public boolean isForceInvisible() { - return mForceInvisible; + return mForceInvisible != 0; } /** |