add menu buttons for set home and go home
This commit is contained in:
parent
b009bcfed0
commit
3247dc5ffb
12 changed files with 31 additions and 2 deletions
|
@ -106,6 +106,8 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
|
R.id.go_home -> goHome()
|
||||||
|
R.id.set_as_home -> setAsHome()
|
||||||
R.id.settings -> startActivity(Intent(this, SettingsActivity::class.java))
|
R.id.settings -> startActivity(Intent(this, SettingsActivity::class.java))
|
||||||
R.id.about -> launchAbout()
|
R.id.about -> launchAbout()
|
||||||
else -> return super.onOptionsItemSelected(item)
|
else -> return super.onOptionsItemSelected(item)
|
||||||
|
@ -113,7 +115,15 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
fun launchAbout() {
|
private fun goHome() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setAsHome() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun launchAbout() {
|
||||||
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_MULTISELECT, BuildConfig.VERSION_NAME)
|
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_MULTISELECT, BuildConfig.VERSION_NAME)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +171,7 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun changePath(pickedPath: String) {
|
private fun changePath(pickedPath: String) {
|
||||||
mBasePath = pickedPath
|
mBasePath = pickedPath
|
||||||
openPath(pickedPath)
|
openPath(pickedPath)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<item
|
||||||
|
android:id="@+id/go_home"
|
||||||
|
android:icon="@drawable/ic_home"
|
||||||
|
android:title="@string/go_to_home_folder"
|
||||||
|
app:showAsAction="ifRoom"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/set_as_home"
|
||||||
|
android:title="@string/set_as_home_folder"
|
||||||
|
app:showAsAction="never"/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/settings"
|
android:id="@+id/settings"
|
||||||
android:title="@string/settings"
|
android:title="@string/settings"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<string name="app_launcher_name">Dateimanager</string>
|
<string name="app_launcher_name">Dateimanager</string>
|
||||||
<string name="press_back_again">Drücke erneut zum Schließen</string>
|
<string name="press_back_again">Drücke erneut zum Schließen</string>
|
||||||
<string name="no_app_found">No app for opening this type of file is available</string>
|
<string name="no_app_found">No app for opening this type of file is available</string>
|
||||||
|
<string name="go_to_home_folder">Go to home folder</string>
|
||||||
<string name="set_as_home_folder">Set at home folder</string>
|
<string name="set_as_home_folder">Set at home folder</string>
|
||||||
<string name="home_folder_updated">Home folder updated</string>
|
<string name="home_folder_updated">Home folder updated</string>
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<string name="app_launcher_name">Administrador de archivos</string>
|
<string name="app_launcher_name">Administrador de archivos</string>
|
||||||
<string name="press_back_again">Pulse otra vez volver para salir</string>
|
<string name="press_back_again">Pulse otra vez volver para salir</string>
|
||||||
<string name="no_app_found">No app for opening this type of file is available</string>
|
<string name="no_app_found">No app for opening this type of file is available</string>
|
||||||
|
<string name="go_to_home_folder">Go to home folder</string>
|
||||||
<string name="set_as_home_folder">Set at home folder</string>
|
<string name="set_as_home_folder">Set at home folder</string>
|
||||||
<string name="home_folder_updated">Home folder updated</string>
|
<string name="home_folder_updated">Home folder updated</string>
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<string name="app_launcher_name">Gestionnaire de fichiers</string>
|
<string name="app_launcher_name">Gestionnaire de fichiers</string>
|
||||||
<string name="press_back_again">Appuyer à nouveau sur le bouton retour pour quitter</string>
|
<string name="press_back_again">Appuyer à nouveau sur le bouton retour pour quitter</string>
|
||||||
<string name="no_app_found">No app for opening this type of file is available</string>
|
<string name="no_app_found">No app for opening this type of file is available</string>
|
||||||
|
<string name="go_to_home_folder">Go to home folder</string>
|
||||||
<string name="set_as_home_folder">Set at home folder</string>
|
<string name="set_as_home_folder">Set at home folder</string>
|
||||||
<string name="home_folder_updated">Home folder updated</string>
|
<string name="home_folder_updated">Home folder updated</string>
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<string name="app_launcher_name">File Manager</string>
|
<string name="app_launcher_name">File Manager</string>
|
||||||
<string name="press_back_again">Premi di nuovo indietro per uscire</string>
|
<string name="press_back_again">Premi di nuovo indietro per uscire</string>
|
||||||
<string name="no_app_found">No app for opening this type of file is available</string>
|
<string name="no_app_found">No app for opening this type of file is available</string>
|
||||||
|
<string name="go_to_home_folder">Go to home folder</string>
|
||||||
<string name="set_as_home_folder">Set at home folder</string>
|
<string name="set_as_home_folder">Set at home folder</string>
|
||||||
<string name="home_folder_updated">Home folder updated</string>
|
<string name="home_folder_updated">Home folder updated</string>
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<string name="app_launcher_name">ファイル マネージャー</string>
|
<string name="app_launcher_name">ファイル マネージャー</string>
|
||||||
<string name="press_back_again">もう一度戻るを押すと終了します</string>
|
<string name="press_back_again">もう一度戻るを押すと終了します</string>
|
||||||
<string name="no_app_found">No app for opening this type of file is available</string>
|
<string name="no_app_found">No app for opening this type of file is available</string>
|
||||||
|
<string name="go_to_home_folder">Go to home folder</string>
|
||||||
<string name="set_as_home_folder">Set at home folder</string>
|
<string name="set_as_home_folder">Set at home folder</string>
|
||||||
<string name="home_folder_updated">Home folder updated</string>
|
<string name="home_folder_updated">Home folder updated</string>
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<string name="app_launcher_name">Gestor de ficheiros</string>
|
<string name="app_launcher_name">Gestor de ficheiros</string>
|
||||||
<string name="press_back_again">Prima novamente para sair</string>
|
<string name="press_back_again">Prima novamente para sair</string>
|
||||||
<string name="no_app_found">No app for opening this type of file is available</string>
|
<string name="no_app_found">No app for opening this type of file is available</string>
|
||||||
|
<string name="go_to_home_folder">Go to home folder</string>
|
||||||
<string name="set_as_home_folder">Set at home folder</string>
|
<string name="set_as_home_folder">Set at home folder</string>
|
||||||
<string name="home_folder_updated">Home folder updated</string>
|
<string name="home_folder_updated">Home folder updated</string>
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<string name="app_launcher_name">Файловый менеджер</string>
|
<string name="app_launcher_name">Файловый менеджер</string>
|
||||||
<string name="press_back_again">Нажмите "назад" ещё раз, чтобы выйти</string>
|
<string name="press_back_again">Нажмите "назад" ещё раз, чтобы выйти</string>
|
||||||
<string name="no_app_found">Не найдено приложение для открытия файлов такого типа</string>
|
<string name="no_app_found">Не найдено приложение для открытия файлов такого типа</string>
|
||||||
|
<string name="go_to_home_folder">Go to home folder</string>
|
||||||
<string name="set_as_home_folder">Set at home folder</string>
|
<string name="set_as_home_folder">Set at home folder</string>
|
||||||
<string name="home_folder_updated">Home folder updated</string>
|
<string name="home_folder_updated">Home folder updated</string>
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<string name="app_launcher_name">Filhanterare</string>
|
<string name="app_launcher_name">Filhanterare</string>
|
||||||
<string name="press_back_again">Tryck på bakåt igen för att avsluta</string>
|
<string name="press_back_again">Tryck på bakåt igen för att avsluta</string>
|
||||||
<string name="no_app_found">No app for opening this type of file is available</string>
|
<string name="no_app_found">No app for opening this type of file is available</string>
|
||||||
|
<string name="go_to_home_folder">Go to home folder</string>
|
||||||
<string name="set_as_home_folder">Set at home folder</string>
|
<string name="set_as_home_folder">Set at home folder</string>
|
||||||
<string name="home_folder_updated">Home folder updated</string>
|
<string name="home_folder_updated">Home folder updated</string>
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<string name="app_launcher_name">Dosya Yöneticisi</string>
|
<string name="app_launcher_name">Dosya Yöneticisi</string>
|
||||||
<string name="press_back_again">Çıkmak için tekrar basın</string>
|
<string name="press_back_again">Çıkmak için tekrar basın</string>
|
||||||
<string name="no_app_found">No app for opening this type of file is available</string>
|
<string name="no_app_found">No app for opening this type of file is available</string>
|
||||||
|
<string name="go_to_home_folder">Go to home folder</string>
|
||||||
<string name="set_as_home_folder">Set at home folder</string>
|
<string name="set_as_home_folder">Set at home folder</string>
|
||||||
<string name="home_folder_updated">Home folder updated</string>
|
<string name="home_folder_updated">Home folder updated</string>
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<string name="app_launcher_name">File Manager</string>
|
<string name="app_launcher_name">File Manager</string>
|
||||||
<string name="press_back_again">Press back again to exit</string>
|
<string name="press_back_again">Press back again to exit</string>
|
||||||
<string name="no_app_found">No app for opening this type of file is available</string>
|
<string name="no_app_found">No app for opening this type of file is available</string>
|
||||||
|
<string name="go_to_home_folder">Go to home folder</string>
|
||||||
<string name="set_as_home_folder">Set at home folder</string>
|
<string name="set_as_home_folder">Set at home folder</string>
|
||||||
<string name="home_folder_updated">Home folder updated</string>
|
<string name="home_folder_updated">Home folder updated</string>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue