mirror of
https://github.com/SimpleMobileTools/Simple-Keyboard.git
synced 2025-06-05 21:49:26 +02:00
Add emoji key
This commit is contained in:
@ -12,7 +12,6 @@ import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.EditorInfo.IME_ACTION_NONE
|
||||
import androidx.annotation.XmlRes
|
||||
import com.simplemobiletools.keyboard.R
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Loads an XML description of a keyboard and stores the attributes of the keys. A keyboard consists of rows of keys.
|
||||
@ -61,6 +60,7 @@ class MyKeyboard {
|
||||
const val KEYCODE_ENTER = -4
|
||||
const val KEYCODE_DELETE = -5
|
||||
const val KEYCODE_SPACE = 32
|
||||
const val KEYCODE_EMOJI = -6
|
||||
|
||||
fun getDimensionOrFraction(a: TypedArray, index: Int, base: Int, defValue: Int): Int {
|
||||
val value = a.peekValue(index) ?: return defValue
|
||||
@ -203,7 +203,7 @@ class MyKeyboard {
|
||||
topSmallNumber = a.getString(R.styleable.MyKeyboard_Key_topSmallNumber) ?: ""
|
||||
|
||||
if (label.isNotEmpty() && code != KEYCODE_MODE_CHANGE && code != KEYCODE_SHIFT) {
|
||||
code = label[0].toInt()
|
||||
code = label[0].code
|
||||
}
|
||||
a.recycle()
|
||||
}
|
||||
@ -281,7 +281,7 @@ class MyKeyboard {
|
||||
key.x = x
|
||||
key.y = y
|
||||
key.label = character.toString()
|
||||
key.code = character.toInt()
|
||||
key.code = character.code
|
||||
column++
|
||||
x += key.width + key.gap
|
||||
mKeys!!.add(key)
|
||||
|
Reference in New Issue
Block a user