TeamAmaze / TeamAmaze/AmazeFileManager

Avoid unnecessary refresh on files and folders deletion

Open
#3,075 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-UIUX Issue-Bug Issue-Task (low)
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:

  1. Go to 'Internal Storage' (or any other location)
  2. Select one or more files/folders
  3. Delete the selected files and folders
  4. 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 like removeItem) that are to be updated
  • Even FX File Explorer works perfectly

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.