File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
lib/java/com/google/android/material/progressindicator Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -451,15 +451,18 @@ float getPhaseFraction() {
451451 if (mockPhaseFraction > 0 ) {
452452 return mockPhaseFraction ;
453453 }
454+
454455 float phaseFraction = 0f ;
455- if (baseSpec .speed != 0 ) {
456+ if (baseSpec .hasWavyEffect () && baseSpec . speed != 0 ) {
456457 float durationScale =
457458 animatorDurationScaleProvider .getSystemAnimatorDurationScale (
458459 context .getContentResolver ());
459- int cycleInMs = (int ) (1000f * baseSpec .wavelength / baseSpec .speed * durationScale );
460- phaseFraction = (float ) (System .currentTimeMillis () % cycleInMs ) / cycleInMs ;
461- if (phaseFraction < 0f ) {
462- phaseFraction = (phaseFraction % 1 ) + 1f ;
460+ if (durationScale > 0f ) {
461+ int cycleInMs = (int ) (1000f * baseSpec .wavelength / baseSpec .speed * durationScale );
462+ phaseFraction = (float ) (System .currentTimeMillis () % cycleInMs ) / cycleInMs ;
463+ if (phaseFraction < 0f ) {
464+ phaseFraction = (phaseFraction % 1 ) + 1f ;
465+ }
463466 }
464467 }
465468 return phaseFraction ;
You can’t perform that action at this time.
0 commit comments