mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
adding a toggle for forcing English language
This commit is contained in:
@ -28,6 +28,8 @@ class MainActivity : SimpleActivity() {
|
||||
private val BACK_PRESS_TIMEOUT = 5000
|
||||
private var wasBackJustPressed = false
|
||||
|
||||
private var mStoredUseEnglish = false
|
||||
|
||||
private lateinit var fragment: ItemsFragment
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@ -44,13 +46,24 @@ class MainActivity : SimpleActivity() {
|
||||
tryInitFileManager()
|
||||
checkWhatsNewDialog()
|
||||
checkIfRootAvailable()
|
||||
storeStateVariables()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (mStoredUseEnglish != config.useEnglish) {
|
||||
restartActivity()
|
||||
return
|
||||
}
|
||||
|
||||
invalidateOptionsMenu()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
storeStateVariables()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
config.temporarilyShowHidden = false
|
||||
@ -72,6 +85,10 @@ class MainActivity : SimpleActivity() {
|
||||
return true
|
||||
}
|
||||
|
||||
private fun storeStateVariables() {
|
||||
mStoredUseEnglish = config.useEnglish
|
||||
}
|
||||
|
||||
private fun tryInitFileManager() {
|
||||
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||
if (it) {
|
||||
|
Reference in New Issue
Block a user