Moved setKeyboardHolder before setKeyboard in order to properly manage toolbar visibility

This commit is contained in:
merkost 2023-06-17 10:02:02 +10:00
parent d8dead14ea
commit 409e3f4c35
2 changed files with 2 additions and 1 deletions

View File

@ -46,8 +46,8 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
override fun onCreateInputView(): View { override fun onCreateInputView(): View {
val keyboardHolder = layoutInflater.inflate(R.layout.keyboard_view_keyboard, null) val keyboardHolder = layoutInflater.inflate(R.layout.keyboard_view_keyboard, null)
keyboardView = keyboardHolder.keyboard_view as MyKeyboardView keyboardView = keyboardHolder.keyboard_view as MyKeyboardView
keyboardView!!.setKeyboard(keyboard!!)
keyboardView!!.setKeyboardHolder(keyboardHolder.keyboard_holder) keyboardView!!.setKeyboardHolder(keyboardHolder.keyboard_holder)
keyboardView!!.setKeyboard(keyboard!!)
keyboardView!!.setEditorInfo(currentInputEditorInfo) keyboardView!!.setEditorInfo(currentInputEditorInfo)
keyboardView!!.mOnKeyboardActionListener = this keyboardView!!.mOnKeyboardActionListener = this
return keyboardHolder!! return keyboardHolder!!

View File

@ -269,6 +269,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
invalidateAllKeys() invalidateAllKeys()
computeProximityThreshold(keyboard) computeProximityThreshold(keyboard)
mMiniKeyboardCache.clear() mMiniKeyboardCache.clear()
mToolbarHolder?.beInvisibleIf(context.isDeviceLocked)
accessHelper = AccessHelper(this, mKeyboard?.mKeys.orEmpty()) accessHelper = AccessHelper(this, mKeyboard?.mKeys.orEmpty())
ViewCompat.setAccessibilityDelegate(this, accessHelper) ViewCompat.setAccessibilityDelegate(this, accessHelper)