|
36 | 36 |
|
37 | 37 | /** This class draws the graphics for a loading indicator. */ |
38 | 38 | public final class LoadingIndicatorDrawable extends Drawable implements Drawable.Callback { |
39 | | - AnimatorDurationScaleProvider animatorDurationScaleProvider; |
| 39 | + @NonNull AnimatorDurationScaleProvider animatorDurationScaleProvider; |
40 | 40 |
|
41 | 41 | @NonNull private final Context context; |
42 | 42 | @NonNull private final LoadingIndicatorSpec specs; |
@@ -73,7 +73,7 @@ public static LoadingIndicatorDrawable create( |
73 | 73 | this.specs = specs; |
74 | 74 | this.drawingDelegate = drawingDelegate; |
75 | 75 | this.animatorDelegate = animatorDelegate; |
76 | | - animatorDurationScaleProvider = new AnimatorDurationScaleProvider(); |
| 76 | + this.animatorDurationScaleProvider = new AnimatorDurationScaleProvider(); |
77 | 77 |
|
78 | 78 | this.paint = new Paint(); |
79 | 79 |
|
@@ -195,13 +195,9 @@ public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) { |
195 | 195 | // ******************* Utility functions ******************* |
196 | 196 |
|
197 | 197 | private boolean isSystemAnimatorDisabled() { |
198 | | - if (animatorDurationScaleProvider != null) { |
199 | | - float systemAnimatorDurationScale = |
200 | | - animatorDurationScaleProvider.getSystemAnimatorDurationScale( |
201 | | - context.getContentResolver()); |
202 | | - return systemAnimatorDurationScale == 0; |
203 | | - } |
204 | | - return false; |
| 198 | + float systemAnimatorDurationScale = |
| 199 | + animatorDurationScaleProvider.getSystemAnimatorDurationScale(context.getContentResolver()); |
| 200 | + return systemAnimatorDurationScale == 0; |
205 | 201 | } |
206 | 202 |
|
207 | 203 | // ******************* Setter and getter ******************* |
|
0 commit comments