Skip to content

Commit ce97ef1

Browse files
review code 移除注释
1 parent ecbd9b5 commit ce97ef1

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

library/src/main/java/com/opensource/svgaplayer/SVGAImageView.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ open class SVGAImageView @JvmOverloads constructor(context: Context, attrs: Attr
142142
drawable.cleared = false
143143
drawable.scaleType = scaleType
144144
drawable.videoItem.init(width, height)
145-
Log.d("SVGAImageView", "height:$height width:$width")
146145
}
147146

148147
private fun getSVGADrawable(): SVGADrawable? {
@@ -189,14 +188,12 @@ open class SVGAImageView @JvmOverloads constructor(context: Context, attrs: Attr
189188
callback?.onFinished()
190189
// 不是循环播放时,手动停止一下
191190
if ((animation as ValueAnimator).repeatCount <= 0) {
192-
Log.d("## onAnimationEnd", "onFinished")
193191
// 要根据用户设置的 clearsAfterStop 状态判断,不可手动置 true
194192
stopAnimation()
195193
}
196194
}
197195

198196
fun pauseAnimation() {
199-
Log.d("## pauseAnimation", "")
200197
stopAnimation(false)
201198
callback?.onPause()
202199
}
@@ -206,8 +203,6 @@ open class SVGAImageView @JvmOverloads constructor(context: Context, attrs: Attr
206203
}
207204

208205
fun stopAnimation(clear: Boolean) {
209-
Log.d("## stopAnimation", "cancel")
210-
211206
mAnimator?.cancel()
212207
mAnimator?.removeAllListeners()
213208
mAnimator?.removeAllUpdateListeners()
@@ -288,21 +283,17 @@ open class SVGAImageView @JvmOverloads constructor(context: Context, attrs: Attr
288283

289284
override fun onAnimationRepeat(animation: Animator?) {
290285
weakReference.get()?.callback?.onRepeat()
291-
Log.d("## onAnimationRepeat", (animation as ValueAnimator).repeatCount.toString())
292286
}
293287

294288
override fun onAnimationEnd(animation: Animator?) {
295-
Log.d("## onAnimationEnd", (animation as ValueAnimator).repeatCount.toString())
296289
weakReference.get()?.onAnimationEnd(animation)
297290
}
298291

299292
override fun onAnimationCancel(animation: Animator?) {
300-
Log.d("## onAnimationCancel", (animation as ValueAnimator).duration.toString())
301293
weakReference.get()?.isAnimating = false
302294
}
303295

304296
override fun onAnimationStart(animation: Animator?) {
305-
Log.d("## onAnimationStart", (animation as ValueAnimator).duration.toString())
306297
weakReference.get()?.isAnimating = true
307298
}
308299
} // end of AnimatorListener
@@ -312,8 +303,6 @@ open class SVGAImageView @JvmOverloads constructor(context: Context, attrs: Attr
312303
private val weakReference = WeakReference<SVGAImageView>(view)
313304

314305
override fun onAnimationUpdate(animation: ValueAnimator?) {
315-
Log.d("## onAnimationUpdate", (animation as ValueAnimator).repeatCount.toString())
316-
317306
weakReference.get()?.onAnimatorUpdate(animation)
318307
}
319308
} // end of AnimatorUpdateListener

library/src/main/java/com/opensource/svgaplayer/SVGAParser.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class SVGAParser(context: Context?) {
8585
var fileDownloader = FileDownloader()
8686

8787
companion object {
88-
internal var threadPoolExecutor = Executors.newSingleThreadExecutor()
88+
internal var threadPoolExecutor = Executors.newCachedThreadPool()
8989

9090
fun setThreadPoolExecutor(executor: ThreadPoolExecutor) {
9191
threadPoolExecutor = executor

0 commit comments

Comments
 (0)