mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-14 05:52:47 +00:00
add another option to the "more letters with diacritics" settings
with letters that used to be default in many languages now this setting is default
This commit is contained in:
parent
d7d47670a7
commit
5378d8d0a3
9 changed files with 14 additions and 15 deletions
|
@ -239,9 +239,11 @@ fun addLocaleKeyTextsToParams(context: Context, params: KeyboardParams, popupKey
|
|||
private fun createLocaleKeyTexts(context: Context, params: KeyboardParams, popupKeysSetting: Int): LocaleKeyboardInfos {
|
||||
val lkt = LocaleKeyboardInfos(getStreamForLocale(params.mId.locale, context), params.mId.locale)
|
||||
if (popupKeysSetting == POPUP_KEYS_MORE)
|
||||
lkt.addFile(context.assets.open("$LOCALE_TEXTS_FOLDER/all_popup_keys.txt"))
|
||||
lkt.addFile(context.assets.open("$LOCALE_TEXTS_FOLDER/more_popups_more.txt"))
|
||||
else if (popupKeysSetting == POPUP_KEYS_ALL)
|
||||
lkt.addFile(context.assets.open("$LOCALE_TEXTS_FOLDER/more_popup_keys.txt"))
|
||||
lkt.addFile(context.assets.open("$LOCALE_TEXTS_FOLDER/more_popups_all.txt"))
|
||||
else if (popupKeysSetting == POPUP_KEYS_MAIN)
|
||||
lkt.addFile(context.assets.open("$LOCALE_TEXTS_FOLDER/more_popups_main.txt"))
|
||||
params.mSecondaryLocales.forEach { locale ->
|
||||
if (locale == params.mId.locale) return@forEach
|
||||
lkt.addFile(getStreamForLocale(locale, context))
|
||||
|
@ -339,6 +341,7 @@ private val euroLocales = "bg|ca|cs|da|de|el|en|es|et|eu|fi|fr|ga|gl|hr|hu|it|lb
|
|||
|
||||
const val POPUP_KEYS_ALL = 2
|
||||
const val POPUP_KEYS_MORE = 1
|
||||
const val POPUP_KEYS_MAIN = 3
|
||||
const val POPUP_KEYS_NORMAL = 0
|
||||
|
||||
private const val LOCALE_TEXTS_FOLDER = "locale_key_texts"
|
||||
|
|
|
@ -507,10 +507,11 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
|
|||
}
|
||||
|
||||
public static int readMorePopupKeysPref(final SharedPreferences prefs) {
|
||||
return switch (prefs.getString(Settings.PREF_MORE_POPUP_KEYS, "normal")) {
|
||||
return switch (prefs.getString(Settings.PREF_MORE_POPUP_KEYS, "main")) {
|
||||
case "all" -> LocaleKeyboardInfosKt.POPUP_KEYS_ALL;
|
||||
case "more" -> LocaleKeyboardInfosKt.POPUP_KEYS_MORE;
|
||||
default -> LocaleKeyboardInfosKt.POPUP_KEYS_NORMAL;
|
||||
case "normal" -> LocaleKeyboardInfosKt.POPUP_KEYS_NORMAL;
|
||||
default -> LocaleKeyboardInfosKt.POPUP_KEYS_MAIN;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue