Skip to content

Commit 2e1328c

Browse files
committed
refactor: remove unused override onWindowShown/Hidden in TrimeInputMethodService
1 parent e512068 commit 2e1328c

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

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

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ import kotlinx.coroutines.Job
6666
import kotlinx.coroutines.channels.Channel
6767
import kotlinx.coroutines.channels.consumeEach
6868
import kotlinx.coroutines.launch
69-
import kotlinx.coroutines.withContext
7069
import splitties.bitflags.hasFlag
7170
import splitties.systemservices.inputMethodManager
7271
import splitties.views.gravityBottom
@@ -85,7 +84,6 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
8584
var inputView: InputView? = null
8685
private var initializationUi: InitializationUi? = null
8786
private var mIntentReceiver: IntentReceiver? = null
88-
private var isWindowShown = false // 键盘窗口是否已显示
8987
private var isComposable: Boolean = false
9088
private val locales = Array(2) { Locale.getDefault() }
9189

@@ -124,35 +122,6 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
124122
*/
125123
fun postRimeJob(block: suspend RimeApi.() -> Unit) = postJob(rime.lifecycleScope) { rime.runOnReady(block) }
126124

127-
override fun onWindowShown() {
128-
super.onWindowShown()
129-
if (isWindowShown) {
130-
Timber.i("Ignoring (is already shown)")
131-
return
132-
} else {
133-
Timber.i("onWindowShown...")
134-
}
135-
postRimeJob {
136-
if (currentInputEditorInfo != null) {
137-
isWindowShown = true
138-
withContext(Dispatchers.Main) {
139-
updateComposing()
140-
}
141-
}
142-
}
143-
}
144-
145-
override fun onWindowHidden() {
146-
super.onWindowHidden()
147-
if (!isWindowShown) {
148-
Timber.d("Ignoring (window is already hidden)")
149-
return
150-
} else {
151-
Timber.d("onWindowHidden")
152-
}
153-
isWindowShown = false
154-
}
155-
156125
private suspend fun updateRimeOption(api: RimeApi) {
157126
try {
158127
api.setRuntimeOption("soft_cursor", prefs.keyboard.softCursorEnabled) // 軟光標

0 commit comments

Comments
 (0)