commons-app / apps-android-commons

The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons
https://commons-app.github.io/
Apache License 2.0
1.03k stars 1.23k forks source link

Custom picker: Add a button to delete the current folder #5811

Closed nicolas-raoul closed 2 days ago

nicolas-raoul commented 2 months ago

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

why-lab commented 1 month ago

Hi, can I be assigned this issue?

why-lab commented 1 week ago

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?

nicolas-raoul commented 1 week ago

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