shortening some code

This commit is contained in:
Tibor Kaputa 2023-06-10 09:15:11 +02:00 committed by GitHub
parent c2d17f5c3a
commit c17a79a7b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 27 deletions

View File

@ -230,33 +230,13 @@ class MyKeyboard {
*/
fun getContentDescription(context: Context): CharSequence {
return when (code) {
KEYCODE_SHIFT -> {
context.getString(R.string.keycode_shift)
}
KEYCODE_MODE_CHANGE -> {
context.getString(R.string.keycode_mode_change)
}
KEYCODE_ENTER -> {
context.getString(R.string.keycode_enter)
}
KEYCODE_DELETE -> {
context.getString(R.string.keycode_delete)
}
KEYCODE_SPACE -> {
context.getString(R.string.keycode_space)
}
KEYCODE_EMOJI -> {
context.getString(R.string.emojis)
}
else -> {
label
}
KEYCODE_SHIFT -> context.getString(R.string.keycode_shift)
KEYCODE_MODE_CHANGE -> context.getString(R.string.keycode_mode_change)
KEYCODE_ENTER -> context.getString(R.string.keycode_enter)
KEYCODE_DELETE -> context.getString(R.string.keycode_delete)
KEYCODE_SPACE -> context.getString(R.string.keycode_space)
KEYCODE_EMOJI -> context.getString(R.string.emojis)
else -> label
}
}