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

Commit aae57395 authored by Alex Chau's avatar Alex Chau Committed by Android (Google) Code Review
Browse files

Merge "Update hotseat QSB alpha after isQsbInline changes" into tm-qpr-dev

parents fa13629d e5829075
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import androidx.annotation.Nullable;

import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherState;
import com.android.launcher3.QuickstepTransitionManager;
import com.android.launcher3.Utilities;
@@ -48,6 +49,7 @@ import com.android.systemui.shared.recents.model.ThumbnailData;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.StringJoiner;
import java.util.function.Consumer;
import java.util.function.Supplier;

/**
@@ -92,6 +94,15 @@ import java.util.function.Supplier;
    // We skip any view synchronizations during init/destroy.
    private boolean mCanSyncViews;

    private final Consumer<Float> mIconAlphaForHomeConsumer = alpha -> {
        mLauncher.getHotseat().setIconsAlpha(alpha > 0 ? 0 : 1);
        mLauncher.getHotseat().setQsbAlpha(
                mLauncher.getDeviceProfile().isQsbInline && alpha > 0 ? 0 : 1);
    };

    private final DeviceProfile.OnDeviceProfileChangeListener mOnDeviceProfileChangeListener =
            dp -> mIconAlphaForHomeConsumer.accept(mIconAlphaForHome.getValue());

    private final StateManager.StateListener<LauncherState> mStateListener =
            new StateManager.StateListener<LauncherState>() {

@@ -131,13 +142,7 @@ import java.util.function.Supplier;
                .getTaskbarBackgroundAlpha();
        MultiValueAlpha taskbarIconAlpha = mControllers.taskbarViewController.getTaskbarIconAlpha();
        mIconAlphaForHome = taskbarIconAlpha.getProperty(ALPHA_INDEX_HOME);
        mIconAlphaForHome.setConsumer(
                alpha -> {
                    mLauncher.getHotseat().setIconsAlpha(alpha > 0 ? 0 : 1);
                    if (mLauncher.getDeviceProfile().isQsbInline) {
                        mLauncher.getHotseat().setQsbAlpha(alpha > 0 ? 0 : 1);
                    }
                });
        mIconAlphaForHome.setConsumer(mIconAlphaForHomeConsumer);

        mIconAlignmentForResumedState.finishAnimation();
        onIconAlignmentRatioChangedForAppAndHomeTransition();
@@ -150,6 +155,7 @@ import java.util.function.Supplier;
        applyState(0);

        mCanSyncViews = true;
        mLauncher.addOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
    }

    public void onDestroy() {
@@ -164,6 +170,7 @@ import java.util.function.Supplier;
        mLauncher.getStateManager().removeStateListener(mStateListener);

        mCanSyncViews = true;
        mLauncher.removeOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);
    }

    public Animator createAnimToLauncher(@NonNull LauncherState toState,