summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2018-05-25 19:54:24 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-05-25 19:54:24 +0000
commit30d2fc748da430fd48fe19acb220841115979e70 (patch)
treece85e7a68a2c702ab55ba7760b2cb516426e4fed
parent4308bd232ec0f312efc09eb0fcf981fa38b57c17 (diff)
parent35cde20a171a774f048b6c25013d1389c734c0c8 (diff)
downloadandroid_packages_apps_Trebuchet-30d2fc748da430fd48fe19acb220841115979e70.tar.gz
android_packages_apps_Trebuchet-30d2fc748da430fd48fe19acb220841115979e70.tar.bz2
android_packages_apps_Trebuchet-30d2fc748da430fd48fe19acb220841115979e70.zip
Merge "Tweaking quickscrub launch animation for new task sizes." into ub-launcher3-edmonton
-rw-r--r--quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java16
-rw-r--r--quickstep/src/com/android/quickstep/QuickScrubController.java6
2 files changed, 16 insertions, 6 deletions
diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
index fe2a98fea..eea71ca98 100644
--- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
+++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
@@ -106,6 +106,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
private static final int APP_LAUNCH_ALPHA_DURATION = 50;
public static final int RECENTS_LAUNCH_DURATION = 336;
+ public static final int RECENTS_QUICKSCRUB_LAUNCH_DURATION = 300;
private static final int LAUNCHER_RESUME_START_DELAY = 100;
private static final int CLOSING_TRANSITION_DURATION_MS = 250;
@@ -260,15 +261,21 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
RecentsView recentsView = mLauncher.getOverviewPanel();
boolean launcherClosing = launcherIsATargetWithMode(targets, MODE_CLOSING);
boolean skipLauncherChanges = !launcherClosing;
+ boolean isLaunchingFromQuickscrub =
+ recentsView.getQuickScrubController().isWaitingForTaskLaunch();
TaskView taskView = findTaskViewToLaunch(mLauncher, v, targets);
if (taskView == null) {
return false;
}
+ int duration = isLaunchingFromQuickscrub
+ ? RECENTS_QUICKSCRUB_LAUNCH_DURATION
+ : RECENTS_LAUNCH_DURATION;
+
ClipAnimationHelper helper = new ClipAnimationHelper();
target.play(getRecentsWindowAnimator(taskView, skipLauncherChanges, targets, helper)
- .setDuration(RECENTS_LAUNCH_DURATION));
+ .setDuration(duration));
Animator childStateAnimation = null;
// Found a visible recents task that matches the opening app, lets launch the app from there
@@ -277,7 +284,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
if (launcherClosing) {
launcherAnim = recentsView.createAdjacentPageAnimForTaskLaunch(taskView, helper);
launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR);
- launcherAnim.setDuration(RECENTS_LAUNCH_DURATION);
+ launcherAnim.setDuration(duration);
// Make sure recents gets fixed up by resetting task alphas and scales, etc.
windowAnimEndListener = new AnimatorListenerAdapter() {
@@ -289,11 +296,10 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
};
} else {
AnimatorPlaybackController controller =
- mLauncher.getStateManager()
- .createAnimationToNewWorkspace(NORMAL, RECENTS_LAUNCH_DURATION);
+ mLauncher.getStateManager().createAnimationToNewWorkspace(NORMAL, duration);
controller.dispatchOnStart();
childStateAnimation = controller.getTarget();
- launcherAnim = controller.getAnimationPlayer().setDuration(RECENTS_LAUNCH_DURATION);
+ launcherAnim = controller.getAnimationPlayer().setDuration(duration);
windowAnimEndListener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
diff --git a/quickstep/src/com/android/quickstep/QuickScrubController.java b/quickstep/src/com/android/quickstep/QuickScrubController.java
index 95a82dd86..7a79c6f4d 100644
--- a/quickstep/src/com/android/quickstep/QuickScrubController.java
+++ b/quickstep/src/com/android/quickstep/QuickScrubController.java
@@ -40,7 +40,7 @@ import com.android.quickstep.views.TaskView;
public class QuickScrubController implements OnAlarmListener {
public static final int QUICK_SCRUB_FROM_APP_START_DURATION = 240;
- public static final int QUICK_SCRUB_FROM_HOME_START_DURATION = 150;
+ public static final int QUICK_SCRUB_FROM_HOME_START_DURATION = 200;
// We want the translation y to finish faster than the rest of the animation.
public static final float QUICK_SCRUB_TRANSLATION_Y_FACTOR = 5f / 6;
public static final Interpolator QUICK_SCRUB_START_INTERPOLATOR = FAST_OUT_SLOW_IN;
@@ -156,6 +156,10 @@ public class QuickScrubController implements OnAlarmListener {
return true;
}
+ public boolean isWaitingForTaskLaunch() {
+ return mWaitingForTaskLaunch;
+ }
+
/**
* Attempts to go to normal overview or back to home, so UI doesn't prevent user interaction.
*/