Skip to content

Commit

Permalink
refactor: hide composition view on input view detached from window
Browse files Browse the repository at this point in the history
This is the more accurate time to do so.
  • Loading branch information
WhiredPlanck committed Jul 22, 2024
1 parent 34b59c4 commit 0555fe2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/java/com/osfans/trime/ime/core/InputView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ class InputView(
override fun onDetachedFromWindow() {
ViewCompat.setOnApplyWindowInsetsListener(this, null)
showingDialog?.dismiss()
composition.hideCompositionView()
// cancel the notification job and clear all broadcast receivers,
// implies that InputView should not be attached again after detached.
notificationHandlerJob.cancel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
*
* 重置鍵盤、候選條、狀態欄等 !!注意,如果其中調用Rime.setOption,切換方案會卡住 */
fun recreateInputView() {
inputView?.composition?.hideCompositionView()
inputView = InputView(this, rime)
mainKeyboardView = inputView!!.keyboardWindow.oldMainInputView.mainKeyboardView

Expand Down

0 comments on commit 0555fe2

Please sign in to comment.