Removing multi-state apha control for hotseat

Change-Id: I68ccbe96caa70921aefd18fc8ec9ad0638c3fab1
This commit is contained in:
Sunny Goyal
2018-01-19 14:26:18 -08:00
parent d8a3f3c251
commit 19d32b76dd
7 changed files with 32 additions and 123 deletions

View File

@@ -138,9 +138,8 @@ public class WorkspaceStateTransitionAnimation {
propertySetter.setFloat(mWorkspace, View.TRANSLATION_Y,
scaleAndTranslation[2], Interpolators.ZOOM_IN);
float hotseatAlpha = state.getHoseatAlpha(mLauncher);
propertySetter.setViewAlpha(mWorkspace.createHotseatAlphaAnimator(hotseatAlpha),
mLauncher.getHotseat(), hotseatAlpha);
propertySetter.setViewAlpha(mLauncher.getHotseat(), state.getHoseatAlpha(mLauncher),
pageAlphaProvider.interpolator);
// Set scrim
propertySetter.setInt(mLauncher.getDragLayer().getScrim(), DRAWABLE_ALPHA,
@@ -165,11 +164,7 @@ public class WorkspaceStateTransitionAnimation {
public static class PropertySetter {
public void setViewAlpha(Animator anim, View view, float alpha) {
if (anim != null) {
anim.end();
return;
}
public void setViewAlpha(View view, float alpha, TimeInterpolator interpolator) {
view.setAlpha(alpha);
AlphaUpdateListener.updateVisibility(view, isAccessibilityEnabled(view.getContext()));
}
@@ -196,17 +191,14 @@ public class WorkspaceStateTransitionAnimation {
}
@Override
public void setViewAlpha(Animator anim, View view, float alpha) {
if (anim == null) {
if (view.getAlpha() == alpha) {
return;
}
anim = ObjectAnimator.ofFloat(view, View.ALPHA, alpha);
anim.addListener(new AlphaUpdateListener(view,
isAccessibilityEnabled(view.getContext())));
public void setViewAlpha(View view, float alpha, TimeInterpolator interpolator) {
if (view.getAlpha() == alpha) {
return;
}
anim.setDuration(mDuration).setInterpolator(getFadeInterpolator(alpha));
ObjectAnimator anim = ObjectAnimator.ofFloat(view, View.ALPHA, alpha);
anim.addListener(new AlphaUpdateListener(
view, isAccessibilityEnabled(view.getContext())));
anim.setDuration(mDuration).setInterpolator(interpolator);
mStateAnimator.play(anim);
}