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

Commit 03e09c17 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Only reset fling velocity if opposite direction"

parents 5c86fc7a 519779ee
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1313,9 +1313,12 @@ public class NotificationPanelView extends PanelView implements
            }
            return;
        }
        boolean belowFalsingThreshold = isFalseTouch();
        if (belowFalsingThreshold) {

        // If we move in the opposite direction, reset velocity and use a different duration.
        boolean oppositeDirection = false;
        if (vel > 0 && !expand || vel < 0 && expand) {
            vel = 0;
            oppositeDirection = true;
        }
        ValueAnimator animator = ValueAnimator.ofFloat(mQsExpansionHeight, target);
        if (isClick) {
@@ -1324,7 +1327,7 @@ public class NotificationPanelView extends PanelView implements
        } else {
            mFlingAnimationUtils.apply(animator, mQsExpansionHeight, target, vel);
        }
        if (belowFalsingThreshold) {
        if (oppositeDirection) {
            animator.setDuration(350);
        }
        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {