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

Commit e5829075 authored by Alex Chau's avatar Alex Chau
Browse files

Update hotseat QSB alpha after isQsbInline changes

Fix: 238578584
Test: Repeat steps in bug for portrait/landscape
Change-Id: I1bb9724f3e32bfc148ac75df3d1211c71c99875c
parent 67fe05be
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,