Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 774f0522 authored by Ats Jenk's avatar Ats Jenk
Browse files

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
parent 616de308
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -81,6 +81,8 @@ public class DesktopTaskView extends TaskView {

    private final ArrayList<CancellableTask<?>> 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);