mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 13:50:30 +05:30
fix language change
This commit is contained in:
parent
93ab103cc5
commit
7bbe52ce2a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user