Several animation calls cleanup

> Using View property instead of strings to avoid extra reflection step
> Using ViewPropertyAnimator when several properties are being animated

Change-Id: I41625643b38b70bac11e2c81d18058ec878d73bd
This commit is contained in:
Sunny Goyal
2015-07-06 22:52:49 -07:00
parent c1729a4d15
commit 5d2fc32e6d
13 changed files with 64 additions and 118 deletions

View File

@@ -30,8 +30,8 @@ import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import com.android.launcher3.allapps.AllAppsContainerView;
import com.android.launcher3.util.UiThreadCircularReveal;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.util.UiThreadCircularReveal;
import com.android.launcher3.widget.WidgetsContainerView;
import java.util.HashMap;
@@ -259,11 +259,11 @@ public class LauncherStateTransitionAnimation {
// Create the animators
PropertyValuesHolder panelAlpha =
PropertyValuesHolder.ofFloat("alpha", revealViewToAlpha, 1f);
PropertyValuesHolder.ofFloat(View.ALPHA, revealViewToAlpha, 1f);
PropertyValuesHolder panelDriftY =
PropertyValuesHolder.ofFloat("translationY", revealViewToYDrift, 0);
PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, revealViewToYDrift, 0);
PropertyValuesHolder panelDriftX =
PropertyValuesHolder.ofFloat("translationX", revealViewToXDrift, 0);
PropertyValuesHolder.ofFloat(View.TRANSLATION_X, revealViewToXDrift, 0);
ObjectAnimator panelAlphaAndDrift = ObjectAnimator.ofPropertyValuesHolder(revealView,
panelAlpha, panelDriftY, panelDriftX);
panelAlphaAndDrift.setDuration(revealDuration);