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

Commit 3df49260 authored by Mihai Popa's avatar Mihai Popa
Browse files

Make ProgressBar#getCurrentDrawable() public

The CL adds ProgressBar#getCurrentDrawable() to the public API, and
transitions mCurrentDrawable in ProgressBar to dark gray list.
Developers can use getCurrentDrawable(), setProgressDrawable() and
setIndeterminateDrawable() instead of accessing mCurrentDrawable
directly.

Bug: 123769441
Test: none
Change-Id: Ia9876f97dc2ec2c69902b8281cd7876b516dbdd4
parent 2148e7f0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -56375,6 +56375,7 @@ package android.widget {
    ctor public ProgressBar(android.content.Context, android.util.AttributeSet);
    ctor public ProgressBar(android.content.Context, android.util.AttributeSet, int);
    ctor public ProgressBar(android.content.Context, android.util.AttributeSet, int, int);
    method @Nullable public android.graphics.drawable.Drawable getCurrentDrawable();
    method public android.graphics.drawable.Drawable getIndeterminateDrawable();
    method @Nullable public android.content.res.ColorStateList getIndeterminateTintList();
    method @Nullable public android.graphics.PorterDuff.Mode getIndeterminateTintMode();
+13 −3
Original line number Diff line number Diff line
@@ -211,7 +211,12 @@ public class ProgressBar extends View {

    private Drawable mIndeterminateDrawable;
    private Drawable mProgressDrawable;
    @UnsupportedAppUsage
    /**
     * Outside the framework, instead of accessing this directly, please use
     * {@link #getCurrentDrawable()}, {@link #setProgressDrawable(Drawable)},
     * {@link #setIndeterminateDrawable(Drawable)} and their tiled versions.
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    private Drawable mCurrentDrawable;
    private ProgressTintInfo mProgressTintInfo;

@@ -1298,9 +1303,14 @@ public class ProgressBar extends View {
    }

    /**
     * @return The drawable currently used to draw the progress bar
     * Returns the drawable currently used to draw the progress bar. This will be
     * either {@link #getProgressDrawable()} or {@link #getIndeterminateDrawable()}
     * depending on whether the progress bar is in determinate or indeterminate mode.
     *
     * @return the drawable currently used to draw the progress bar
     */
    Drawable getCurrentDrawable() {
    @Nullable
    public Drawable getCurrentDrawable() {
        return mCurrentDrawable;
    }