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

Commit 156ac1d7 authored by Shep Shapard's avatar Shep Shapard Committed by Android (Google) Code Review
Browse files

Merge "Removing reflection access ProgressBar#mDuration"

parents a45b41f5 3b07045a
Loading
Loading
Loading
Loading
+38 −3
Original line number Diff line number Diff line
@@ -199,7 +199,9 @@ public class ProgressBar extends View {
    private boolean mMaxInitialized;

    private int mBehavior;
    @UnsupportedAppUsage
    // Better to define a Drawable that implements Animatable if you want to modify animation
    // characteristics programatically.
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 124052713)
    private int mDuration;
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    private boolean mIndeterminate;
@@ -284,7 +286,6 @@ public class ProgressBar extends View {
            }
        }


        mDuration = a.getInt(R.styleable.ProgressBar_indeterminateDuration, mDuration);

        mMinWidth = a.getDimensionPixelSize(R.styleable.ProgressBar_minWidth, mMinWidth);
@@ -709,7 +710,17 @@ public class ProgressBar extends View {
    /**
     * Define the drawable used to draw the progress bar in indeterminate mode.
     *
     * <p>For the Drawable to animate, it must implement {@link Animatable}, or override
     * {@link Drawable#onLevelChange(int)}.  A Drawable that implements Animatable will be animated
     * via that interface and therefore provides the greatest amount of customization. A Drawable
     * that only overrides onLevelChange(int) is animated directly by ProgressBar and only the
     * animation {@link android.R.styleable#ProgressBar_indeterminateDuration duration},
         * {@link android.R.styleable#ProgressBar_indeterminateBehavior repeating behavior}, and
     * {@link #setInterpolator(Interpolator) interpolator} can be modified, and only before the
     * indeterminate animation begins.
     *
     * @param d the new drawable
     * @attr ref android.R.styleable#ProgressBar_indeterminateDrawable
     * @see #getIndeterminateDrawable()
     * @see #setIndeterminate(boolean)
     */
@@ -1774,10 +1785,21 @@ public class ProgressBar extends View {

    /**
     * Sets the acceleration curve for the indeterminate animation.
     * The interpolator is loaded as a resource from the specified context.
     *
     * <p>The interpolator is loaded as a resource from the specified context. Defaults to a linear
     * interpolation.
     *
     * <p>The interpolator only affects the indeterminate animation if the
     * {@link #setIndeterminateDrawable(Drawable) supplied indeterminate drawable} does not
     * implement {@link Animatable}.
     *
     * <p>This call must be made before the indeterminate animation starts for it to have an affect.
     *
     * @param context The application environment
     * @param resID The resource identifier of the interpolator to load
     * @attr ref android.R.styleable#ProgressBar_interpolator
     * @see #setInterpolator(Interpolator)
     * @see #getInterpolator()
     */
    public void setInterpolator(Context context, @InterpolatorRes int resID) {
        setInterpolator(AnimationUtils.loadInterpolator(context, resID));
@@ -1787,7 +1809,17 @@ public class ProgressBar extends View {
     * Sets the acceleration curve for the indeterminate animation.
     * Defaults to a linear interpolation.
     *
     * <p>The interpolator only affects the indeterminate animation if the
     * {@link #setIndeterminateDrawable(Drawable) supplied indeterminate drawable} does not
     * implement {@link Animatable}.
     *
     * <p>This call must be made before the indeterminate animation starts for it to have
     * an affect.
     *
     * @param interpolator The interpolator which defines the acceleration curve
     * @attr ref android.R.styleable#ProgressBar_interpolator
     * @see #setInterpolator(Context, int)
     * @see #getInterpolator()
     */
    public void setInterpolator(Interpolator interpolator) {
        mInterpolator = interpolator;
@@ -1797,6 +1829,9 @@ public class ProgressBar extends View {
     * Gets the acceleration curve type for the indeterminate animation.
     *
     * @return the {@link Interpolator} associated to this animation
     * @attr ref android.R.styleable#ProgressBar_interpolator
     * @see #setInterpolator(Context, int)
     * @see #setInterpolator(Interpolator)
     */
    @InspectableProperty
    public Interpolator getInterpolator() {
+11 −4
Original line number Diff line number Diff line
@@ -4349,14 +4349,18 @@
        <attr name="indeterminate" format="boolean" />
        <!-- Restricts to ONLY indeterminate mode (state-keeping progress mode will not work). -->
        <attr name="indeterminateOnly" format="boolean" />
        <!-- Drawable used for the indeterminate mode. -->
        <!-- Drawable used for the indeterminate mode. One that implements Animatable offers more
             control over the animation.-->
        <attr name="indeterminateDrawable" format="reference" />
        <!-- Drawable used for the progress mode. -->
        <attr name="progressDrawable" format="reference" />
        <!-- Duration of the indeterminate animation. -->
        <!-- Duration of the indeterminate animation. Only affects the indeterminate animation
             if the indeterminate Drawable does not implement
             android.graphics.drawable.Animatable. -->
        <attr name="indeterminateDuration" format="integer" min="1" />
        <!-- Defines how the indeterminate mode should behave when the progress
        reaches max. -->
        <!-- Defines how the indeterminate mode should behave when the progress reaches max. Only
             affects the indeterminate animation if the indeterminate Drawable does not implement
             android.graphics.drawable.Animatable. -->
        <attr name="indeterminateBehavior">
            <!-- Progress starts over from 0. -->
            <enum name="repeat" value="1" />
@@ -4367,6 +4371,9 @@
        <attr name="maxWidth" />
        <attr name="minHeight" format="dimension" />
        <attr name="maxHeight" />
        <!-- Sets the acceleration curve for the indeterminate animation. Defaults to a linear
             interpolation. Only affects the indeterminate animation if the indeterminate Drawable
             does not implement android.graphics.drawable.Animatable.-->
        <attr name="interpolator" format="reference" />
        <!-- Timeout between frames of animation in milliseconds.
             {@deprecated Not used by the framework}. -->