lets actually allow pressing the empty space near "A" and "L"
This commit is contained in:
parent
7a75d2a46b
commit
429c67afd5
|
@ -426,7 +426,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
|
||||||
keyBackground.draw(canvas)
|
keyBackground.draw(canvas)
|
||||||
if (label?.isNotEmpty() == true) {
|
if (label?.isNotEmpty() == true) {
|
||||||
// For characters, use large font. For labels like "Done", use small font.
|
// For characters, use large font. For labels like "Done", use small font.
|
||||||
if (label.length > 1 && key.codes.size < 2) {
|
if (label.length > 1) {
|
||||||
paint.textSize = mLabelTextSize.toFloat()
|
paint.textSize = mLabelTextSize.toFloat()
|
||||||
paint.typeface = Typeface.DEFAULT_BOLD
|
paint.typeface = Typeface.DEFAULT_BOLD
|
||||||
} else {
|
} else {
|
||||||
|
@ -451,7 +451,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
|
||||||
// Turn off drop shadow
|
// Turn off drop shadow
|
||||||
paint.setShadowLayer(0f, 0f, 0f, 0)
|
paint.setShadowLayer(0f, 0f, 0f, 0)
|
||||||
} else if (key.icon != null && mKeyboard != null) {
|
} else if (key.icon != null && mKeyboard != null) {
|
||||||
if (key.codes.size == 1 && key.codes.contains(-1)) {
|
if (key.codes.contains(-1)) {
|
||||||
val drawableId = when (mKeyboard!!.mShiftState) {
|
val drawableId = when (mKeyboard!!.mShiftState) {
|
||||||
SHIFT_OFF -> R.drawable.ic_caps_outline_vector
|
SHIFT_OFF -> R.drawable.ic_caps_outline_vector
|
||||||
SHIFT_ON_ONE_CHAR -> R.drawable.ic_caps_vector
|
SHIFT_ON_ONE_CHAR -> R.drawable.ic_caps_vector
|
||||||
|
@ -506,7 +506,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
|
||||||
|
|
||||||
if (isInside && key.codes[0] > MyKeyboard.KEYCODE_SPACE) {
|
if (isInside && key.codes[0] > MyKeyboard.KEYCODE_SPACE) {
|
||||||
// Find insertion point
|
// Find insertion point
|
||||||
val nCodes = key.codes.size
|
val nCodes = 1
|
||||||
if (dist < closestKeyDist) {
|
if (dist < closestKeyDist) {
|
||||||
closestKeyDist = dist
|
closestKeyDist = dist
|
||||||
closestKey = nearestKeyIndices[i]
|
closestKey = nearestKeyIndices[i]
|
||||||
|
|
|
@ -68,6 +68,7 @@
|
||||||
<Key
|
<Key
|
||||||
app:codes="97"
|
app:codes="97"
|
||||||
app:horizontalGap="5%"
|
app:horizontalGap="5%"
|
||||||
|
app:keyEdgeFlags="left"
|
||||||
app:keyLabel="a"
|
app:keyLabel="a"
|
||||||
app:popupCharacters="á"
|
app:popupCharacters="á"
|
||||||
app:popupKeyboard="@xml/keyboard_popup_template" />
|
app:popupKeyboard="@xml/keyboard_popup_template" />
|
||||||
|
@ -98,6 +99,7 @@
|
||||||
app:keyLabel="k" />
|
app:keyLabel="k" />
|
||||||
<Key
|
<Key
|
||||||
app:codes="108"
|
app:codes="108"
|
||||||
|
app:keyEdgeFlags="right"
|
||||||
app:keyLabel="l"
|
app:keyLabel="l"
|
||||||
app:popupCharacters="ĺľ"
|
app:popupCharacters="ĺľ"
|
||||||
app:popupKeyboard="@xml/keyboard_popup_template" />
|
app:popupKeyboard="@xml/keyboard_popup_template" />
|
||||||
|
|
Loading…
Reference in New Issue