AmazeFileManager icon indicating copy to clipboard operation
AmazeFileManager copied to clipboard

Recent files doesn't display recent files

Open professional-lalit opened this issue 1 year ago • 1 comments

RCA -

There was a check in LoadFilesListTask.listRecentFiles() that only list the file if it is not directory, which is not a case if file is not created in storage/emulated0/ directory. The recently changed file would always come wrapped in some folder if created in a directory other than storage/emulated/0/. Which was causing this issue.

Resolution -

In the solution provided it is assumed that we have to only show the files that were modified, hence, only modified/created files are listed and not the folders (as the title suggests ‘Recent Files’). Here, if the file is wrapped in a directory, the directory is recursively explored to check the files it contains. As we loop around recursively we go on adding the files that we find in a final list that is to be returned.

In this code, every file that comes from cursor will always be wrapped in some folder and it will be explored recursively and listed.

Description

Issue tracker

Fixes #3991

Manual tests

  • [ ] Done

  • Device: Android Studio Emulator

  • OS: Android 11 ("R") API 30

Build tasks success

Successfully running following tasks on local:

  • [ ] ./gradlew assembledebug
  • [ ] ./gradlew spotlessCheck

professional-lalit avatar Jan 30 '24 18:01 professional-lalit