mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Merge "Update hotseat QSB alpha after isQsbInline changes" into tm-qpr-dev
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user