allow selecting more icons in custom keys, update layouts.md

This commit is contained in:
Helium314 2024-05-12 00:20:56 +02:00
parent 38228f8b70
commit 8f3e4fff8c
4 changed files with 29 additions and 5 deletions

View file

@ -10,6 +10,7 @@ import android.widget.ImageView
import androidx.appcompat.view.ContextThemeWrapper
import androidx.core.content.edit
import helium314.keyboard.keyboard.KeyboardTheme
import helium314.keyboard.keyboard.internal.KeyboardIconsSet
import helium314.keyboard.keyboard.internal.keyboard_parser.floris.KeyCode
import helium314.keyboard.latin.R
import helium314.keyboard.latin.settings.Settings
@ -73,6 +74,7 @@ fun getCodeForToolbarKeyLongClick(key: ToolbarKey) = when (key) {
else -> KeyCode.UNSPECIFIED
}
// todo: get the icons from KeyboardIconsSet (but currently it's loaded too late)
private fun getStyleableIconId(key: ToolbarKey) = when (key) {
VOICE -> R.styleable.Keyboard_iconShortcutKey
SETTINGS -> R.styleable.Keyboard_iconSettingsKey