adding the alternative symbol keyboards

This commit is contained in:
tibbi
2022-01-15 21:02:38 +01:00
parent 8ce069ca3b
commit 9dc7abaaa7
6 changed files with 278 additions and 5 deletions

View File

@ -312,7 +312,7 @@ class MyKeyboard {
text = a.getText(R.styleable.MyKeyboard_Key_keyOutputText)
topSmallNumber = a.getString(R.styleable.MyKeyboard_Key_topSmallNumber) ?: ""
if (label.isNotEmpty()) {
if (label.isNotEmpty() && codes.firstOrNull() != KEYCODE_MODE_CHANGE) {
codes = arrayListOf(label[0].toInt())
}
a.recycle()

View File

@ -22,7 +22,7 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL
override fun onCreateInputView(): View {
keyboardView = layoutInflater.inflate(R.layout.keyboard_view_keyboard, null) as MyKeyboardView
keyboard = MyKeyboard(this, R.xml.keys_layout)
keyboard = MyKeyboard(this, R.xml.keys_letters)
keyboardView!!.setKeyboard(keyboard!!)
keyboardView!!.onKeyboardActionListener = this
return keyboardView!!
@ -66,6 +66,7 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL
keyboardView!!.invalidateAllKeys()
}
MyKeyboard.KEYCODE_DONE -> inputConnection.sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER))
MyKeyboard.KEYCODE_MODE_CHANGE -> {}
else -> {
var code = primaryCode.toChar()
if (Character.isLetter(code) && keyboard!!.shiftState > SHIFT_OFF) {

View File

@ -879,7 +879,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
mPopupPreviewY += popupHeight
}
if (key.label.isNotEmpty()) {
if (key.label.isNotEmpty() && key.codes.firstOrNull() != KEYCODE_MODE_CHANGE) {
if (previewPopup.isShowing) {
previewPopup.update(mPopupPreviewX, mPopupPreviewY, popupWidth, popupHeight)
} else {