Removing wrapper around ViewPropertyAnimator, and using ObjectAnimator

instead

Bug: 35218222
Change-Id: Ic714cf7d20989cb45f07712e8a6f6659d0e3f30d
This commit is contained in:
Sunny Goyal
2017-02-13 12:13:43 -08:00
parent eb04b84153
commit 9e76f682f3
10 changed files with 119 additions and 329 deletions

View File

@@ -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));