Fix navbar to home for All Apps.

It reuses the predictive back animation now. In addition, if All
Apps entered directly into the Search state (i.e. via QSB), the
back gesture now scales the whole panel to indicate it will close
and return to the home screen (as opposed to closing Search within
All Apps).

Demo: https://drive.google.com/file/d/1wpaZg3JaSxDMMc62uU-1miP9RaIO10EB/view?usp=drive_link&resourcekey=0-h8qKzuDguwIE2vUDr0H6lQ

Fix: 406523972
Flag: EXEMPT bugfix
Test: Manual
Change-Id: I470d67e03b2d8bbbaa39aea76c7dde639cff62f5
This commit is contained in:
Andy Wickham committed 2025-04-16 18:58:47 -07:00
1 parent 3a245f5fc2
commit f0d3ce8bfd
6 files changed
+59 -10

No files matched your search

@@ -187,6 +187,8 @@ public class AllAppsTransitionController
private boolean mHasScaleEffect;
private final MSDLPlayerWrapper mMSDLPlayerWrapper;
// Indicates whether this transition should scale the allapps header in addition to its content.
private boolean mShouldScaleHeader;
public AllAppsTransitionController(Launcher l) {
mLauncher = l;
@@ -273,6 +275,11 @@ public class AllAppsTransitionController
setAlphas(state, new StateAnimationConfig(), NO_ANIM_PROPERTY_SETTER);
}
@Override
public void onBackStarted(LauncherState toState) {
setShouldScaleHeader(!mLauncher.getAppsView().shouldBackExitSearch());
}
@Override
public void onBackProgressed(
LauncherState toState, @FloatRange(from = 0.0, to = 1.0) float backProgress) {
@@ -290,8 +297,8 @@ public class AllAppsTransitionController
private void onScaleProgressChanged() {
final float scaleProgress = mAllAppScale.value;
SCALE_PROPERTY.set(mLauncher.getAppsView(), scaleProgress);
if (!mLauncher.getAppsView().isSearching()
|| !mLauncher.getDeviceProfile().shouldShowAllAppsOnSheet()) {
if (mShouldScaleHeader || !mShouldShowAllAppsOnSheet) {
mLauncher.getScrimView().setScrimHeaderScale(scaleProgress);
}
@@ -313,6 +320,21 @@ public class AllAppsTransitionController
}
}
/**
* @return AnimatedFloat for all apps scale. This will scale the allapps content by default.
* @see #setShouldScaleHeader(boolean)
*/
public AnimatedFloat getAllAppScale() {
return mAllAppScale;
}
/**
* Specify whether this transition should scale the allapps header in addition to its content.
*/
public void setShouldScaleHeader(boolean shouldScaleHeader) {
mShouldScaleHeader = shouldScaleHeader;
}
/** Set {@link Animator.AnimatorListener} for scaling all apps scale to 1 animation. */
public void setAllAppsSearchBackAnimationListener(Animator.AnimatorListener listener) {
mAllAppsSearchBackAnimationListener = listener;
@@ -324,7 +346,7 @@ public class AllAppsTransitionController
*/
public void animateAllAppsToNoScale() {
if (mAllAppScale.isAnimating()) {
return;
mAllAppScale.cancelAnimation();
}
Animator animator = mAllAppScale.animateToValue(1f)
.setDuration(REVERT_SWIPE_ALL_APPS_TO_HOME_ANIMATION_DURATION_MS);