-
Notifications
You must be signed in to change notification settings - Fork 1.3k
For #352: Delete a download #15577
For #352: Delete a download #15577
Conversation
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
f5068e3
to
c965f0d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, whew. This is a big PR 😄 I think this is a great start. Let's focus on the simple case of deleting one item at a time and file a followup to handle multi-select. I think that will help us see the next steps more clearly
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadAdapter.kt
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadController.kt
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadItemMenu.kt
Outdated
Show resolved
Hide resolved
719ce28
to
7fc12ab
Compare
Changes: Delete one, Delete Multi, and Delete All now work. Sometimes there is a weird issue with the UI not updating to show the disappeared downloads right away, need extra eyes to figure out why. |
Codecov Report
@@ Coverage Diff @@
## master #15577 +/- ##
============================================
- Coverage 30.03% 29.91% -0.13%
- Complexity 1207 1213 +6
============================================
Files 453 454 +1
Lines 18516 18686 +170
Branches 2548 2571 +23
============================================
+ Hits 5562 5590 +28
- Misses 12522 12664 +142
Partials 432 432 Continue to review full report at Codecov.
|
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadAdapter.kt
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadController.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadView.kt
Outdated
Show resolved
Hide resolved
...src/main/java/org/mozilla/fenix/library/downloads/viewholders/DownloadsListItemViewHolder.kt
Outdated
Show resolved
Hide resolved
itemView.download_layout.titleView.text = item.fileName | ||
itemView.download_layout.urlView.text = item.size.toLong().toMegabyteOrKilobyteString() | ||
|
||
toggleTopContent(showDeleteButton, mode === DownloadFragmentState.Mode.Normal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
= = = ? what does the triple = do :O
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is necessary here (re: our convo earlier). Let's just leave this as-is for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you can find some docs around the equality operators, in summary ===
is comparing based on reference, vs ==
that compare based on equals, in this case either will work asDownloadFragmentState.Mode.Normal
is an object it has only one reference (it's a singleton), I would prefer if we could use ==
as it will have the same effect and avoid the inherited complexity of ===
.
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadAdapter.kt
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadController.kt
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragmentStore.kt
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragmentStore.kt
Show resolved
Hide resolved
...src/main/java/org/mozilla/fenix/library/downloads/viewholders/DownloadsListItemViewHolder.kt
Outdated
Show resolved
Hide resolved
@kglazko could we add some test to cover this new functionality? It will help to avoid future regression :) |
@kglazko are there any UI mockups ? |
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following up on our conversation with @boek and @Amejia481 earlier, our action items here are to:
- add some comments/kdocs to these files explaining how the pending deletion functions (@kglazko)
- file an issue for refactoring downloads, history, bookmarks, etc to improve clarity and code quality (@eliserichards)
90d7b71
to
8afdca3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few nits from the last few rounds that still need to be cleaned up, but this is looking fantastic! Once those nits are taken care of I want to come back and do some manual testing (which I'll probably ask your help on)
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/library/downloads/DownloadFragment.kt
Outdated
Show resolved
Hide resolved
b8964bf
to
13e0817
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me!
In a follow up we can increase the code coverage for this feature :)
There is a ktlint issue.
[task 2020-11-02T18:44:32.550Z] > Task :ktlint
[task 2020-11-02T18:44:32.550Z] /builds/worker/checkouts/src/app/src/main/java/org/mozilla/fenix/library/downloads/viewholders/DownloadsListItemViewHolder.kt:21:1: Unused import
[task 2020-11-02T18:44:34.849Z]
[task 2020-11-02T18:44:34.850Z] > Task :ktlint FAILED
[task 2020-11-02T18:44:34.851Z]
[task 2020-11-02T18:44:34.851Z] FAILURE: Build failed with an exception.
[task 2020-11-02T18:44:34.851Z]
9df7da6
to
4d4beed
Compare
Yayyyyy! This is ready to go! 🥇 |
4d4beed
to
d9d1be5
Compare
Pull Request checklist
To download an APK when reviewing a PR: