[Predictive Back] Revert all apps scale when exiting from search

Bug: b/267522879
Test: manual, see before after videos in bug
Change-Id: I7b14739fee23a22920d71841fc1c3c12b34a3d0c
This commit is contained in:
Fengjiang Li
2023-02-01 15:30:30 -08:00
parent 537c380bcb
commit d080b98b76
3 changed files with 17 additions and 0 deletions

View File

@@ -155,6 +155,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
private int mHeaderColor;
private int mBottomSheetBackgroundColor;
private int mTabsProtectionAlpha;
@Nullable private AllAppsTransitionController mAllAppsTransitionController;
public ActivityAllAppsContainerView(Context context) {
this(context, null);
@@ -292,6 +293,11 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
animateToSearchState(goingToSearch, DEFAULT_SEARCH_TRANSITION_DURATION_MS);
}
public void setAllAppsTransitionController(
AllAppsTransitionController allAppsTransitionController) {
mAllAppsTransitionController = allAppsTransitionController;
}
private void animateToSearchState(boolean goingToSearch, long durationMs) {
if (!mSearchTransitionController.isRunning() && goingToSearch == isSearching()) {
return;
@@ -299,6 +305,9 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
if (goingToSearch) {
// Fade out the button to pause work apps.
mWorkManager.onActivePageChanged(SEARCH);
} else if (mAllAppsTransitionController != null) {
// If exiting search, revert predictive back scale on all apps
mAllAppsTransitionController.animateAllAppsToNoScale();
}
mSearchTransitionController.animateToSearchState(goingToSearch, durationMs,
/* onEndRunnable = */ () -> {