diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2022-01-05 19:27:04 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-01-05 19:27:04 +0000 |
commit | d96e07035c37b4993ac24defe85f9bbbbe5b4fc6 (patch) | |
tree | 19437f19c59aac09233bf631d160c44a3bc3a944 | |
parent | b57235563c925ca9097e2d4a466b45dd0766d536 (diff) | |
parent | 153cd69d14095e046b37b52bffc0fe18748bd90f (diff) | |
download | Launcher3-d96e07035c37b4993ac24defe85f9bbbbe5b4fc6.tar.gz |
Merge "Apply scrim protection to atomic state transition ALLAPPS -> NORMAL" into sc-v2-dev
2 files changed, 17 insertions, 4 deletions
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java index 0e2fbbc2bf..75cf5cb3a5 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java @@ -17,6 +17,7 @@ package com.android.launcher3.uioverrides.states; import static android.view.View.VISIBLE; +import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.HINT_STATE; import static com.android.launcher3.LauncherState.HINT_STATE_TWO_BUTTON; import static com.android.launcher3.LauncherState.NORMAL; @@ -44,6 +45,10 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_SCRIM_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_SCALE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_TRANSLATE; +import static com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController.ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD; +import static com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController.ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD; +import static com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController.ALL_APPS_SCRIM_OPAQUE_THRESHOLD; +import static com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController.ALL_APPS_SCRIM_VISIBLE_THRESHOLD; import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY; import android.animation.ValueAnimator; @@ -52,6 +57,7 @@ import com.android.launcher3.CellLayout; import com.android.launcher3.Hotseat; import com.android.launcher3.LauncherState; import com.android.launcher3.Workspace; +import com.android.launcher3.anim.Interpolators; import com.android.launcher3.states.StateAnimationConfig; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.quickstep.SysUINavigationMode; @@ -171,6 +177,13 @@ public class QuickstepAtomicAnimationFactory extends mHintToNormalDuration = (int) va.getDuration(); } config.duration = Math.max(config.duration, mHintToNormalDuration); + } else if (fromState == ALL_APPS && toState == NORMAL) { + config.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(DEACCEL, + 1 - ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD, + 1 - ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD)); + config.setInterpolator(ANIM_SCRIM_FADE, Interpolators.clampToProgress(DEACCEL, + 1 - ALL_APPS_SCRIM_OPAQUE_THRESHOLD, + 1 - ALL_APPS_SCRIM_VISIBLE_THRESHOLD)); } } } diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java index 3c83d25b71..59ade49761 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java @@ -52,22 +52,22 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr /** * The progress at which all apps content will be fully visible. */ - protected static final float ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD = 0.8f; + public static final float ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD = 0.8f; /** * Minimum clamping progress for fading in all apps content */ - protected static final float ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD = 0.5f; + public static final float ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD = 0.5f; /** * Minimum clamping progress for fading in all apps scrim */ - protected static final float ALL_APPS_SCRIM_VISIBLE_THRESHOLD = .1f; + public static final float ALL_APPS_SCRIM_VISIBLE_THRESHOLD = .1f; /** * Maximum clamping progress for opaque all apps scrim */ - protected static final float ALL_APPS_SCRIM_OPAQUE_THRESHOLD = .5f; + public static final float ALL_APPS_SCRIM_OPAQUE_THRESHOLD = .5f; private final PortraitOverviewStateTouchHelper mOverviewPortraitStateTouchHelper; |