From 429c67afd5df2815c134aa5b0ab6f184346310f6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 21 Jan 2022 23:56:54 +0100 Subject: [PATCH] lets actually allow pressing the empty space near "A" and "L" --- .../com/simplemobiletools/keyboard/views/MyKeyboardView.kt | 6 +++--- app/src/main/res/xml/keys_letters.xml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index 764554b..3a82196 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -426,7 +426,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut keyBackground.draw(canvas) if (label?.isNotEmpty() == true) { // 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.typeface = Typeface.DEFAULT_BOLD } else { @@ -451,7 +451,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut // Turn off drop shadow paint.setShadowLayer(0f, 0f, 0f, 0) } 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) { SHIFT_OFF -> R.drawable.ic_caps_outline_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) { // Find insertion point - val nCodes = key.codes.size + val nCodes = 1 if (dist < closestKeyDist) { closestKeyDist = dist closestKey = nearestKeyIndices[i] diff --git a/app/src/main/res/xml/keys_letters.xml b/app/src/main/res/xml/keys_letters.xml index 425ee71..6ca2615 100644 --- a/app/src/main/res/xml/keys_letters.xml +++ b/app/src/main/res/xml/keys_letters.xml @@ -68,6 +68,7 @@ @@ -98,6 +99,7 @@ app:keyLabel="k" />