summaryrefslogtreecommitdiffstats
path: root/quickstep/src
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2019-06-18 16:34:37 -0700
committerSunny Goyal <sunnygoyal@google.com>2019-06-19 14:48:57 -0700
commit59c6901823180bdeb6c39187df45fd1adddeae2d (patch)
treec0f9ea91ab113f1ffa82bf840b0204cd9383025b /quickstep/src
parent035770e42103a41fbbb8ad186e732908c0c0141c (diff)
downloadandroid_packages_apps_Trebuchet-59c6901823180bdeb6c39187df45fd1adddeae2d.tar.gz
android_packages_apps_Trebuchet-59c6901823180bdeb6c39187df45fd1adddeae2d.tar.bz2
android_packages_apps_Trebuchet-59c6901823180bdeb6c39187df45fd1adddeae2d.zip
Some improvements to home to overview transition for 0 button mode
- Peek in overview further, and with more overshoot - Fade out and scale down workspace faster while swiping up - Scale and translate workspace slower when letting go to enter overview (so it doesn't zoom out at warp speed) - Fade in all apps shelf sooner Bug: 132455160 Change-Id: Ieafad0ccf9bb587889bc35d536627661db10e358
Diffstat (limited to 'quickstep/src')
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java9
-rw-r--r--quickstep/src/com/android/quickstep/views/ShelfScrimView.java18
2 files changed, 24 insertions, 3 deletions
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java b/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java
index ab24f5f5a..85a954507 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java
@@ -23,6 +23,7 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.allapps.AllAppsContainerView;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
+import com.android.quickstep.SysUINavigationMode;
/**
* Definition for AllApps state
@@ -63,7 +64,13 @@ public class AllAppsState extends LauncherState {
public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) {
ScaleAndTranslation scaleAndTranslation = LauncherState.OVERVIEW
.getWorkspaceScaleAndTranslation(launcher);
- scaleAndTranslation.scale = 1;
+ if (SysUINavigationMode.getMode(launcher) == SysUINavigationMode.Mode.NO_BUTTON) {
+ float normalScale = 1;
+ // Scale down halfway to where we'd be in overview, to prepare for a potential pause.
+ scaleAndTranslation.scale = (scaleAndTranslation.scale + normalScale) / 2;
+ } else {
+ scaleAndTranslation.scale = 1;
+ }
return scaleAndTranslation;
}
diff --git a/quickstep/src/com/android/quickstep/views/ShelfScrimView.java b/quickstep/src/com/android/quickstep/views/ShelfScrimView.java
index 36521e5cc..b6ddb5fd1 100644
--- a/quickstep/src/com/android/quickstep/views/ShelfScrimView.java
+++ b/quickstep/src/com/android/quickstep/views/ShelfScrimView.java
@@ -18,6 +18,7 @@ package com.android.quickstep.views;
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.anim.Interpolators.ACCEL;
+import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;
@@ -29,6 +30,7 @@ import android.graphics.Path;
import android.graphics.Path.Direction;
import android.graphics.Path.Op;
import android.util.AttributeSet;
+import android.view.animation.Interpolator;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
@@ -69,6 +71,9 @@ public class ShelfScrimView extends ScrimView implements NavigationModeChangeLis
private int mMidAlpha;
private float mMidProgress;
+ private Interpolator mBeforeMidProgressColorInterpolator = ACCEL;
+ private Interpolator mAfterMidProgressColorInterpolator = ACCEL;
+
private float mShiftRange;
private final float mShelfOffset;
@@ -120,6 +125,15 @@ public class ShelfScrimView extends ScrimView implements NavigationModeChangeLis
@Override
public void onNavigationModeChanged(Mode newMode) {
mSysUINavigationMode = newMode;
+ // Note that these interpolators are inverted because progress goes 1 to 0.
+ if (mSysUINavigationMode == Mode.NO_BUTTON) {
+ // Show the shelf more quickly before reaching overview progress.
+ mBeforeMidProgressColorInterpolator = ACCEL_2;
+ mAfterMidProgressColorInterpolator = ACCEL;
+ } else {
+ mBeforeMidProgressColorInterpolator = ACCEL;
+ mAfterMidProgressColorInterpolator = Interpolators.clampToProgress(ACCEL, 0.5f, 1f);
+ }
}
@Override
@@ -171,7 +185,7 @@ public class ShelfScrimView extends ScrimView implements NavigationModeChangeLis
mRemainingScreenColor = 0;
int alpha = Math.round(Utilities.mapToRange(
- mProgress, mMidProgress, 1, mMidAlpha, 0, ACCEL));
+ mProgress, mMidProgress, 1, mMidAlpha, 0, mBeforeMidProgressColorInterpolator));
mShelfColor = setColorAlphaBound(mEndScrim, alpha);
} else {
mDragHandleOffset += mShiftRange * (mMidProgress - mProgress);
@@ -179,7 +193,7 @@ public class ShelfScrimView extends ScrimView implements NavigationModeChangeLis
// Note that these ranges and interpolators are inverted because progress goes 1 to 0.
int alpha = Math.round(
Utilities.mapToRange(mProgress, (float) 0, mMidProgress, (float) mEndAlpha,
- (float) mMidAlpha, Interpolators.clampToProgress(ACCEL, 0.5f, 1f)));
+ (float) mMidAlpha, mAfterMidProgressColorInterpolator));
mShelfColor = setColorAlphaBound(mEndScrim, alpha);
int remainingScrimAlpha = Math.round(