summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2019-02-11 12:29:23 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-02-11 12:29:23 +0000
commit16373a551826fca41c9cacfaf372de64ebc5a22c (patch)
tree757bdf03fd299ee36ba601eea56c634a1c5ebc30
parent60708035a8f1042aa0ad31db5fbbd2562d096fbd (diff)
parent3df49260c4f52b84abc220daa4aadf3d791b5776 (diff)
Merge "Make ProgressBar#getCurrentDrawable() public"
-rw-r--r--api/current.txt1
-rw-r--r--core/java/android/widget/ProgressBar.java16
2 files changed, 14 insertions, 3 deletions
diff --git a/api/current.txt b/api/current.txt
index c0d10a6bc20a..10d55f5cb39a 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -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();
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index 6b48c6584ad2..30df5b5a09a3 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -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;
}