diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java index ebc9f96394..70903935bf 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java @@ -121,8 +121,11 @@ public class StaggeredWorkspaceAnim { addStaggeredAnimationForView(child, grid.inv.numRows + 1, totalRows); } - View qsb = launcher.findViewById(R.id.search_container_all_apps); - addStaggeredAnimationForView(qsb, grid.inv.numRows + 2, totalRows); + if (launcher.getAppsView().getSearchUiManager() + .isQsbVisible(NORMAL.getVisibleElements(launcher))) { + addStaggeredAnimationForView(launcher.getAppsView().getSearchView(), + grid.inv.numRows + 2, totalRows); + } } if (animateOverviewScrim) { diff --git a/src/com/android/launcher3/allapps/SearchUiManager.java b/src/com/android/launcher3/allapps/SearchUiManager.java index 34bf636cb4..7d5363f269 100644 --- a/src/com/android/launcher3/allapps/SearchUiManager.java +++ b/src/com/android/launcher3/allapps/SearchUiManager.java @@ -15,6 +15,8 @@ */ package com.android.launcher3.allapps; +import static com.android.launcher3.LauncherState.ALL_APPS_HEADER; + import android.graphics.Rect; import android.view.KeyEvent; import android.view.animation.Interpolator; @@ -56,6 +58,13 @@ public interface SearchUiManager { void setContentVisibility(int visibleElements, PropertySetter setter, Interpolator interpolator); + /** + * Returns true if the QSB should be visible for the given set of visible elements + */ + default boolean isQsbVisible(int visibleElements) { + return (visibleElements & ALL_APPS_HEADER) != 0; + } + /** * Called to control how the search UI result should be handled. * diff --git a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java index e72e1a8bc1..356c52ca39 100644 --- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java +++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java @@ -19,7 +19,6 @@ import static android.view.View.MeasureSpec.EXACTLY; import static android.view.View.MeasureSpec.getSize; import static android.view.View.MeasureSpec.makeMeasureSpec; -import static com.android.launcher3.LauncherState.ALL_APPS_HEADER; import static com.android.launcher3.Utilities.prefixTextWithIcon; import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR; @@ -213,7 +212,7 @@ public class AppsSearchContainerLayout extends ExtendedEditText @Override public void setContentVisibility(int visibleElements, PropertySetter setter, Interpolator interpolator) { - setter.setViewAlpha(this, (visibleElements & ALL_APPS_HEADER) != 0 ? 1 : 0, interpolator); + setter.setViewAlpha(this, isQsbVisible(visibleElements) ? 1 : 0, interpolator); } @Override