From 7bbe52ce2af5afcde586b16467f850ce9ecd4a94 Mon Sep 17 00:00:00 2001 From: rimthekid Date: Fri, 6 May 2022 05:46:45 -0700 Subject: [PATCH] fix language change --- app/src/main/java/com/github/libretube/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/MainActivity.kt b/app/src/main/java/com/github/libretube/MainActivity.kt index 10558023e..49a497a30 100644 --- a/app/src/main/java/com/github/libretube/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/MainActivity.kt @@ -41,7 +41,6 @@ class MainActivity : AppCompatActivity() { val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this) RetrofitInstance.url = sharedPreferences.getString("instance", "https://pipedapi.kavin.rocks/")!! DynamicColors.applyToActivitiesIfAvailable(application) - setContentView(R.layout.activity_main) val languageName = sharedPreferences.getString("language", "sys") if (languageName != "") { var locale = if (languageName != "sys") { @@ -56,6 +55,7 @@ class MainActivity : AppCompatActivity() { Locale.setDefault(locale) res.updateConfiguration(conf, dm) } + setContentView(R.layout.activity_main) when (sharedPreferences.getString("theme_togglee", "A")!!) { "A" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) "L" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)