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

Commit 2c97e589 authored by Federico Baron's avatar Federico Baron Committed by Android (Google) Code Review
Browse files

Merge "Set smartspace to 30% visibility on workspace edit for home gardening" into tm-qpr-dev

parents 0cf401d0 a56f08e6
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;

import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import androidx.core.graphics.ColorUtils;
import androidx.core.view.ViewCompat;

+4 −0
Original line number Diff line number Diff line
@@ -919,6 +919,10 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
        return mScreenOrder;
    }

    protected View getQsb() {
        return mQsb;
    }

    /**
     * Returns the screen ID of a page that is shown together with the given page screen ID when the
     * two panel UI is enabled.
+16 −0
Original line number Diff line number Diff line
@@ -29,11 +29,13 @@ import static com.android.launcher3.LauncherState.FLAG_HOTSEAT_INACCESSIBLE;
import static com.android.launcher3.LauncherState.HINT_STATE;
import static com.android.launcher3.LauncherState.HOTSEAT_ICONS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.SPRING_LOADED;
import static com.android.launcher3.LauncherState.WORKSPACE_PAGE_INDICATOR;
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.anim.Interpolators.ZOOM_OUT;
import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER;
import static com.android.launcher3.config.FeatureFlags.SHOW_HOME_GARDENING;
import static com.android.launcher3.graphics.Scrim.SCRIM_PROGRESS;
import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_HOTSEAT_FADE;
@@ -69,6 +71,8 @@ import com.android.systemui.plugins.ResourceProvider;
 */
public class WorkspaceStateTransitionAnimation {

    private static final float QSB_DISABLED_ALPHA = 0.3f;

    private static final FloatProperty<Workspace<?>> WORKSPACE_SCALE_PROPERTY =
            WORKSPACE_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_WORKSPACE_STATE);

@@ -155,6 +159,18 @@ public class WorkspaceStateTransitionAnimation {
        float hotseatIconsAlpha = (elements & HOTSEAT_ICONS) != 0 ? 1 : 0;
        propertySetter.setViewAlpha(hotseat, hotseatIconsAlpha, hotseatFadeInterpolator);

        if (SHOW_HOME_GARDENING.get()) {
            propertySetter.setViewAlpha(
                    mWorkspace.getQsb(),
                    state == SPRING_LOADED ? QSB_DISABLED_ALPHA : 1,
                    workspaceFadeInterpolator);
            propertySetter.addEndListener(success -> {
                if (success) {
                    mWorkspace.getQsb().setClickable(state != SPRING_LOADED);
                }
            });
        }

        // Update the accessibility flags for hotseat based on launcher state.
        hotseat.setImportantForAccessibility(
                state.hasFlag(FLAG_HOTSEAT_INACCESSIBLE)