Skip to content

Commit

Permalink
[ProgressIndicator] Fixed NPE while setting progress in the indetermi…
Browse files Browse the repository at this point in the history
…nate mode after inflation.

PiperOrigin-RevId: 351656379
(cherry picked from commit 7a9e3f6)
  • Loading branch information
pekingme authored and ikim24 committed Jan 14, 2021
1 parent e9fcdf0 commit c78c1ef
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -721,9 +721,10 @@ public void setProgressCompat(int progress, boolean animated) {
storedProgressAnimated = animated;
isIndeterminateModeChangeRequested = true;

if (animatorDurationScaleProvider.getSystemAnimatorDurationScale(
getContext().getContentResolver())
== 0) {
if (!getIndeterminateDrawable().isVisible()
|| animatorDurationScaleProvider.getSystemAnimatorDurationScale(
getContext().getContentResolver())
== 0) {
switchIndeterminateModeCallback.onAnimationEnd(getIndeterminateDrawable());
} else {
getIndeterminateDrawable().getAnimatorDelegate().requestCancelAnimatorAfterCurrentCycle();
Expand Down

0 comments on commit c78c1ef

Please sign in to comment.