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

Commit 4a9f0495 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "[ProgressBar] Fix: Media volume bar indicates a wrong value"

parents b5cde119 2e2664fa
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.widget;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.annotation.InterpolatorRes;
import android.annotation.NonNull;
@@ -246,6 +248,8 @@ public class ProgressBar extends View {

    private AccessibilityEventSender mAccessibilityEventSender;

    private ObjectAnimator mLastProgressAnimator;

    /**
     * Create a new progress bar with range 0...100 and initial progress of 0.
     * @param context the application environment
@@ -1544,8 +1548,19 @@ public class ProgressBar extends View {
            animator.setAutoCancel(true);
            animator.setDuration(PROGRESS_ANIM_DURATION);
            animator.setInterpolator(PROGRESS_ANIM_INTERPOLATOR);
            animator.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    mLastProgressAnimator = null;
                }
            });
            animator.start();
            mLastProgressAnimator = animator;
        } else {
            if (isPrimary && mLastProgressAnimator != null) {
                mLastProgressAnimator.cancel();
                mLastProgressAnimator = null;
            }
            setVisualProgress(id, scale);
        }