diff options
author | Tony Wickham <twickham@google.com> | 2019-04-10 15:09:42 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2019-04-10 15:36:07 -0700 |
commit | 8e5c13f360ea39fff074530f4ba17194303b8987 (patch) | |
tree | 13e6c276ed8768ece3f848afb0f0228eaaa6a261 /quickstep | |
parent | 9bbbe9cc1457485a376be639dc34ddcd19bc92e5 (diff) | |
download | android_packages_apps_Trebuchet-8e5c13f360ea39fff074530f4ba17194303b8987.tar.gz android_packages_apps_Trebuchet-8e5c13f360ea39fff074530f4ba17194303b8987.tar.bz2 android_packages_apps_Trebuchet-8e5c13f360ea39fff074530f4ba17194303b8987.zip |
Track window for 2 button nav as well as 0 button
This allows us to revert the change that fades in the shelf during swipe
up in 2 button mode, since the shelf doesn't show up until the window is
out of the way anyway.
Bug: 129746879
Change-Id: I929d8095989f9eae32d71b5bc3f67997e9df4ba0
Diffstat (limited to 'quickstep')
3 files changed, 10 insertions, 42 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java index 225ae8450..462e63098 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java @@ -75,12 +75,4 @@ public class BackgroundAppState extends OverviewState { return new ScaleAndTranslation(scale, 0f, 0f); } - @Override - public int getVisibleElements(Launcher launcher) { - if (SysUINavigationMode.getMode(launcher) == Mode.NO_BUTTON) { - return super.getVisibleElements(launcher); - } - // Hide shelf content (e.g. QSB) because we fade it in when swiping up. - return ALL_APPS_HEADER_EXTRA; - } } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java index e903b6f3f..baef2eb7c 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java @@ -23,7 +23,6 @@ import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_DAMPING_RATIO; import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_STIFFNESS; -import static com.android.launcher3.anim.Interpolators.DEACCEL_3; import static com.android.launcher3.anim.Interpolators.LINEAR; import android.animation.Animator; @@ -44,11 +43,8 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherInitListener; import com.android.launcher3.LauncherState; -import com.android.launcher3.LauncherStateManager; -import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.anim.AnimatorPlaybackController; -import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.SpringObjectAnimator; import com.android.launcher3.compat.AccessibilityManagerCompat; import com.android.launcher3.userevent.nano.LauncherLogProto; @@ -220,7 +216,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe : mShelfState == ShelfAnimState.PEEK ? shelfPeekingProgress : shelfOverviewProgress; - mShelfAnim = createShelfProgressAnim(activity, toProgress); + mShelfAnim = createShelfAnim(activity, toProgress); mShelfAnim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { @@ -238,10 +234,10 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe LauncherState fromState, long transitionLength, Consumer<AnimatorPlaybackController> callback) { LauncherState endState = OVERVIEW; - DeviceProfile dp = activity.getDeviceProfile(); - long accuracy = 2 * Math.max(dp.widthPx, dp.heightPx); if (wasVisible && fromState != BACKGROUND_APP) { // If a translucent app was launched fom launcher, animate launcher states. + DeviceProfile dp = activity.getDeviceProfile(); + long accuracy = 2 * Math.max(dp.widthPx, dp.heightPx); callback.accept(activity.getStateManager() .createAnimationToNewWorkspace(fromState, endState, accuracy)); return; @@ -254,11 +250,10 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe if (!activity.getDeviceProfile().isVerticalBarLayout() && SysUINavigationMode.getMode(activity) != Mode.NO_BUTTON) { // Don't animate the shelf when the mode is NO_BUTTON, because we update it atomically. - Animator shiftAnim = createShelfProgressAnim(activity, + Animator shiftAnim = createShelfAnim(activity, fromState.getVerticalProgress(activity), endState.getVerticalProgress(activity)); anim.play(shiftAnim); - anim.play(createShelfAlphaAnim(activity, endState, accuracy)); } playScaleDownAnim(anim, activity, endState); @@ -275,7 +270,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe callback.accept(controller); } - private Animator createShelfProgressAnim(Launcher activity, float ... progressValues) { + private Animator createShelfAnim(Launcher activity, float ... progressValues) { Animator shiftAnim = new SpringObjectAnimator<>(activity.getAllAppsController(), "allAppsSpringFromACH", activity.getAllAppsController().getShiftRange(), SPRING_DAMPING_RATIO, SPRING_STIFFNESS, progressValues); @@ -284,19 +279,6 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe } /** - * Very quickly fade the alpha of shelf content. - */ - private Animator createShelfAlphaAnim(Launcher activity, LauncherState toState, long accuracy) { - AllAppsTransitionController allAppsController = activity.getAllAppsController(); - AnimatorSetBuilder animBuilder = new AnimatorSetBuilder(); - animBuilder.setInterpolator(AnimatorSetBuilder.ANIM_ALL_APPS_FADE, DEACCEL_3); - LauncherStateManager.AnimationConfig config = new LauncherStateManager.AnimationConfig(); - config.duration = accuracy; - allAppsController.setAlphas(toState.getVisibleElements(activity), config, animBuilder); - return animBuilder.build(); - } - - /** * Scale down recents from the center task being full screen to being in overview. */ private void playScaleDownAnim(AnimatorSet anim, Launcher launcher, diff --git a/quickstep/src/com/android/quickstep/util/LayoutUtils.java b/quickstep/src/com/android/quickstep/util/LayoutUtils.java index bfe31d131..47f4f4d8f 100644 --- a/quickstep/src/com/android/quickstep/util/LayoutUtils.java +++ b/quickstep/src/com/android/quickstep/util/LayoutUtils.java @@ -27,8 +27,6 @@ import androidx.annotation.IntDef; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.config.FeatureFlags; -import com.android.quickstep.SysUINavigationMode; -import com.android.quickstep.SysUINavigationMode.Mode; import java.lang.annotation.Retention; @@ -118,14 +116,10 @@ public class LayoutUtils { } public static int getShelfTrackingDistance(Context context, DeviceProfile dp) { - if (SysUINavigationMode.getMode(context) == Mode.NO_BUTTON) { - // Track the bottom of the window rather than the top of the shelf. - int shelfHeight = dp.hotseatBarSizePx + dp.getInsets().bottom; - int spaceBetweenShelfAndRecents = (int) context.getResources().getDimension( - R.dimen.task_card_vert_space); - return shelfHeight + spaceBetweenShelfAndRecents; - } - // Start from a third of bottom inset to provide some shelf overlap. - return dp.hotseatBarSizePx + dp.getInsets().bottom / 3 - dp.edgeMarginPx * 2; + // Track the bottom of the window. + int shelfHeight = dp.hotseatBarSizePx + dp.getInsets().bottom; + int spaceBetweenShelfAndRecents = (int) context.getResources().getDimension( + R.dimen.task_card_vert_space); + return shelfHeight + spaceBetweenShelfAndRecents; } } |