diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-06-19 22:20:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-06-19 22:20:05 +0000 |
commit | 676a795ebdec854554695c5f0ab1565d5745eff6 (patch) | |
tree | 19844d66557dc4d21d6493a3b05d0455602fbb20 /quickstep/src | |
parent | b703f91f8314a28c0ce0e9a366ddcc915ac9dc3e (diff) | |
parent | 59c6901823180bdeb6c39187df45fd1adddeae2d (diff) | |
download | android_packages_apps_Trebuchet-676a795ebdec854554695c5f0ab1565d5745eff6.tar.gz android_packages_apps_Trebuchet-676a795ebdec854554695c5f0ab1565d5745eff6.tar.bz2 android_packages_apps_Trebuchet-676a795ebdec854554695c5f0ab1565d5745eff6.zip |
Merge "Some improvements to home to overview transition for 0 button mode" into ub-launcher3-qt-dev
Diffstat (limited to 'quickstep/src')
-rw-r--r-- | quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java | 9 | ||||
-rw-r--r-- | quickstep/src/com/android/quickstep/views/ShelfScrimView.java | 18 |
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( |