Skip to content

Commit 92fd2eb

Browse files
committed
fix: _hide_candidate didn't actually hide candidate bar
feat: add `_hide_bar`, which playing the same role of `_hide_candidate`
1 parent 6e4fdee commit 92fd2eb

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ class InputView(
220220
"_hide_comment" -> {
221221
quickBar.oldCandidateBar.candidates.setShowComment(!it.value)
222222
}
223-
"_hide_candidate" -> {
224-
quickBar.oldCandidateBar.root.visibility =
223+
"_hide_bar",
224+
"_hide_candidate",
225+
-> {
226+
quickBar.view.visibility =
225227
if (it.value) View.GONE else View.VISIBLE
226228
}
227229
"_hide_key_hint" -> keyboardWindow.oldMainInputView.mainKeyboardView.setShowHint(!it.value)

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,12 @@ open class Trime : LifecycleInputMethodService() {
368368
if (mCandidateRoot != null) {
369369
loadBackground(true)
370370
setShowComment(!Rime.getOption("_hide_comment"))
371-
mCandidateRoot!!.visibility = if (!Rime.getOption("_hide_candidate")) View.VISIBLE else View.GONE
371+
inputView?.quickBar?.view?.visibility =
372+
if (!Rime.getOption("_hide_candidate") || !Rime.getOption("_hide_bar")) {
373+
View.VISIBLE
374+
} else {
375+
View.GONE
376+
}
372377
mCandidate!!.reset()
373378
mCompositionPopupWindow!!.isPopupWindowEnabled = (
374379
prefs.keyboard.popupWindowEnabled &&

app/src/main/java/com/osfans/trime/ime/text/TextInputManager.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ class TextInputManager private constructor() :
232232
trime.inputFeedbackManager?.ttsLanguage =
233233
locales[if (value) 1 else 0]
234234
}
235-
"_hide_candidate" -> {
235+
"_hide_bar",
236+
"_hide_candidate",
237+
-> {
236238
trime.setCandidatesViewShown(isComposable && !value)
237239
}
238240
"_liquid_keyboard" -> trime.selectLiquidKeyboard(0)

0 commit comments

Comments
 (0)