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

Commit e32276f8 authored by Ivan Tkachenko's avatar Ivan Tkachenko Committed by Android (Google) Code Review
Browse files

Merge "Fix expanded bubble view below scrim" into main

parents b2ecdfe7 63b8ee8b
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.view.ViewPropertyAnimator;
import android.view.ViewTreeObserver;
import android.view.WindowManagerPolicyConstants;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -212,7 +213,8 @@ public class BubbleStackView extends FrameLayout
    private ExpandedViewAnimationController mExpandedViewAnimationController;

    private View mScrim;
    private boolean mScrimAnimating;
    @Nullable
    private ViewPropertyAnimator mScrimAnimation;
    private View mManageMenuScrim;
    private FrameLayout mExpandedViewContainer;

@@ -748,8 +750,8 @@ public class BubbleStackView extends FrameLayout
            float collapsed = -Math.min(dy, 0);
            mExpandedViewAnimationController.updateDrag((int) collapsed);

            // Update scrim
            if (!mScrimAnimating) {
            // Update scrim if it's not animating already
            if (mScrimAnimation == null) {
                mScrim.setAlpha(getScrimAlphaForDrag(collapsed));
            }
        }
@@ -768,8 +770,8 @@ public class BubbleStackView extends FrameLayout
            } else {
                mExpandedViewAnimationController.animateBackToExpanded();

                // Update scrim
                if (!mScrimAnimating) {
                // Update scrim if it's not animating already
                if (mScrimAnimation == null) {
                    showScrim(true, null /* runnable */);
                }
            }
@@ -2236,27 +2238,28 @@ public class BubbleStackView extends FrameLayout

    private void showScrim(boolean show, Runnable after) {
        AnimatorListenerAdapter listener = new AnimatorListenerAdapter() {
            @Override
            public void onAnimationStart(Animator animation) {
                mScrimAnimating = true;
            }

            @Override
            public void onAnimationEnd(Animator animation) {
                mScrimAnimating = false;
                mScrimAnimation = null;
                if (after != null) {
                    after.run();
                }
            }
        };
        if (mScrimAnimation != null) {
            // Cancel scrim animation if it animates
            mScrimAnimation.cancel();
        }
        if (show) {
            mScrim.animate()
            mScrimAnimation = mScrim.animate();
            mScrimAnimation
                    .setInterpolator(ALPHA_IN)
                    .alpha(BUBBLE_EXPANDED_SCRIM_ALPHA)
                    .setListener(listener)
                    .start();
        } else {
            mScrim.animate()
            mScrimAnimation = mScrim.animate();
            mScrimAnimation
                    .alpha(0f)
                    .setInterpolator(ALPHA_OUT)
                    .setListener(listener)