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

Commit 739a66eb authored by Becky Qiu's avatar Becky Qiu
Browse files

[Overview Actions] Hide task view footers when it's modal.

Demo: https://drive.google.com/a/google.com/file/d/1sXfHG0aMe7OzmIx7uZLAincvg6KizCLj/view?usp=sharing

Test: local
Bug: 151745339
Change-Id: Icf1263b87dbada2025a2d494bf1f2f067584f8c4
parent 24b449d5
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -247,8 +247,17 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {

    /** Updates UI based on whether the task is modal. */
    public void updateUiForModalTask() {
        boolean isOverlayModal = isTaskOverlayModal();
        if (getRecentsView() != null) {
            getRecentsView().updateUiForModalTask(this, isTaskOverlayModal());
            getRecentsView().updateUiForModalTask(this, isOverlayModal);
        }
        // Hide footers when overlay is modal.
        if (isOverlayModal) {
            for (FooterWrapper footer : mFooters) {
                if (footer != null) {
                    footer.animateHide();
                }
            }
        }
    }

@@ -780,6 +789,22 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
            animator.setDuration(100);
            animator.start();
        }

        void animateHide() {
            ValueAnimator animator = ValueAnimator.ofFloat(0.0f, 1.0f);
            animator.addUpdateListener(anim -> {
                mFooterVerticalOffset = anim.getAnimatedFraction();
                updateFooterOffset();
            });
            animator.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    removeView(mView);
                }
            });
            animator.setDuration(100);
            animator.start();
        }
    }

    @Override