Skip to content

Commit 7616a13

Browse files
committed
docs: 文档内容补充
1 parent d97916c commit 7616a13

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

readme.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,26 +99,25 @@ Defaults to `0`.
9999

100100
How many times should animation loops. `0` means Infinity Loop.
101101

102-
#### clearsAfterStop: Boolean
102+
#### ~~clearsAfterStop: Boolean~~
103103

104-
Defaults to `true`.
105-
106-
Clears canvas after animation stop.
104+
Defaults to `true`.When the animation is finished, whether to clear the canvas and the internal data of SVGAVideoEntity.
105+
It is no longer recommended. Developers can control resource release through clearAfterDetached, or manually control resource release through SVGAVideoEntity#clear
107106

108107
#### clearsAfterDetached: Boolean
109108

110-
Defaults to `true`.
111-
112-
Clears canvas after SVGAImageView detached.
109+
Defaults to `false`.Clears canvas and the internal data of SVGAVideoEntity after SVGAImageView detached.
113110

114111
#### fillMode: String
115112

116-
Defaults to `Forward`. Could be `Forward`, `Backward`.
113+
Defaults to `Forward`. Could be `Forward`, `Backward`, `Clear`.
117114

118115
`Forward` means animation will pause on last frame after finished.
119116

120117
`Backward` means animation will pause on first frame after finished.
121118

119+
'Clear' after the animation is played, all the canvas content is cleared, but it is only the canvas and does not involve the internal data of SVGAVideoEntity.
120+
122121
### Using code
123122

124123
You may use code to add `SVGAImageView` either.

readme.zh.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,23 @@ SVGAPlayer 可以从本地 `assets` 目录,或者远端服务器上加载动
8686
#### loopCount: Int
8787
默认为 `0`,设置动画的循环次数,0 表示无限循环。
8888

89-
#### clearsAfterStop: Boolean
90-
默认为 `true`,当动画播放完成后,是否清空画布。
89+
#### ~~clearsAfterStop: Boolean~~
90+
默认为 `true`,当动画播放完成后,是否清空画布,以及 SVGAVideoEntity 内部数据。
91+
不再推荐使用,开发者可以通过 clearAfterDetached 控制资源释放,或者手动通过 SVGAVideoEntity#clear 控制资源释放
9192

9293
#### clearsAfterDetached: Boolean
93-
默认为 `true`,当 SVGAImageView 触发 onDetachedFromWindow 方法时,是否清空画布。
94+
默认为 `false`,当 SVGAImageView 触发 onDetachedFromWindow 方法时,是否清空画布。
9495

9596
#### fillMode: String
9697

97-
默认为 `Forward`,可以是 `Forward``Backward`
98+
默认为 `Forward`,可以是 `Forward``Backward``Clear`
9899

99100
`Forward` 表示动画结束后,将停留在最后一帧。
100101

101102
`Backward` 表示动画结束后,将停留在第一帧。
102103

104+
`Clear` 表示动画播放完后,清空所有画布内容,但仅仅是画布,不涉及 SVGAVideoEntity 内部数据。
105+
103106
### 使用代码
104107

105108
也可以使用代码添加 `SVGAImageView`

0 commit comments

Comments
 (0)