From 6feb4b638ea8d0e54fbc00ae4202fd00566d7370 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 19 Mar 2020 12:00:02 -0700 Subject: [PATCH] Fixing taskView is recycled with visibility gone when dismissed Bug: 151883828 Change-Id: I89d6ed78e1713b1e69e8c7075c638692902f5842 --- .../src/com/android/quickstep/views/RecentsView.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 4917cbe17f..11a88aff4d 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 @@ -19,6 +19,7 @@ package com.android.quickstep.views; import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS; import static com.android.launcher3.InvariantDeviceProfile.CHANGE_FLAG_ICON_PARAMS; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; +import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA; import static com.android.launcher3.LauncherState.BACKGROUND_APP; import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import static com.android.launcher3.Utilities.squaredHypot; @@ -1162,7 +1163,9 @@ public abstract class RecentsView extends PagedView impl } private void addDismissedTaskAnimations(View taskView, long duration, PendingAnimation anim) { - anim.setViewAlpha(taskView, 0, ACCEL_2); + // Use setFloat instead of setViewAlpha as we want to keep the view visible even when it's + // alpha is set to 0 so that it can be recycled in the view pool properly + anim.setFloat(taskView, VIEW_ALPHA, 0, ACCEL_2); FloatProperty secondaryViewTranslate = mOrientationHandler.getSecondaryViewTranslate(); int secondaryTaskDimension = mOrientationHandler.getSecondaryDimension(taskView);