From 774f05226b01080d9c49b71b1685c18fd9161302 Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Thu, 5 Jan 2023 16:29:40 -0800 Subject: [PATCH] Hide DesktopTaskView background while animating While animating DesktopTaskView to/from fullscreen, hide the background. Background should only show up when this taskview is shown in recents. While it is animating, we don't need to show it. Bug: 263264985 Test: manual, trigger transient taskbar, observe that background does not flicker Change-Id: I76d0eb1857645b7f04a0b2e1eebe2393c252c257 --- .../android/quickstep/views/DesktopTaskView.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java b/quickstep/src/com/android/quickstep/views/DesktopTaskView.java index c878278da5..858f6abbc1 100644 --- a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java +++ b/quickstep/src/com/android/quickstep/views/DesktopTaskView.java @@ -81,6 +81,8 @@ public class DesktopTaskView extends TaskView { private final ArrayList> mPendingThumbnailRequests = new ArrayList<>(); + private ShapeDrawable mBackground; + public DesktopTaskView(Context context) { this(context, null); } @@ -99,10 +101,11 @@ public class DesktopTaskView extends TaskView { float[] outerRadii = new float[8]; Arrays.fill(outerRadii, getTaskCornerRadius()); RoundRectShape shape = new RoundRectShape(outerRadii, null, null); - ShapeDrawable background = new ShapeDrawable(shape); - background.setTint(getResources().getColor(android.R.color.system_neutral2_300)); + mBackground = new ShapeDrawable(shape); + mBackground.setTint(getResources().getColor(android.R.color.system_neutral2_300, + getContext().getTheme())); // TODO(b/244348395): this should be wallpaper - setBackground(background); + setBackground(mBackground); mSnapshotViews.add(mSnapshotView); } @@ -427,6 +430,12 @@ public class DesktopTaskView extends TaskView { // TODO(b/249371338): this copies parent implementation and makes it work for N thumbs progress = Utilities.boundToRange(progress, 0, 1); mFullscreenProgress = progress; + if (mFullscreenProgress > 0) { + // Don't show background while we are transitioning to/from fullscreen + setBackground(null); + } else { + setBackground(mBackground); + } for (int i = 0; i < mSnapshotViewMap.size(); i++) { TaskThumbnailView thumbnailView = mSnapshotViewMap.valueAt(i); thumbnailView.getTaskOverlay().setFullscreenProgress(progress);