make SubtypeLocaleUtils less convoluted

still harder to understand than necessary...
This commit is contained in:
Helium314 2025-05-24 12:45:36 +02:00
parent 69540b8d9f
commit f72e8f41f4
5 changed files with 52 additions and 89 deletions

View file

@ -14,7 +14,7 @@ import android.view.MotionEvent
import helium314.keyboard.accessibility.AccessibilityLongPressTimer.LongPressTimerCallback
import helium314.keyboard.keyboard.*
import helium314.keyboard.latin.R
import helium314.keyboard.latin.utils.SubtypeLocaleUtils
import helium314.keyboard.latin.utils.SubtypeLocaleUtils.displayName
/**
* This class represents a delegate that can be registered in [MainKeyboardView] to enhance
@ -86,9 +86,7 @@ class MainKeyboardAccessibilityDelegate(
* @param keyboard The new keyboard.
*/
private fun announceKeyboardLanguage(keyboard: Keyboard) {
val languageText = SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(
keyboard.mId.mSubtype.rawSubtype)
sendWindowStateChanged(languageText)
sendWindowStateChanged(keyboard.mId.mSubtype.rawSubtype.displayName())
}
/**