From fed2a01fe4e40391bf10c7afe37c197b20e0af60 Mon Sep 17 00:00:00 2001 From: Zak Cohen Date: Mon, 3 May 2021 16:47:35 -0700 Subject: [PATCH] Fade out empty Overview message. When Overview is empty, fade out its contents on transitions. Bug: 185447800 Test: Local build and test on P5 Change-Id: I9a0cd649f2f7353e4a7af21a93fb18be36f616a8 --- .../states/QuickstepAtomicAnimationFactory.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java index ba6192314e..3ac78663f7 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java @@ -77,6 +77,7 @@ public class QuickstepAtomicAnimationFactory extends @Override public void prepareForAtomicAnimation(LauncherState fromState, LauncherState toState, StateAnimationConfig config) { + RecentsView overview = mActivity.getOverviewPanel(); if (toState == NORMAL && fromState == OVERVIEW) { config.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL); config.setInterpolator(ANIM_WORKSPACE_FADE, ACCEL); @@ -85,7 +86,12 @@ public class QuickstepAtomicAnimationFactory extends config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, ACCEL_DEACCEL); if (SysUINavigationMode.getMode(mActivity) == NO_BUTTON) { - config.setInterpolator(ANIM_OVERVIEW_FADE, FINAL_FRAME); + // Scrolling in tasks, so make visible straight away + if (overview.getTaskViewCount() > 0) { + config.setInterpolator(ANIM_OVERVIEW_FADE, FINAL_FRAME); + } else { + config.setInterpolator(ANIM_OVERVIEW_FADE, DEACCEL_1_7); + } } else { config.setInterpolator(ANIM_OVERVIEW_FADE, DEACCEL_1_7); } @@ -122,13 +128,18 @@ public class QuickstepAtomicAnimationFactory extends config.setInterpolator(ANIM_WORKSPACE_SCALE, fromState == NORMAL ? ACCEL : OVERSHOOT_1_2); config.setInterpolator(ANIM_WORKSPACE_TRANSLATE, ACCEL); - config.setInterpolator(ANIM_OVERVIEW_FADE, INSTANT); + + // Scrolling in tasks, so show straight away + if (overview.getTaskViewCount() > 0) { + config.setInterpolator(ANIM_OVERVIEW_FADE, INSTANT); + } else { + config.setInterpolator(ANIM_OVERVIEW_FADE, OVERSHOOT_1_2); + } } else { config.setInterpolator(ANIM_WORKSPACE_SCALE, OVERSHOOT_1_2); config.setInterpolator(ANIM_OVERVIEW_FADE, OVERSHOOT_1_2); // Scale up the recents, if it is not coming from the side - RecentsView overview = mActivity.getOverviewPanel(); if (overview.getVisibility() != VISIBLE || overview.getContentAlpha() == 0) { RECENTS_SCALE_PROPERTY.set(overview, RECENTS_PREPARE_SCALE); }