Fix recycle bin filling up storage when deleting multiple items
The current implementation of BaseSimpleActivity.movePathsInRecycleBin moves all the selections into the recycle bin, and then deletes them all at once.
Say the selected items have a total size of 5GB and available space on the device is 2GB, if all are moved to recycle bin at once, storage will be filled up and the app is going to crash.
Hence, I made it so that the app deletes the moved items whenever the remaining space is not enough...
Example
Current implementation
5GB size -> copy 5GB recycle bin -> crash (5GB > 1GB) ~delete the old 5GB from storage~ ❌ crash
Suggested implementation
5GB size -> copy 2GB recycle bin -> delete the old 2GB from storage 3GB size -> copy 2GB recycle bin -> delete the old 2GB from storage 1GB size -> copy 1GB recycle bin -> delete the old 1GB from storage ✔ success
Affected issues
- #2561