mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Cleanup how we set back button alpha
Add BackButtonAlphaHandler to set back button alpha, instead of setting it from multiple places. Also force back button alpha to be 1 if swipe up is disabled (b/80091187) Change-Id: I49b63a0e6b033a3a947a847669a398f1b9ff0564
This commit is contained in:
@@ -42,7 +42,6 @@ import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.anim.AnimationSuccessListener;
|
||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||
import com.android.launcher3.anim.AnimatorSetBuilder;
|
||||
import com.android.launcher3.uioverrides.UiFactory;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
|
||||
@@ -224,8 +223,6 @@ public abstract class AbstractStateChangeTouchController
|
||||
cancelAtomicComponentsController();
|
||||
}
|
||||
mProgressMultiplier = initCurrentAnimation(animComponents);
|
||||
mCurrentAnimation.getAnimationPlayer().addUpdateListener(animation ->
|
||||
setBackButtonAlphaWithProgress((float) animation.getAnimatedValue()));
|
||||
mCurrentAnimation.dispatchOnStart();
|
||||
return true;
|
||||
}
|
||||
@@ -284,7 +281,6 @@ public abstract class AbstractStateChangeTouchController
|
||||
mAtomicComponentsController.setPlayFraction(fraction - mAtomicComponentsStartProgress);
|
||||
}
|
||||
maybeUpdateAtomicAnim(mFromState, mToState, fraction);
|
||||
setBackButtonAlphaWithProgress(fraction);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -477,14 +473,6 @@ public abstract class AbstractStateChangeTouchController
|
||||
}
|
||||
}
|
||||
|
||||
private void setBackButtonAlphaWithProgress(float progress) {
|
||||
if (mFromState.hideBackButton ^ mToState.hideBackButton) {
|
||||
progress = Utilities.boundToRange(progress, 0, 1);
|
||||
final float alpha = mToState.hideBackButton ? 1 - progress : progress;
|
||||
UiFactory.setBackButtonAlpha(mLauncher, alpha, false /* animate */);
|
||||
}
|
||||
}
|
||||
|
||||
private void logReachedState(int logAction) {
|
||||
// Transition complete. log the action
|
||||
mLauncher.getUserEventDispatcher().logStateChangeAction(logAction,
|
||||
|
||||
Reference in New Issue
Block a user