From 9e76f682f3e52afa1f11172564b883c7dfda5063 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Mon, 13 Feb 2017 12:13:43 -0800 Subject: Removing wrapper around ViewPropertyAnimator, and using ObjectAnimator instead Bug: 35218222 Change-Id: Ic714cf7d20989cb45f07712e8a6f6659d0e3f30d --- .../WorkspaceStateTransitionAnimation.java | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/com/android/launcher3/WorkspaceStateTransitionAnimation.java') diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index 6a71befe4..482a2c93b 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -31,6 +31,7 @@ import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.DecelerateInterpolator; import com.android.launcher3.anim.AnimationLayerSet; +import com.android.launcher3.anim.PropertyListBuilder; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.util.Thunk; @@ -337,10 +338,9 @@ public class WorkspaceStateTransitionAnimation { if (animated) { float oldBackgroundAlpha = cl.getBackgroundAlpha(); if (initialAlpha != finalAlpha) { - LauncherViewPropertyAnimator alphaAnim = - new LauncherViewPropertyAnimator(cl.getShortcutsAndWidgets()); - alphaAnim.alpha(finalAlpha) - .setDuration(duration) + Animator alphaAnim = ObjectAnimator.ofFloat( + cl.getShortcutsAndWidgets(), View.ALPHA, finalAlpha); + alphaAnim.setDuration(duration) .setInterpolator(mZoomInInterpolator); mStateAnimator.play(alphaAnim); } @@ -377,17 +377,16 @@ public class WorkspaceStateTransitionAnimation { .animateAlphaAtIndex(finalQsbAlpha, Workspace.QSB_ALPHA_INDEX_STATE_CHANGE); if (animated) { - LauncherViewPropertyAnimator scale = new LauncherViewPropertyAnimator(mWorkspace); - scale.scaleX(mNewScale) - .scaleY(mNewScale) - .translationY(finalWorkspaceTranslationY) - .setDuration(duration) - .setInterpolator(mZoomInInterpolator); + Animator scale = LauncherAnimUtils.ofPropertyValuesHolder(mWorkspace, + new PropertyListBuilder().scale(mNewScale) + .translationY(finalWorkspaceTranslationY).build()) + .setDuration(duration); + scale.setInterpolator(mZoomInInterpolator); mStateAnimator.play(scale); Animator hotseatAlpha = mWorkspace.createHotseatAlphaAnimator(finalHotseatAlpha); - LauncherViewPropertyAnimator overviewPanelAlpha = - new LauncherViewPropertyAnimator(overviewPanel).alpha(finalOverviewPanelAlpha); + Animator overviewPanelAlpha = ObjectAnimator.ofFloat( + overviewPanel, View.ALPHA, finalOverviewPanelAlpha); overviewPanelAlpha.addListener(new AlphaUpdateListener(overviewPanel, accessibilityEnabled)); -- cgit v1.2.3