apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Custom picker: Add a button to delete the current folder

Open nicolas-raoul opened this issue 1 year ago • 1 comments

Context

Some users are using the app to upload thousands of old pictures that they copy from their old hard drives onto their phones. The pictures are often split among many folders, typically one folder per day or month. Smartphones don't have a lot of storage capacity, so these users need to quickly delete each folder after having uploaded it. Using a separate file manager app to do that is time-wasting and error-prone.

Solution

A "delete folder" button in the hamburger menu of the custom picker's activity that shows the content of a folder:

Screenshot_20240903-180640.png

Avoiding risks

  • New setting: Show that button only if "Show deletion button" is enabled in the app's settings (disabled by default).
  • Show a very clear confirmation popup (mentioning the folder's name and path and files number) before actually deleting.

nicolas-raoul avatar Sep 03 '24 09:09 nicolas-raoul

Hi, can I be assigned this issue?

why-lab avatar Oct 02 '24 07:10 why-lab

Hi, this works great for android API < 29. For API 29, you need to ask permission for each picture individually before deleting it (and the empty folder after). I'm sure for API 30&up it's the same, if not even more difficult. Please do correct me if there is another way, but this is what if found so far (and implemented for API<29 and API 29). It has to do with scoped storage and manipulating pictures that were created by other apps than the Commons app.

Asking for permission to delete each picture seems to contradict the whole point of this issue (quickly delete folder) if the folder contains tens or hundreds of pictures. How should I proceed?

why-lab avatar Nov 03 '24 15:11 why-lab

I am on API level 35, apps ask for permission for each folder then they can delete/modify any file within that folder. It is fine. 🙂

Example open source app which does this well: https://play.google.com/store/apps/details?id=org.fossify.filemanager https://github.com/FossifyOrg/File-Manager

nicolas-raoul avatar Nov 04 '24 00:11 nicolas-raoul