diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java index 6ee4cdbfc1..13530b2e58 100644 --- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java +++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java @@ -92,8 +92,16 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag implements OnDeviceProfileChangeListener { private static final String TAG = "LauncherTransition"; + + /** Duration of status bar animations. */ public static final int STATUS_BAR_TRANSITION_DURATION = 120; + /** + * Since our animations decelerate heavily when finishing, we want to start status bar animations + * x ms before the ending. + */ + public static final int STATUS_BAR_TRANSITION_PRE_DELAY = 96; + private static final String CONTROL_REMOTE_APP_TRANSITION_PERMISSION = "android.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS"; @@ -210,9 +218,14 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag } }; - int duration = findTaskViewToLaunch(launcher, v, null) != null - ? RECENTS_LAUNCH_DURATION : APP_LAUNCH_DURATION; - int statusBarTransitionDelay = duration - STATUS_BAR_TRANSITION_DURATION; + boolean fromRecents = mLauncher.getStateManager().getState().overviewUi + && findTaskViewToLaunch(launcher, v, null) != null; + int duration = fromRecents + ? RECENTS_LAUNCH_DURATION + : APP_LAUNCH_DURATION; + + int statusBarTransitionDelay = duration - STATUS_BAR_TRANSITION_DURATION + - STATUS_BAR_TRANSITION_PRE_DELAY; return ActivityOptionsCompat.makeRemoteAnimation(new RemoteAnimationAdapterCompat( runner, duration, statusBarTransitionDelay)); } diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java index a5fbba7079..ed8b4d2b1a 100644 --- a/quickstep/src/com/android/quickstep/RecentsActivity.java +++ b/quickstep/src/com/android/quickstep/RecentsActivity.java @@ -20,6 +20,7 @@ import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE; import static com.android.launcher3.LauncherAppTransitionManagerImpl.RECENTS_LAUNCH_DURATION; import static com.android.launcher3.LauncherAppTransitionManagerImpl.STATUS_BAR_TRANSITION_DURATION; +import static com.android.launcher3.LauncherAppTransitionManagerImpl.STATUS_BAR_TRANSITION_PRE_DELAY; import static com.android.quickstep.TaskUtils.getRecentsWindowAnimator; import static com.android.quickstep.TaskUtils.taskIsATargetWithMode; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; @@ -186,7 +187,8 @@ public class RecentsActivity extends BaseDraggingActivity { }; return ActivityOptionsCompat.makeRemoteAnimation(new RemoteAnimationAdapterCompat( runner, RECENTS_LAUNCH_DURATION, - RECENTS_LAUNCH_DURATION - STATUS_BAR_TRANSITION_DURATION)); + RECENTS_LAUNCH_DURATION - STATUS_BAR_TRANSITION_DURATION + - STATUS_BAR_TRANSITION_PRE_DELAY)); } /** diff --git a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java index 532699e2e0..703ea2ea2e 100644 --- a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -24,6 +24,7 @@ import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.quickstep.QuickScrubController.QUICK_SCRUB_FROM_APP_START_DURATION; import static com.android.quickstep.TouchConsumer.INTERACTION_NORMAL; import static com.android.quickstep.TouchConsumer.INTERACTION_QUICK_SCRUB; +import static com.android.quickstep.views.RecentsView.UPDATE_SYSUI_FLAGS_THRESHOLD; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -560,8 +561,7 @@ public class WindowTransformSwipeHandler { ? mSyncTransactionApplier : null); - // TODO: This logic is spartanic! - boolean passedThreshold = shift > 0.12f; + boolean passedThreshold = shift > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD; mRecentsAnimationWrapper.setAnimationTargetsBehindSystemBars(!passedThreshold); if (mActivityControlHelper.shouldMinimizeSplitScreen()) { mRecentsAnimationWrapper.setSplitScreenMinimizedForTransaction(passedThreshold); diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 6ce66937b1..f7f496fef0 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -117,7 +117,7 @@ public abstract class RecentsView extends PagedView impl private static final int DISMISS_TASK_DURATION = 300; // The threshold at which we update the SystemUI flags when animating from the task into the app - private static final float UPDATE_SYSUI_FLAGS_THRESHOLD = 0.6f; + public static final float UPDATE_SYSUI_FLAGS_THRESHOLD = 0.85f; private static final float[] sTempFloatArray = new float[3];