From 5db25d5787c34bcd96855f5bc5b32313cbfe2fcd Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Sat, 25 Jul 2020 11:13:12 -0700 Subject: [PATCH] Align live tile with the current task view in Overview when the users swipes up to dismiss Test: manual Bug: 160911104 Change-Id: I64b6e737cb11a9bea25b59762431d1023d2153ac --- .../touchcontrollers/TaskViewTouchController.java | 15 --------------- .../com/android/quickstep/views/RecentsView.java | 7 +++++++ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java index 37a595ec07..fce019b3e4 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java @@ -16,7 +16,6 @@ package com.android.launcher3.uioverrides.touchcontrollers; import static com.android.launcher3.AbstractFloatingView.TYPE_ACCESSIBLE; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_BOTH; import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_NEGATIVE; import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_POSITIVE; @@ -262,13 +261,6 @@ public abstract class TaskViewTouchController mCurrentAnimation.setPlayFraction(Utilities.boundToRange( totalDisplacement * mProgressMultiplier, 0, 1)); - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - if (mRecentsView.getCurrentPage() == 0) { - mRecentsView.getLiveTileTaskViewSimulator().setOffsetY( - isGoingUp ? totalDisplacement : 0); - mRecentsView.redrawLiveTile(); - } - } return true; } @@ -299,13 +291,6 @@ public abstract class TaskViewTouchController } mCurrentAnimation.setEndAction(() -> onCurrentAnimationEnd(goingToEnd, logAction)); - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - mCurrentAnimation.getAnimationPlayer().addUpdateListener(valueAnimator -> { - if (mRecentsView.getCurrentPage() != 0 || mCurrentAnimationIsGoingUp) { - mRecentsView.redrawLiveTile(); - } - }); - } mCurrentAnimation.startWithVelocity(mActivity, goingToEnd, velocity, mEndDisplacement, animationDuration); } 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 49a9db978b..eaa9521246 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 @@ -1475,6 +1475,13 @@ public abstract class RecentsView extends PagedView anim.addOnFrameCallback(this::updateCurveProperties); } + if (ENABLE_QUICKSTEP_LIVE_TILE.get() && getRunningTaskView() == taskView) { + anim.addOnFrameCallback(() -> { + mLiveTileTaskViewSimulator.setOffsetY(taskView.getTranslationY()); + redrawLiveTile(); + }); + } + // Add a tiny bit of translation Z, so that it draws on top of other views if (animateTaskView) { taskView.setTranslationZ(0.1f);