TeamAmaze / TeamAmaze/AmazeFileManager
Avoid unnecessary refresh on files and folders deletion
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 6.4k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
Describe the bug
Currently, when files and folders are deleted, the whole directory listing is performed again and then displayed.
To Reproduce
Steps to reproduce the behavior:
- Go to 'Internal Storage' (or any other location)
- Select one or more files/folders
- Delete the selected files and folders
- The app show refresh animation and then display the updated list of files and folders in that directory.
Expected behavior
Instead of doing the directory listing and then displaying, we can just take the old result of directory listing (i.e. the one before the deletion operation) from the GUI component (probably it is called ListView), then remove the entries of files and folders deleted.
Smartphone
- Device: Redmi 4x
- OS: Android 11
- Rooted: No
- Version: 3.6.7
Additional context
- Please have a look at MaterialFiles. It works perfectly. Possible place of related code in it is this
- Possible places in AmazeFileManager are 1 and 2 (instead of
addNewItem, we can have something likeremoveItem) that are to be updated - Even FX File Explorer works perfectly
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the deletion-related code at MainActivity.java line 2024 and Drawer.java line 609, including the existing addNewItem path. Compare the referenced MaterialFiles FileJobs.kt implementation. Done means deleting selected files or folders updates the existing directory listing without performing a full refresh or showing the refresh animation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100