File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
app/src/main/java/org/fcitx/fcitx5/android/input Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import androidx.annotation.RequiresApi
16
16
import androidx.constraintlayout.widget.ConstraintLayout
17
17
import androidx.core.view.*
18
18
import androidx.lifecycle.lifecycleScope
19
+ import kotlinx.coroutines.Job
19
20
import kotlinx.coroutines.launch
20
21
import org.fcitx.fcitx5.android.R
21
22
import org.fcitx.fcitx5.android.core.CapabilityFlags
@@ -83,11 +84,7 @@ class InputView(
83
84
setOnClickListener(placeholderOnClickListener)
84
85
}
85
86
86
- private val eventHandlerJob = service.lifecycleScope.launch {
87
- fcitx.runImmediately { eventFlow }.collect {
88
- handleFcitxEvent(it)
89
- }
90
- }
87
+ private val eventHandlerJob: Job
91
88
92
89
private val scope = DynamicScope ()
93
90
private val themedContext = context.withTheme(R .style.Theme_InputViewTheme )
@@ -183,6 +180,12 @@ class InputView(
183
180
// MUST call before any operation
184
181
setupScope()
185
182
183
+ eventHandlerJob = service.lifecycleScope.launch {
184
+ fcitx.runImmediately { eventFlow }.collect {
185
+ handleFcitxEvent(it)
186
+ }
187
+ }
188
+
186
189
// restore punctuation mapping in case of InputView recreation
187
190
fcitx.launchOnReady {
188
191
punctuation.updatePunctuationMapping(it.statusAreaActionsCached)
You can’t perform that action at this time.
0 commit comments