mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-22 22:44:38 +02:00
Making sure the UI update from language is in the Main thread.
This commit is contained in:
parent
91bfb60613
commit
9dfb4d1a1b
@ -109,9 +109,11 @@ class SharedPreferencesViewModel : ViewModel() {
|
||||
|
||||
fun updateLanguageInTheUI() {
|
||||
if (sharedPrefs.language != null) {
|
||||
AppCompatDelegate.setApplicationLocales(
|
||||
LocaleListCompat.forLanguageTags(sharedPrefs.language)
|
||||
)
|
||||
viewModelScope.launch(Dispatchers.Main) {
|
||||
AppCompatDelegate.setApplicationLocales(
|
||||
LocaleListCompat.forLanguageTags(sharedPrefs.language)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user