Skip to content

Feat: Add recent files to the navigation drawer and app shortcuts - #1631

Open
arshit09 wants to merge 1 commit into
zhanghai:masterfrom
arshit09:feature/recent-files
Open

arshit09 wants to merge 1 commit into
zhanghai:masterfrom
arshit09:feature/recent-files

Conversation

@arshit09

Copy link
Copy Markdown

Adds an opt-in Show recent files setting. When it's on, a Recent files view lists the most recently modified files on the device (images, videos, audio, APKs, documents, archives and so on), newest first.

Changes

  • Setting: Settings → Behavior → Show recent files, off by default.
  • Navigation drawer: a Recent files entry among the standard folders, in alphabetical order (e.g. Podcasts → Recent files → Ringtones).
  • Launcher shortcut: a dynamic Recent files app shortcut that is added and removed with the setting. Already-pinned shortcuts keep working. Adaptive icon on API 26+ and legacy PNGs for API 25, drawn to match the existing Downloads and FTP server shortcut icons.
  • Loading (RecentFilesLiveData): queries MediaStore.Files on the external volumes for up to 500 files, re-sorts them by file system modification time, and publishes results as they load.
  • Excluded from the list:
    • directories, which the media database indexes before Android Q
    • temporary files and unfinished downloads (.tmp, .crdownload, .part, …)
    • logs, lock and swap files, and SQLite journals
    • Thumbs.db and .nomedia
    • anything inside cache, temp, log, thumbnail or trash folders, LOST.DIR and Android/obb
    • files in hidden folders, unless Show hidden files is on
  • File list UI: reuses the existing file list, so opening files, selection, cut/copy/delete/share, properties, list/grid view and pull-to-refresh all work. Search filters the recent files by name.
    • Sorting is fixed to newest first.
    • Actions that would apply to the previously browsed folder are hidden: the paste bar, the create button, Archive, Share, Copy path, Add bookmark, Create shortcut, Open in terminal, New task and Navigate up.
    • Back leaves the view.
  • FileListAdapter: isSearching is renamed to isUnsorted, since it now covers both search results and recent files.

Testing

Manual testing on emulators; the project has no automated tests.

Emulator Android Checked
Medium Phone (API 36) 16 Drawer entry and its alphabetical position; order across file types; opening an image in the image viewer; multi-select actions; hidden menu items and sort options; search; pull-to-refresh picking up a new file; back; turning the setting off while viewing; launcher shortcut (adaptive icon) from long-press and from a cold start; junk exclusion; Show hidden files
Pixel (API 25, Google APIs) 7.1 Shortcut registered when the setting is enabled; legacy PNG icon in the long-press menu; shortcut opens Recent files; shortcut removed when the setting is disabled; list across file types (this is where directory rows were found crowding out files, now fixed)
Pixel (API 23, Google APIs) 6.0 (minSdk) Cold start with the setting on, where there is no shortcut API: no crash; drawer entry; list order across file types
  • Junk filter: added 13 junk files, all newer than every real file. None of them appeared, and a real file created at the same time appeared at the top.
  • ./gradlew :app:lintDebug: no new issues in the changed files and no errors. The only warnings are the expected MissingTranslation ones for the new strings.

Notes

  • The list needs storage access the app already asks for (All files access on Android 11+). Without it, the list is empty.
  • The new strings are English only.
  • I've read the note in the PR template. Please feel free to treat this as a feature suggestion with a reference implementation.

🤖 Generated with Claude Code

Add a "Show recent files" setting that lists the most recently modified
files on the device, newest first, from the navigation drawer and a
dynamic launcher shortcut. Files come from the media database and skip
directories, temporary files, caches, thumbnails and logs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@arshit09 arshit09 mentioned this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant