File tree 1 file changed +3
-3
lines changed
loadingview/src/main/java/com/mmdev/loadingviewlib
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ class LoadingView @JvmOverloads constructor(
89
89
private val animatorSet = AnimatorSet ()
90
90
91
91
// rotating whole view
92
- private val viewRotateAnimator = ValueAnimator .ofFloat(0f , 360f ).apply {
92
+ private fun viewRotateAnimator () = ValueAnimator .ofFloat(0f , 360f ).apply {
93
93
duration = 1600
94
94
interpolator = LinearInterpolator ()
95
95
repeatCount = ValueAnimator .INFINITE
@@ -98,7 +98,7 @@ class LoadingView @JvmOverloads constructor(
98
98
}
99
99
100
100
// animate 3 sweeps inside view
101
- private val angleAnimator = ValueAnimator .ofFloat(5f , 105f ).apply {
101
+ private fun angleAnimator () = ValueAnimator .ofFloat(5f , 105f ).apply {
102
102
duration = 800
103
103
// god given custom interpolator
104
104
interpolator = PathInterpolatorCompat .create(1f , 0f , 0f , 1f )
@@ -167,7 +167,7 @@ class LoadingView @JvmOverloads constructor(
167
167
// auto start animation on pre-draw stage
168
168
// no need to toggle
169
169
animatorSet.cancel()
170
- animatorSet.playTogether(angleAnimator, viewRotateAnimator)
170
+ animatorSet.playTogether(angleAnimator() , viewRotateAnimator() )
171
171
animatorSet.start()
172
172
}
173
173
You can’t perform that action at this time.
0 commit comments