Skip to content

Commit

Permalink
fix: main keyboard view would disappear after switching schema
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Nov 3, 2024
1 parent 28fa4c0 commit 951b441
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,6 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {

private fun handleRimeCallback(it: RimeCallback) {
when (it) {
is RimeNotification.SchemaNotification -> {
recreateInputView(ThemeManager.activeTheme)
}

is RimeNotification.OptionNotification -> {
val value = it.value.value
when (val option = it.value.option) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.core.content.ContextCompat
import com.osfans.trime.R
import com.osfans.trime.core.Rime
import com.osfans.trime.core.RimeNotification.OptionNotification
import com.osfans.trime.core.SchemaItem
import com.osfans.trime.daemon.RimeSession
import com.osfans.trime.data.prefs.AppPrefs
import com.osfans.trime.data.schema.SchemaManager
Expand Down Expand Up @@ -234,6 +235,10 @@ class KeyboardWindow(
dispatchCapsState(mainKeyboardView::setShifted)
}

override fun onRimeSchemaUpdated(schema: SchemaItem) {
switchKeyboard(smartMatchKeyboard())
}

override fun onRimeOptionUpdated(value: OptionNotification.Value) {
when (val opt = value.option) {
"ascii_mode" -> currentKeyboard?.currentAsciiMode = value.value
Expand Down

0 comments on commit 951b441

Please sign in to comment.