add an activity extension for toggling UseEnglish
This commit is contained in:
parent
75d7428cfc
commit
ef3957cf1d
1 changed files with 8 additions and 0 deletions
|
@ -534,3 +534,11 @@ fun BaseSimpleActivity.createDirectorySync(directory: File): Boolean {
|
|||
}
|
||||
return directory.mkdirs()
|
||||
}
|
||||
|
||||
fun BaseSimpleActivity.useEnglishToggled() {
|
||||
val conf = resources.configuration
|
||||
conf.locale = if (baseConfig.useEnglish) Locale.ENGLISH else Locale.getDefault()
|
||||
resources.updateConfiguration(conf, resources.displayMetrics)
|
||||
finish()
|
||||
startActivity(intent)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue