Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
修复光标滞后(#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
tangshimin committed Jan 18, 2023
1 parent 12e2c6b commit 6f71a13
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/main/kotlin/ui/Search.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ fun Search(
val familiarVocabulary = remember{ loadMutableVocabularyByName("FamiliarVocabulary") }

val search:(String) -> Unit = {
scope.launch {
input = it
if(searchResult != null) {
searchResult!!.value = ""
Expand Down Expand Up @@ -129,7 +128,6 @@ fun Search(
}
}

}
}
Surface(
elevation = 5.dp,
Expand Down
2 changes: 0 additions & 2 deletions src/main/kotlin/ui/TypingSubtitles.kt
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ fun TypingSubtitles(
}
/** 检查输入的回调函数 */
val checkTyping: (String) -> Unit = { input ->
scope.launch {
if (textFieldValue.length > captionContent.length) {
typingResult.clear()
textFieldValue = ""
Expand Down Expand Up @@ -630,7 +629,6 @@ fun TypingSubtitles(
}

}
}
}

val textFieldKeyEvent: (KeyEvent) -> Boolean = { it: KeyEvent ->
Expand Down
2 changes: 0 additions & 2 deletions src/main/kotlin/ui/TypingText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ fun TypingText(
}
/** 检查输入的回调函数 */
val checkTyping: (String) -> Unit = { input ->
scope.launch {
if (input.length > line.length) {
if(nextRowFull){
nextRowFull = false
Expand Down Expand Up @@ -361,7 +360,6 @@ fun TypingText(
}

}
}
}

val textFieldKeyEvent: (KeyEvent) -> Boolean = { it: KeyEvent ->
Expand Down
2 changes: 0 additions & 2 deletions src/main/kotlin/ui/TypingWord.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1961,9 +1961,7 @@ fun Caption(
BasicTextField(
value = textFieldValue,
onValueChange = { input ->
scope.launch {
checkTyping(index, input, captionContent)
}
},
singleLine = true,
cursorBrush = SolidColor(MaterialTheme.colors.primary),
Expand Down
2 changes: 0 additions & 2 deletions src/main/kotlin/ui/Word.kt
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ fun Word(
BasicTextField(
value = textFieldValue,
onValueChange = { input ->
scope.launch {
checkTyping(input)
}
},
singleLine = true,
cursorBrush = SolidColor(MaterialTheme.colors.primary),
Expand Down

0 comments on commit 6f71a13

Please sign in to comment.