Skip to content

Commit 0a1e487

Browse files
authored
Merge pull request svga#22 from andyliumstar/master
SVGAParser unnecessary thread
2 parents b95b8d2 + 651b4da commit 0a1e487

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ class SVGAParser(private val context: Context) {
102102
fun parse(inputStream: InputStream, cacheKey: String, callback: ParseCompletion) {
103103
Thread({
104104
val videoItem = parse(inputStream, cacheKey)
105-
Thread({
106-
if (videoItem != null) {
105+
if (videoItem != null) {
107106
Handler(context.mainLooper).post {
108107
callback.onComplete(videoItem)
109108
}
@@ -113,7 +112,6 @@ class SVGAParser(private val context: Context) {
113112
callback.onError()
114113
}
115114
}
116-
}).start()
117115
}).start()
118116
}
119117

@@ -307,4 +305,4 @@ class SVGAParser(private val context: Context) {
307305
zipInputStream.close()
308306
}
309307

310-
}
308+
}

0 commit comments

Comments
 (0)