From 4a206837c93349898be4aa9c715b1af3ed0e0435 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 19 Aug 2022 15:34:30 -0400 Subject: [PATCH] Enable adjacent task animation for grid - Enable adjacent task animation for grid tasks - Only parallax for focused task and only when it's fully visible Bug: 236963497 Test: manual Change-Id: I6c681e112f3eb2c7075bc98fab405d978f5057d1 --- .../com/android/quickstep/TaskViewUtils.java | 10 ++-------- .../android/quickstep/views/RecentsView.java | 20 ++++++++++--------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index 93170cb79b..556b99ec16 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -43,7 +43,6 @@ import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MOD import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; -import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.annotation.TargetApi; import android.app.PendingIntent; @@ -198,8 +197,7 @@ public final class TaskViewUtils { BaseActivity baseActivity = BaseActivity.fromContext(context); DeviceProfile dp = baseActivity.getDeviceProfile(); boolean showAsGrid = dp.isTablet; - boolean parallaxCenterAndAdjacentTask = - taskIndex != recentsView.getCurrentPage() && !showAsGrid; + boolean parallaxCenterAndAdjacentTask = taskIndex != recentsView.getCurrentPage(); int taskRectTranslationPrimary = recentsView.getScrollOffset(taskIndex); int taskRectTranslationSecondary = showAsGrid ? (int) v.getGridTranslationY() : 0; @@ -603,11 +601,7 @@ public final class TaskViewUtils { if (raController != null) { raController.setWillFinishToHome(false); } - Context context = v.getContext(); - DeviceProfile dp = BaseActivity.fromContext(context).getDeviceProfile(); - launcherAnim = dp.isTablet - ? ObjectAnimator.ofFloat(recentsView, RecentsView.CONTENT_ALPHA, 0) - : recentsView.createAdjacentPageAnimForTaskLaunch(taskView); + launcherAnim = recentsView.createAdjacentPageAnimForTaskLaunch(taskView); launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR); launcherAnim.setDuration(RECENTS_LAUNCH_DURATION); diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index efaa644502..f00e858b04 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -4317,25 +4317,27 @@ public abstract class RecentsView