Merge "Only animating QSB if it is visible when going home" into ub-launcher3-rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cfb9e15af9
+5
-2
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user