update key labels

remove emoji label, not necessary any more as it's a toolbar key
access toolbar labels via enum map
allow CLIPBOARD_CUT key(code)
This commit is contained in:
Helium314 2024-06-14 17:44:32 +02:00
parent 61cff40d3c
commit 3eafce9265
5 changed files with 16 additions and 12 deletions

View file

@ -14,6 +14,7 @@ import helium314.keyboard.keyboard.internal.keyboard_parser.floris.KeyCode
import helium314.keyboard.latin.R
import helium314.keyboard.latin.settings.Settings
import helium314.keyboard.latin.utils.ToolbarKey.*
import java.util.EnumMap
import java.util.Locale
fun createToolbarKey(context: Context, keyboardAttr: TypedArray, key: ToolbarKey): ImageButton {
@ -114,7 +115,7 @@ enum class ToolbarKey {
FULL_LEFT, FULL_RIGHT, INCOGNITO, AUTOCORRECT, CLEAR_CLIPBOARD, CLOSE_HISTORY, EMOJI
}
val toolbarKeyStrings: Set<String> = entries.mapTo(HashSet()) { it.toString().lowercase(Locale.US) }
val toolbarKeyStrings = entries.associateWithTo(EnumMap(ToolbarKey::class.java)) { it.toString().lowercase(Locale.US) }
val defaultToolbarPref = entries.filterNot { it == CLOSE_HISTORY }.joinToString(";") {
when (it) {