Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfb9e15a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Only animating QSB if it is visible when going home" into ub-launcher3-rvc-dev

parents 93cdd8b4 f665787d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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) {
+9 −0
Original line number Diff line number Diff line
@@ -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.
     *
+1 −2
Original line number Diff line number Diff line
@@ -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