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

Commit b677bcbe authored by Winson's avatar Winson
Browse files

Hiding clear-all button on drag start.

Bug: 27702186
Change-Id: Ibec23fdb1ce4853f52a449cbe6d8c6454f0b027c
parent 99ef458f
Loading
Loading
Loading
Loading
+22 −3
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ public class RecentsView extends FrameLayout {
    private static final int DEFAULT_UPDATE_SCRIM_DURATION = 200;
    private static final float DEFAULT_SCRIM_ALPHA = 0.33f;

    private static final int SHOW_STACK_ACTION_BUTTON_DURATION = 150;
    private static final int SHOW_STACK_ACTION_BUTTON_DURATION = 134;
    private static final int HIDE_STACK_ACTION_BUTTON_DURATION = 100;

    private TaskStack mStack;
@@ -464,6 +464,15 @@ public class RecentsView extends FrameLayout {
                true /* isDefaultDockState */, TaskStack.DockState.NONE.viewState.dockAreaAlpha,
                TaskStack.DockState.NONE.viewState.hintTextAlpha,
                true /* animateAlpha */, false /* animateBounds */);

        // Temporarily hide the stack action button without changing visibility
        if (mStackActionButton != null) {
            mStackActionButton.animate()
                    .alpha(0f)
                    .setDuration(HIDE_STACK_ACTION_BUTTON_DURATION)
                    .setInterpolator(Interpolators.ALPHA_OUT)
                    .start();
        }
    }

    public final void onBusEvent(DragDropTargetChangedEvent event) {
@@ -546,6 +555,15 @@ public class RecentsView extends FrameLayout {
            updateVisibleDockRegions(null, true /* isDefaultDockState */, -1, -1,
                    true /* animateAlpha */, false /* animateBounds */);
        }

        // Show the stack action button again without changing visibility
        if (mStackActionButton != null) {
            mStackActionButton.animate()
                    .alpha(1f)
                    .setDuration(SHOW_STACK_ACTION_BUTTON_DURATION)
                    .setInterpolator(Interpolators.ALPHA_IN)
                    .start();
        }
    }

    private Rect getTaskRect(TaskView taskView) {
@@ -733,8 +751,9 @@ public class RecentsView extends FrameLayout {
                    viewState.dockAreaOverlay.setCallback(this);
                    viewState.dockAreaOverlay.setBounds(bounds);
                }
                viewState.startAnimation(bounds, alpha, DOCK_AREA_OVERLAY_TRANSITION_DURATION,
                        Interpolators.ALPHA_IN, animateAlpha, animateBounds);
                viewState.startAnimation(bounds, areaAlpha, hintAlpha,
                        DOCK_AREA_OVERLAY_TRANSITION_DURATION, Interpolators.ALPHA_IN,
                        animateAlpha, animateBounds);
            }
        }
    }