-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Suppress download dialog if user already confirmed download with a different dialog #766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress download dialog if user already confirmed download with a different dialog #766
Conversation
…ature/mia/suppress_dialog_if_other_dialogs_seen # Conflicts: # app/src/main/res/values/string-untranslated.xml
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.
I would like to double check if the following described scenario is the expected one:
- Fresh install
- Go to https://github.com/duckduckgo/Android/releases and download an apk
- Permissions dialog is shown
- Download starts and download dialog did not appear
I will continue the review, as I think the behavior is correct.
Edit: While reviewing I see that this is intentional. All good.
cmonfortep
left a comment
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.
Nice cleanup and I like the how the user flow is now.
Just few comments, everything looks good but I have a question related to some changes we introduced.
app/src/main/java/com/duckduckgo/app/browser/downloader/FileDownloader.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/DownloadConfirmationFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/DownloadConfirmationFragment.kt
Show resolved
Hide resolved
cmonfortep
left a comment
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.
Very good work, and nice clean up of things that were not related to this PR 🤘
Just a question related to the dialog dismiss, and some optional changes to simplify some parts of the code. But so far it looks great.
| override fun onPause() { | ||
| daxDialog = null | ||
| logoHidingListener.onPause() | ||
| dismissDownloadFragment() |
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 we need this dismiss here. The dialog will be dismissed automatically when activity is destroyed, and automatically shown when recreated. You are already covering that case setting again the listener.
Keeping the line here, dialog will be dismissed if user sends the app to background or screen turns off (Maybe that's the expected behavior).
Removing the line keeps the dialog and also work on recreation. Thoughts?
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.
I made the rest of the code safe in terms of fragment recreation so we definitely don't need this.
I went with removing it for usability reasons, I was testing my changes and found it awkward to leave the app and return to it later with the dialog still up. The dialog feels like a decision the user should make immediately and I thinks it's a better experience if the dialog is dismissed if the user leaves the screen. It's an edge case that probably won't impact many users so that's not a strong opinion on my side. If you feel really strongly about keeping it, I'm happy to go with that.
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.
I agree, it's an edge case and worst case scenario user only needs to click again on the link, like you said. I'm good keeping it like this.
app/src/main/java/com/duckduckgo/app/browser/downloader/FileDownloader.kt
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/DownloadConfirmationFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/DownloadConfirmationFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/DownloadConfirmationFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/downloader/FileDownloader.kt
Show resolved
Hide resolved
cmonfortep
left a comment
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.
🚀 LGTM, nice work here. Also thank you for all the extra changes to improve parts not related to this PR.
…ature/mia/suppress_dialog_if_other_dialogs_seen
Task/Issue URL: https://app.asana.com/0/414730916066338/1170085036962994
Description:
PR #663 added a new download confirmation dialog (currently merged into a feature branch). This PR suppresses that dialog in cases where the user has already interacted with a dialog e.g accepted the Android system permissions dialog or long pressed and selected "download image".
Steps to test this PR:
Internal references:
Software Engineering Expectations
Technical Design Template