File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
library/src/main/java/com/opensource/svgaplayer Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import android.view.Choreographer
13
13
import android.view.ViewPropertyAnimator
14
14
import android.view.animation.LinearInterpolator
15
15
import android.widget.ImageView
16
+ import java.net.URL
16
17
17
18
/* *
18
19
* Created by cuiminghui on 2017/3/29.
@@ -100,6 +101,19 @@ open class SVGAImageView : ImageView {
100
101
typedArray.getString(R .styleable.SVGAImageView_source )?.let {
101
102
val parser = SVGAParser (context)
102
103
Thread ({
104
+ if (it.startsWith(" http://" ) || it.startsWith(" https://" )) {
105
+ URL (it)?.let {
106
+ parser.parse(it)?.let {
107
+ handler.post({
108
+ setVideoItem(it)
109
+ if (typedArray.getBoolean(R .styleable.SVGAImageView_autoPlay , true )) {
110
+ startAnimation()
111
+ }
112
+ })
113
+ }
114
+ return @Thread
115
+ }
116
+ }
103
117
parser.parse(it)?.let {
104
118
handler.post({
105
119
setVideoItem(it)
You can’t perform that action at this time.
0 commit comments