Skip to content

Commit 68552dc

Browse files
committed
bugfix: animator leaks.
1 parent ba6eed6 commit 68552dc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ open class SVGAImageView : ImageView {
176176
}
177177

178178
fun startAnimation(range: SVGARange?, reverse: Boolean = false) {
179+
animator?.cancel()
179180
val drawable = drawable as? SVGADrawable ?: return
180181
drawable.cleared = false
181182
drawable.scaleType = scaleType

readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ If you want to run Sample Project on Android Studio 2.3.2, Download this [commit
1414

1515
## Version
1616

17+
### NEXT
18+
19+
Bugfix: SVGAImageView may leaks while startAnimation call multiple times. Thanks @andyliumstar
20+
Feature: Add range mode and reverse mode.
21+
1722
### 2.0.3
1823

1924
Improve: SVGAPath parsing faster then before.

0 commit comments

Comments
 (0)