Repository navigation
Downloads: progress, cancel, retry, open and share - #16
Merged
Merged
Conversation
The Downloads screen could only list and delete. Now it manages the download. - DownloadEntity keeps the DownloadManager id (Room v2 + a real 1->2 migration, no destructive drop), and a watcher polls it every 1.5s while anything is downloading - Downloads show a percentage and a progress bar, and flip to Completed/Failed on their own with a snackbar - Cancel removes the DownloadManager job and the row; Retry re-enqueues the original URL; tapping a finished row opens the file - FileProvider (res/xml/file_paths.xml) so Open and Share pass a content:// URI for the real file instead of the URL text
|
Caution Review failedThe pull request is closed. Walkthrough
Change: Feature
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Downloads was a list you could only delete from. It is now managed end to end.
What changed
dm.enqueue(request)id thrown awayDownloadEntity.managerId"Completed"at enqueue time"Downloading"until the manager reports success/failureDownloadManagerevery 1.5s → % in the row +LinearProgressIndicatorcontent://via FileProviderNotes
MIGRATION_1_2(ALTER TABLE downloads ADD COLUMN managerId), so existing bookmarks, history and downloads survive the update.fallbackToDestructiveMigrationstays only as a last-resort guard.res/xml/file_paths.xmlexposes exactlyDownload/, the app's own download folder, saved pages and cache — nothing else.Downloading, so an idle app does no work.managerId = -1), so it records straight as completed.Checks
The PR's own
Quality Gate & Testsrun compiles, unit-tests and lints it.Summary by CodeRabbit