Skip to content

Commit

Permalink
[ProgressIndicator] Updated the drawable setters.
Browse files Browse the repository at this point in the history
- Removed NonNull annotation.
- Updated the descriptions.

PiperOrigin-RevId: 321407014
  • Loading branch information
pekingme authored and hunterstich committed Jul 16, 2020
1 parent cc03196 commit 28177cb
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,13 @@ public DrawingDelegate getCurrentDrawingDelegate() {
: getProgressDrawable().getDrawingDelegate();
}

/** Blocks any attempts to set the progress drawable for this progress indicator. */
/** Sets a new progress drawable. It has to inherit from {@link DeterminateDrawable}.
*
* @param drawable The new progress drawable.
* @throws IllegalArgumentException if a framework drawable is passed in.
*/
@Override
public void setProgressDrawable(@NonNull Drawable drawable) {
public void setProgressDrawable(Drawable drawable) {
if (drawable == null || drawable instanceof DeterminateDrawable) {
super.setProgressDrawable(drawable);
// Every time ProgressBar sets progress drawable, it refreshes the drawable's level with
Expand All @@ -574,9 +578,13 @@ public void setProgressDrawable(@NonNull Drawable drawable) {
}
}

/** Blocks any attempts to set the indeterminate drawable for this progress indicator. */
/** Sets a new indeterminate drawable. It has to inherit from {@link IndeterminateDrawable}.
*
* @param drawable The new indeterminate drawable.
* @throws IllegalArgumentException if a framework drawable is passed in.
*/
@Override
public void setIndeterminateDrawable(@NonNull Drawable drawable) {
public void setIndeterminateDrawable(Drawable drawable) {
if (drawable == null || drawable instanceof IndeterminateDrawable) {
super.setIndeterminateDrawable(drawable);
} else {
Expand Down

0 comments on commit 28177cb

Please sign in to comment.