diff --git a/app/src/main/java/helium314/keyboard/latin/utils/LayoutUtils.kt b/app/src/main/java/helium314/keyboard/latin/utils/LayoutUtils.kt index bc249574b..8d575b8cd 100644 --- a/app/src/main/java/helium314/keyboard/latin/utils/LayoutUtils.kt +++ b/app/src/main/java/helium314/keyboard/latin/utils/LayoutUtils.kt @@ -16,9 +16,10 @@ object LayoutUtils { return SubtypeSettings.getAllAvailableSubtypes() .mapTo(HashSet()) { it.mainLayoutName()?.substringBefore("+") ?: "qwerty" } .apply { addAll(context.resources.getStringArray(R.array.predefined_layouts)) } + val layouts = SubtypeSettings.getResourceSubtypesForLocale(locale).mapNotNullTo(mutableSetOf()) { it.mainLayoutName() } if (locale.script() == ScriptUtils.SCRIPT_LATIN) - return context.resources.getStringArray(R.array.predefined_layouts).toList() - return SubtypeSettings.getResourceSubtypesForLocale(locale).mapNotNullTo(HashSet()) { it.mainLayoutName() } + layouts.addAll(context.resources.getStringArray(R.array.predefined_layouts)) + return layouts } fun getLMainLayoutsForLocales(locales: List, context: Context): Collection = diff --git a/app/src/main/java/helium314/keyboard/settings/dialogs/SubtypeDialog.kt b/app/src/main/java/helium314/keyboard/settings/dialogs/SubtypeDialog.kt index b7c69ba21..e20923105 100644 --- a/app/src/main/java/helium314/keyboard/settings/dialogs/SubtypeDialog.kt +++ b/app/src/main/java/helium314/keyboard/settings/dialogs/SubtypeDialog.kt @@ -66,12 +66,12 @@ import helium314.keyboard.settings.screens.GetIcon import java.util.Locale // todo: -// "+" layouts for languages that have one are not selectable, they should use the language name // fix the display name (why is the layout always added now e.g. after adding a secondary locale, when it's not there initially?) // some way of editing, adding and removing main layouts // here or in layouts screen? // layouts screen: that would be the purpose, but there is no default for main, and it's language dependent // here we need at least an indicator which layouts are custom (edit or delete buttons) +// sometimes the layout is not enabled after changing something @Composable fun SubtypeDialog( onDismissRequest: () -> Unit,