File tree 1 file changed +16
-12
lines changed
app/src/main/kotlin/org/ninetripods/mq/study/chatgpt/viewholder
1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import org.ninetripods.mq.study.R
6
6
import org.ninetripods.mq.study.base.adapter.BaseVHolder
7
7
import org.ninetripods.mq.study.chatgpt.MessageModel
8
8
import org.ninetripods.mq.study.chatgpt.widget.ChatAutoFillView
9
+ import org.ninetripods.mq.study.chatgpt.widget.SegModel
9
10
import org.ninetripods.mq.study.kotlin.ktx.log
10
11
11
12
/* *
@@ -22,17 +23,20 @@ class ChatReplyTxHolder(
22
23
23
24
override fun onBindView (item : MessageModel , position : Int ) {
24
25
log(" position:$position , item:${item.content} " )
25
- // TODO 打字机效果待优化
26
- // answerText.setEndCallback {
27
- // isDrawEnd = true
28
- // }
29
- // answerText.reset()
30
- // answerText.fillText(
31
- // income = SegModel(item.content, true),
32
- // autoFillAnim = item.autoFillAnim && !isDrawEnd,
33
- // type = ChatAutoFillView.TYPE_MARKDOWN
34
- // )
35
- answerText.stop()
36
- answerText.text = item.content
26
+ // TODO 打字机效果待优化 如打字机效果正在展示时,此时进行上下滑动
27
+ if (isDrawEnd) {
28
+ answerText.stop()
29
+ answerText.text = item.content
30
+ } else {
31
+ answerText.setEndCallback {
32
+ isDrawEnd = true
33
+ }
34
+ answerText.reset()
35
+ answerText.fillText(
36
+ income = SegModel (item.content, true ),
37
+ autoFillAnim = item.autoFillAnim && ! isDrawEnd,
38
+ type = ChatAutoFillView .TYPE_MARKDOWN
39
+ )
40
+ }
37
41
}
38
42
}
You can’t perform that action at this time.
0 commit comments