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

Commit 246837aa authored by Liran Binyamin's avatar Liran Binyamin Committed by Android (Google) Code Review
Browse files

Merge "Don't reset alpha after dragging to dismiss" into main

parents 9944b989 afdad57b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -647,8 +647,10 @@ public class BubbleBarView extends FrameLayout {
        }
        setAlphaDuringBubbleDrag(1f);
        setTranslationX(0f);
        if (getBubbleChildCount() > 0) {
            setAlpha(1f);
        }
    }

    /**
     * Get bubble bar top coordinate on screen when bar is resting
+7 −4
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ public class BubbleDragAnimator {
                        boolean wasFling, boolean canceled, float finalValue, float finalVelocity,
                        boolean allRelevantPropertyAnimationsEnded) -> {
                    if (canceled || allRelevantPropertyAnimationsEnded) {
                        resetAnimatedViews(restingPosition);
                        resetAnimatedViews(restingPosition, /* dismissed= */ false);
                        if (endActions != null) {
                            endActions.run();
                        }
@@ -197,7 +197,7 @@ public class BubbleDragAnimator {
                        boolean wasFling, boolean canceled, float finalValue, float finalVelocity,
                        boolean allRelevantPropertyAnimationsEnded) -> {
                    if (canceled || allRelevantPropertyAnimationsEnded) {
                        resetAnimatedViews(initialPosition);
                        resetAnimatedViews(initialPosition, /* dismissed= */ true);
                        if (endActions != null) endActions.run();
                    }
                })
@@ -208,11 +208,14 @@ public class BubbleDragAnimator {
     * Reset the animated views to the initial state
     *
     * @param initialPosition position of the bubble
     * @param dismissed whether the animated view was dismissed
     */
    private void resetAnimatedViews(@NonNull PointF initialPosition) {
    private void resetAnimatedViews(@NonNull PointF initialPosition, boolean dismissed) {
        mView.setScaleX(1f);
        mView.setScaleY(1f);
        if (!dismissed) {
            mView.setAlpha(1f);
        }
        mView.setTranslationX(initialPosition.x);
        mView.setTranslationY(initialPosition.y);