mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Relying on the controller state instead of animator state for
icon alignment Bug: 246644619 Test: Presubmit Change-Id: Iaa4ddd94a6d85acb9f8501263665ea78394815de
This commit is contained in:
@@ -38,9 +38,8 @@ import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.anim.AnimatorListeners;
|
||||
import com.android.launcher3.statemanager.StateManager;
|
||||
import com.android.launcher3.uioverrides.QuickstepLauncher;
|
||||
import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
|
||||
import com.android.launcher3.uioverrides.states.OverviewState;
|
||||
import com.android.launcher3.util.MultiValueAlpha;
|
||||
import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
|
||||
import com.android.quickstep.AnimatedFloat;
|
||||
import com.android.quickstep.RecentsAnimationCallbacks;
|
||||
import com.android.quickstep.RecentsAnimationController;
|
||||
@@ -251,17 +250,7 @@ import java.util.StringJoiner;
|
||||
|
||||
private Animator onStateChangeApplied(int changedFlags, long duration, boolean start) {
|
||||
boolean goingToLauncher = isInLauncher();
|
||||
final float toAlignment;
|
||||
if (goingToLauncher) {
|
||||
boolean isInStashedState = mLauncherState.isTaskbarStashed(mLauncher);
|
||||
boolean willStashVisually = isInStashedState
|
||||
&& mControllers.taskbarStashController.supportsVisualStashing();
|
||||
boolean isTaskbarAlignedWithHotseat =
|
||||
mLauncherState.isTaskbarAlignedWithHotseat(mLauncher);
|
||||
toAlignment = isTaskbarAlignedWithHotseat && !willStashVisually ? 1 : 0;
|
||||
} else {
|
||||
toAlignment = 0;
|
||||
}
|
||||
final float toAlignment = isIconAlignedWithHotseat() ? 1 : 0;
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "onStateChangeApplied - mState: " + getStateString(mState)
|
||||
+ ", changedFlags: " + getStateString(changedFlags)
|
||||
@@ -357,6 +346,22 @@ import java.util.StringJoiner;
|
||||
return mLauncherState.isTaskbarAlignedWithHotseat(mLauncher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if icons should be aligned to hotseat in the current transition
|
||||
*/
|
||||
public boolean isIconAlignedWithHotseat() {
|
||||
if (isInLauncher()) {
|
||||
boolean isInStashedState = mLauncherState.isTaskbarStashed(mLauncher);
|
||||
boolean willStashVisually = isInStashedState
|
||||
&& mControllers.taskbarStashController.supportsVisualStashing();
|
||||
boolean isTaskbarAlignedWithHotseat =
|
||||
mLauncherState.isTaskbarAlignedWithHotseat(mLauncher);
|
||||
return isTaskbarAlignedWithHotseat && !willStashVisually;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void playStateTransitionAnim(AnimatorSet animatorSet, long duration,
|
||||
boolean committed) {
|
||||
boolean isInStashedState = mLauncherState.isTaskbarStashed(mLauncher);
|
||||
@@ -395,7 +400,7 @@ import java.util.StringJoiner;
|
||||
|| (!taskbarWillBeVisible && Float.compare(currentValue, 0) != 0);
|
||||
|
||||
mControllers.taskbarViewController.setLauncherIconAlignment(
|
||||
mIconAlignment.value, mIconAlignment.getEndValue(), mLauncher.getDeviceProfile());
|
||||
mIconAlignment.value, mLauncher.getDeviceProfile());
|
||||
mControllers.navbarButtonsViewController.updateTaskbarAlignment(mIconAlignment.value);
|
||||
// Switch taskbar and hotseat in last frame
|
||||
updateIconAlphaForHome(taskbarWillBeVisible ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user