mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-01-20 21:01:21 +01:00
move onOptionsItemSelected upper in the code
This commit is contained in:
parent
50384366d3
commit
46bd091a56
@ -103,6 +103,23 @@ class MainActivity : SimpleActivity() {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.go_home -> goHome()
|
||||
R.id.go_to_favorite -> goToFavorite()
|
||||
R.id.sort -> showSortingDialog()
|
||||
R.id.add_favorite -> addFavorite()
|
||||
R.id.remove_favorite -> removeFavorite()
|
||||
R.id.set_as_home -> setAsHome()
|
||||
R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden()
|
||||
R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden()
|
||||
R.id.settings -> startActivity(Intent(applicationContext, SettingsActivity::class.java))
|
||||
R.id.about -> launchAbout()
|
||||
else -> return super.onOptionsItemSelected(item)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun storeStateVariables() {
|
||||
storedUseEnglish = config.useEnglish
|
||||
}
|
||||
@ -181,23 +198,6 @@ class MainActivity : SimpleActivity() {
|
||||
(fragment_holder as ItemsFragment).openPath(newPath)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.go_home -> goHome()
|
||||
R.id.go_to_favorite -> goToFavorite()
|
||||
R.id.sort -> showSortingDialog()
|
||||
R.id.add_favorite -> addFavorite()
|
||||
R.id.remove_favorite -> removeFavorite()
|
||||
R.id.set_as_home -> setAsHome()
|
||||
R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden()
|
||||
R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden()
|
||||
R.id.settings -> startActivity(Intent(applicationContext, SettingsActivity::class.java))
|
||||
R.id.about -> launchAbout()
|
||||
else -> return super.onOptionsItemSelected(item)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun goHome() {
|
||||
if (config.homeFolder != fragment.currentPath)
|
||||
openPath(config.homeFolder)
|
||||
|
Loading…
Reference in New Issue
Block a user