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:
Tony Wickham
2018-05-16 18:15:38 -07:00
committed by Tony
parent 8417a7b514
commit 4e21c1b552
6 changed files with 78 additions and 29 deletions

View File

@@ -25,11 +25,9 @@ import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherStateManager.AnimationConfig;
import com.android.launcher3.LauncherStateManager.StateHandler;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.uioverrides.UiFactory;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.ScrimView;
@@ -184,13 +182,6 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
anim.setDuration(config.duration);
anim.setInterpolator(builder.getInterpolator(ANIM_VERTICAL_PROGRESS, interpolator));
anim.addListener(getProgressAnimatorListener());
if (toState.hideBackButton) {
anim.addUpdateListener(animation -> {
final float alpha = (float) animation.getAnimatedValue();
UiFactory.setBackButtonAlpha(mLauncher, 1 - Utilities.boundToRange(alpha, 0, 1),
false /* animate */);
});
}
builder.play(anim);