From 84d9c4255921204850935532f2e7e6d0e953815b Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 6 May 2020 02:14:20 -0700 Subject: [PATCH] Removing some unused AppWindowAnimationHelper dependencies Change-Id: I594853696c63dc6c22d22cab2faab0ed7529b594 --- .../LauncherAppTransitionManagerImpl.java | 8 ++---- .../AppToOverviewAnimationProvider.java | 2 +- .../android/quickstep/BaseSwipeUpHandler.java | 2 +- .../quickstep/FallbackSwipeHandler.java | 2 +- .../android/quickstep/RecentsActivity.java | 8 ++---- .../com/android/quickstep/TaskViewUtils.java | 10 ++++---- .../util/AppWindowAnimationHelper.java | 25 +------------------ .../quickstep/views/LauncherRecentsView.java | 8 ++---- .../android/quickstep/views/RecentsView.java | 9 ++----- 9 files changed, 17 insertions(+), 57 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java index 908e1f4b8a..a515070437 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java @@ -49,7 +49,6 @@ import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.SpringAnimationBuilder; import com.android.launcher3.states.StateAnimationConfig; -import com.android.quickstep.util.AppWindowAnimationHelper; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; @@ -86,11 +85,8 @@ public final class LauncherAppTransitionManagerImpl extends QuickstepAppTransiti boolean skipLauncherChanges = !launcherClosing; TaskView taskView = findTaskViewToLaunch(mLauncher, v, appTargets); - - AppWindowAnimationHelper helper = - new AppWindowAnimationHelper(recentsView.getPagedViewOrientedState(), mLauncher); Animator recentsAnimator = getRecentsWindowAnimator(taskView, skipLauncherChanges, - appTargets, wallpaperTargets, mLauncher.getDepthController(), helper); + appTargets, wallpaperTargets, mLauncher.getDepthController()); anim.play(recentsAnimator.setDuration(RECENTS_LAUNCH_DURATION)); Animator childStateAnimation = null; @@ -98,7 +94,7 @@ public final class LauncherAppTransitionManagerImpl extends QuickstepAppTransiti Animator launcherAnim; final AnimatorListenerAdapter windowAnimEndListener; if (launcherClosing) { - launcherAnim = recentsView.createAdjacentPageAnimForTaskLaunch(taskView, helper); + launcherAnim = recentsView.createAdjacentPageAnimForTaskLaunch(taskView); launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR); launcherAnim.setDuration(RECENTS_LAUNCH_DURATION); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java index e182c59570..b5ac6e5dce 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java @@ -156,7 +156,7 @@ final class AppToOverviewAnimationProvider exten mActivityInterface.getSwipeUpDestinationAndLength(mActivity.getDeviceProfile(), mActivity, targetRect); clipHelper.updateTargetRect(targetRect); - clipHelper.prepareAnimation(mActivity.getDeviceProfile(), false /* isOpening */); + clipHelper.prepareAnimation(mActivity.getDeviceProfile()); TransformParams params = new TransformParams() .setSyncTransactionApplier(new SyncRtSurfaceTransactionApplierCompat(rootView)); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java index c554cf656d..313ae44902 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java @@ -276,7 +276,7 @@ public abstract class BaseSwipeUpHandler mTaskAlpha.value); - inOutHelper.prepareAnimation( - BaseActivity.fromContext(v.getContext()).getDeviceProfile(), - true /* isOpening */); + BaseActivity.fromContext(v.getContext()).getDeviceProfile()); inOutHelper.fromTaskThumbnailView(v.getThumbnail(), (RecentsView) v.getParent(), targets.apps.length == 0 ? null : targets.apps[0]); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/AppWindowAnimationHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/AppWindowAnimationHelper.java index 5abbd86a86..cd7c7eedbd 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/AppWindowAnimationHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/AppWindowAnimationHelper.java @@ -20,7 +20,6 @@ import static com.android.systemui.shared.system.QuickStepContract.getWindowCorn import static com.android.systemui.shared.system.QuickStepContract.supportsRoundedCornersOnWindows; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING; import android.annotation.TargetApi; import android.content.Context; @@ -43,7 +42,6 @@ import com.android.quickstep.RemoteAnimationTargets; import com.android.quickstep.SystemUiProxy; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskThumbnailView; -import com.android.quickstep.views.TaskView; import com.android.systemui.shared.recents.utilities.RectFEvaluator; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat; @@ -96,9 +94,6 @@ public class AppWindowAnimationHelper { // Corner radius currently applied to transformed window. private float mCurrentCornerRadius; - // Whether to boost the opening animation target layers, or the closing - private int mBoostModeTargetLayers = -1; - private TargetAlphaProvider mTaskAlphaCallback = (t, a) -> a; private TargetAlphaProvider mBaseAlphaCallback = (t, a) -> 1; @@ -163,8 +158,7 @@ public class AppWindowAnimationHelper { mTargetRect.width(), mTargetRect.height()); } - public void prepareAnimation(DeviceProfile dp, boolean isOpening) { - mBoostModeTargetLayers = isOpening ? MODE_OPENING : MODE_CLOSING; + public void prepareAnimation(DeviceProfile dp) { mUseRoundedCornersOnWindows = mSupportsRoundedCornersOnWindows && !dp.isMultiWindowMode; } @@ -317,10 +311,6 @@ public class AppWindowAnimationHelper { mBaseAlphaCallback = callback; } - public void fromTaskThumbnailView(TaskThumbnailView ttv, RecentsView rv) { - fromTaskThumbnailView(ttv, rv, null); - } - public void fromTaskThumbnailView(TaskThumbnailView ttv, RecentsView rv, @Nullable RemoteAnimationTargetCompat target) { BaseDraggingActivity activity = BaseDraggingActivity.fromContext(ttv.getContext()); @@ -357,19 +347,6 @@ public class AppWindowAnimationHelper { } } - /** - * Compute scale and translation y such that the specified task view fills the screen. - */ - public AppWindowAnimationHelper updateForFullscreenOverview(TaskView v) { - TaskThumbnailView thumbnailView = v.getThumbnail(); - RecentsView recentsView = v.getRecentsView(); - fromTaskThumbnailView(thumbnailView, recentsView); - Rect taskSize = new Rect(); - recentsView.getTaskSize(taskSize); - updateTargetRect(taskSize); - return this; - } - private void updateStackBoundsToMultiWindowTaskSize(BaseDraggingActivity activity) { SystemUiProxy proxy = SystemUiProxy.INSTANCE.get(activity); if (proxy.isActive()) { diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java index aafad0c79e..416af2b37c 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java @@ -32,7 +32,6 @@ import android.animation.ObjectAnimator; import android.annotation.TargetApi; import android.content.Context; import android.graphics.Canvas; -import android.graphics.Rect; import android.os.Build; import android.util.AttributeSet; import android.view.MotionEvent; @@ -63,8 +62,6 @@ import com.android.systemui.plugins.RecentsExtraCard; public class LauncherRecentsView extends RecentsView implements StateListener { - private static final Rect sTempRect = new Rect(); - private final TransformParams mTransformParams = new TransformParams(); private RecentsExtraCard mRecentsExtraCardPlugin; @@ -149,9 +146,8 @@ public class LauncherRecentsView extends RecentsView * Animates adjacent tasks and translate hotseat off screen as well. */ @Override - public AnimatorSet createAdjacentPageAnimForTaskLaunch(TaskView tv, - AppWindowAnimationHelper helper) { - AnimatorSet anim = super.createAdjacentPageAnimForTaskLaunch(tv, helper); + public AnimatorSet createAdjacentPageAnimForTaskLaunch(TaskView tv) { + AnimatorSet anim = super.createAdjacentPageAnimForTaskLaunch(tv); if (!SysUINavigationMode.getMode(mActivity).hasGestures) { // Hotseat doesn't move when opening recents with the button, diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index fae0df0fe4..33e0576b90 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -1760,8 +1760,7 @@ public abstract class RecentsView extends PagedView impl * If launching one of the adjacent tasks, parallax the center task and other adjacent task * to the right. */ - public AnimatorSet createAdjacentPageAnimForTaskLaunch( - TaskView tv, AppWindowAnimationHelper appWindowAnimationHelper) { + public AnimatorSet createAdjacentPageAnimForTaskLaunch(TaskView tv) { AnimatorSet anim = new AnimatorSet(); int taskIndex = indexOfChild(tv); @@ -1833,11 +1832,7 @@ public abstract class RecentsView extends PagedView impl } }); - AppWindowAnimationHelper appWindowAnimationHelper = new AppWindowAnimationHelper( - getPagedViewOrientedState(), mActivity); - appWindowAnimationHelper.fromTaskThumbnailView(tv.getThumbnail(), this); - appWindowAnimationHelper.prepareAnimation(mActivity.getDeviceProfile(), true /* isOpening */); - AnimatorSet anim = createAdjacentPageAnimForTaskLaunch(tv, appWindowAnimationHelper); + AnimatorSet anim = createAdjacentPageAnimForTaskLaunch(tv); DepthController depthController = getDepthController(); if (depthController != null) {