create ThemeViewModel using viewModel contructor

pull/486/head
greenart7c3 2023-07-10 16:04:06 -03:00
rodzic 492b9494ec
commit 3e48b293b0
1 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -58,10 +58,9 @@ class MainActivity : AppCompatActivity() {
val appLocale: LocaleListCompat = LocaleListCompat.forLanguageTags(language)
AppCompatDelegate.setApplicationLocales(appLocale)
}
val themeViewModel = ThemeViewModel()
themeViewModel.onChange(LocalPreferences.getTheme())
setContent {
val themeViewModel: ThemeViewModel = viewModel()
themeViewModel.onChange(LocalPreferences.getTheme())
AmethystTheme(themeViewModel) {
// A surface container using the 'background' color from the theme
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colors.background) {