Skip to content

Commit bd56ee3

Browse files
committed
refactor: remove redundant parameters to show composition window
1 parent c436a2d commit bd56ee3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/src/main/java/com/osfans/trime/ime/core/TrimeInputMethodService.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,9 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
293293
commitTextByChar(checkNotNull(ShortcutUtils.pasteFromClipboard(this)).toString())
294294
}
295295

296-
private fun showCompositionView(isCandidate: Boolean) {
297-
if (Rime.compositionText.isEmpty() && isCandidate) {
298-
mCompositionPopupWindow!!.hideCompositionView()
296+
private fun showCompositionView() {
297+
if (Rime.compositionText.isEmpty()) {
298+
mCompositionPopupWindow?.hideCompositionView()
299299
return
300300
}
301301
mCompositionPopupWindow?.updateCompositionView()
@@ -375,8 +375,8 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
375375
}
376376

377377
override fun onUpdateCursorAnchorInfo(cursorAnchorInfo: CursorAnchorInfo) {
378-
mCompositionPopupWindow!!.updateCursorAnchorInfo(cursorAnchorInfo)
379-
showCompositionView(true)
378+
mCompositionPopupWindow?.updateCursorAnchorInfo(cursorAnchorInfo)
379+
showCompositionView()
380380
}
381381

382382
override fun onUpdateSelection(
@@ -1102,7 +1102,7 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
11021102
mCandidate!!.setText(startNum)
11031103
// if isCursorUpdated, showCompositionView will be called in onUpdateCursorAnchorInfo
11041104
// otherwise we need to call it here
1105-
if (!mCompositionPopupWindow!!.isCursorUpdated) showCompositionView(true)
1105+
if (!mCompositionPopupWindow!!.isCursorUpdated) showCompositionView()
11061106
} else {
11071107
mCandidate!!.setText(0)
11081108
}

0 commit comments

Comments
 (0)