From af5c41c83c95eeb341cd9f17814b25e1c8b463cc Mon Sep 17 00:00:00 2001 From: Helium314 Date: Sun, 8 Jun 2025 21:42:33 +0200 Subject: [PATCH] add NO_LANGUAGE inside remember should fix GH-1678 --- .../keyboard/settings/screens/DictionaryScreen.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/helium314/keyboard/settings/screens/DictionaryScreen.kt b/app/src/main/java/helium314/keyboard/settings/screens/DictionaryScreen.kt index bdc92f8bb..c9f56d9ca 100644 --- a/app/src/main/java/helium314/keyboard/settings/screens/DictionaryScreen.kt +++ b/app/src/main/java/helium314/keyboard/settings/screens/DictionaryScreen.kt @@ -57,8 +57,11 @@ fun DictionaryScreen( val enabledLanguages = SubtypeSettings.getEnabledSubtypes(true).map { it.locale().language } val cachedDictFolders = DictionaryInfoUtils.getCacheDirectories(ctx).map { it.name } val comparer = compareBy({ it.language !in enabledLanguages }, { it.toLanguageTag() !in cachedDictFolders}, { it.displayName }) - val dictionaryLocales = remember { getDictionaryLocales(ctx).sortedWith(comparer).toMutableList() } - dictionaryLocales.add(0, Locale(SubtypeLocaleUtils.NO_LANGUAGE)) + val dictionaryLocales = remember { + getDictionaryLocales(ctx).sortedWith(comparer).toMutableList().apply { + add(0, Locale(SubtypeLocaleUtils.NO_LANGUAGE)) + } + } var selectedLocale: Locale? by remember { mutableStateOf(null) } var showAddDictDialog by remember { mutableStateOf(false) } val dictPicker = dictionaryFilePicker(selectedLocale)