MaterialFiles icon indicating copy to clipboard operation
MaterialFiles copied to clipboard

[Feature Request] Exit the app by triggering the Back once

Open drakeet opened this issue 3 years ago • 1 comments

As a user, I used to exit the app through the Back gesture, but when I entered a deep folder directory, I need to repeatedly trigger a Back(onBackPressed()) event to return to the root folder, then I can exit the app. This is very inefficient and troublesome for me.

So I would love to have at least one preference item that allows the user to choose "one-click to exit the application via Back". I think this will not hurt the original experience, because we already have an explicit trail path view at the top (the bar shows A > B > C).

If possible, I would also like the FileListActivity to accept an intent parameter/extra (boolean) to temporarily configure this, because one of our apps will use MaterialFiles to open a deep folder, and once the user goes to this FileListActivity, he will need to click back multiple times to get back to our original Activity.

This is how we use MaterialFiles to open a deep folder:

val openInFilesIntent = Intent(Intent.ACTION_VIEW)
openInFilesIntent.type = "vnd.android.document/directory"
openInFilesIntent.component = ComponentName("me.zhanghai.android.files", "me.zhanghai.android.files.filelist.FileListActivity")
openInFilesIntent.putExtra("org.openintents.extra.ABSOLUTE_PATH", <path>)
// need a boolean extra to set one-click to exit
// ...
startActivity(openInFilesIntent)

Thanks!

drakeet avatar Mar 11 '21 10:03 drakeet

To be fair, the stock DocumentsUI picker has this same behavior. (Reproduction steps: pick a deep folder from it in Material Files, then try to pick another.)

I think a less confusing change here can be, change the top-left toolbar icon for picker mode from menu (hamburger icon) to close (cross icon). I'm still undecided if this should be a setting though - nevertheless, the user can drag out the drawer anywhere in the app now.

zhanghai avatar Mar 14 '21 06:03 zhanghai