summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2018-06-25 16:42:58 -0700
committerJon Miranda <jonmiranda@google.com>2018-06-25 16:42:58 -0700
commitc9a7c50fac2552b96c4f80587494afcb0da78aab (patch)
tree5be0e11108c5383e14bde8c358d241b80c448425
parent563bc3d1faae4be3c998ba89c5d102acf4f2dba8 (diff)
downloadandroid_packages_apps_Trebuchet-c9a7c50fac2552b96c4f80587494afcb0da78aab.tar.gz
android_packages_apps_Trebuchet-c9a7c50fac2552b96c4f80587494afcb0da78aab.tar.bz2
android_packages_apps_Trebuchet-c9a7c50fac2552b96c4f80587494afcb0da78aab.zip
Tune app closing/launcher resume animation "spring" values.
Bug: 109828964 Change-Id: I64252667451f511b7affdde5ffb28812876e7f4c
-rw-r--r--quickstep/res/values/dimens.xml3
-rw-r--r--quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java18
-rw-r--r--src/com/android/launcher3/anim/Interpolators.java8
3 files changed, 16 insertions, 13 deletions
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 17d5c60ba..675b26112 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -33,7 +33,8 @@
<!-- Launcher app transition -->
<dimen name="content_trans_y">50dp</dimen>
- <dimen name="springs_trans_y">-70dp</dimen>
+ <dimen name="springs_start_slide_trans_y">-100dp</dimen>
+ <dimen name="springs_end_slide_trans_y">6.25dp</dimen>
<dimen name="closing_window_trans_y">115dp</dimen>
<dimen name="recents_empty_message_text_size">16sp</dimen>
diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
index 252e3eaee..b9ff28456 100644
--- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
+++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
@@ -125,13 +125,13 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
// Progress = 0: All apps is fully pulled up, Progress = 1: All apps is fully pulled down.
public static final float ALL_APPS_PROGRESS_OFF_SCREEN = 1.3059858f;
- private static final int APP_CLOSE_ROW_START_DELAY_MS = 8;
+ private static final int APP_CLOSE_ROW_START_DELAY_MS = 9;
- // The sum of [slide, oscillate, and settle] should be <= LAUNCHER_RESUME_TOTAL_DURATION.
- private static final int LAUNCHER_RESUME_TOTAL_DURATION = 346;
- private static final int SPRING_SLIDE_DURATION = 166;
- private static final int SPRING_OSCILLATE_DURATION = 130;
- private static final int SPRING_SETTLE_DURATION = 50;
+ private static final int SPRING_SLIDE_DURATION = 170;
+ private static final int SPRING_OSCILLATE_DURATION = 550;
+ private static final int SPRING_SETTLE_DURATION = 25;
+
+ private static final int SPRING_ALPHA_DURATION = 100;
private final Launcher mLauncher;
private final DragLayer mDragLayer;
@@ -173,8 +173,8 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
Resources res = mLauncher.getResources();
mContentTransY = res.getDimensionPixelSize(R.dimen.content_trans_y);
mClosingWindowTransY = res.getDimensionPixelSize(R.dimen.closing_window_trans_y);
- mStartSlideTransY = res.getDimensionPixelSize(R.dimen.springs_trans_y);
- mEndSlideTransY = -mStartSlideTransY * 0.1f;
+ mStartSlideTransY = res.getDimensionPixelSize(R.dimen.springs_start_slide_trans_y);
+ mEndSlideTransY = res.getDimensionPixelSize(R.dimen.springs_end_slide_trans_y);
mLauncher.addOnDeviceProfileChangeListener(this);
registerRemoteAnimations();
@@ -837,7 +837,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
v.setAlpha(0);
ObjectAnimator alpha = ObjectAnimator.ofFloat(v, View.ALPHA, 1f);
alpha.setInterpolator(LINEAR);
- alpha.setDuration(SPRING_SLIDE_DURATION + SPRING_OSCILLATE_DURATION);
+ alpha.setDuration(SPRING_ALPHA_DURATION);
alpha.setStartDelay(startDelay);
outAnimator.play(alpha);
diff --git a/src/com/android/launcher3/anim/Interpolators.java b/src/com/android/launcher3/anim/Interpolators.java
index 8a1abf412..389da4807 100644
--- a/src/com/android/launcher3/anim/Interpolators.java
+++ b/src/com/android/launcher3/anim/Interpolators.java
@@ -119,18 +119,20 @@ public class Interpolators {
public static final Interpolator OSCILLATE = new Interpolator() {
// Used to scale the oscillations horizontally
- private final float horizontalScale = 1f;
+ private final float horizontalScale = 4f;
// Used to shift the oscillations horizontally
- private final float horizontalShift = 0.5f;
+ private final float horizontalShift = 0.22f;
// Used to scale the oscillations vertically
private final float verticalScale = 1f;
// Used to shift the oscillations vertically
private final float verticalShift = 1f;
+ // Amplitude of oscillation
+ private final float amplitude = 0.9f;
@Override
public float getInterpolation(float t) {
t = horizontalScale * (t + horizontalShift);
- return (float) ((verticalScale * (Math.exp(-t) * Math.cos(2 * Math.PI * t)))
+ return (float) ((verticalScale * (Math.exp(-t) * Math.cos(amplitude * Math.PI * t)))
+ verticalShift);
}
};