-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cta new interfaces #679
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
Cta new interfaces #679
Conversation
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.
I like this cleanup, thanks for that 🚀 Just some small comments to take a look, but they are optional, just apply them if you agree with them.
| import kotlinx.android.synthetic.main.include_dax_dialog_cta.view.primaryCta | ||
|
|
||
| interface DialogCta { | ||
| fun showCta(activity: FragmentActivity): DaxDialog |
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.
After checking the implementations of this method, I see that we are returning the Dialog but not showing it. Should this method name be changed? createCta?
Do we need activity: FragmentActivity? I think context is enough if only used for resources.
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 kind of wanted to be consistent with the other interface but yeah I agree, I'll rename that. As for the activity, there are a couple of places where it also uses findViewById
app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
Outdated
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 good job @marcosholgado
Task/Issue URL: https://app.asana.com/0/1125189844152671/1154748750174828 and https://app.asana.com/0/1125189844152671/1154586839765577
Tech Design URL: https://app.asana.com/0/1125189844152671/1158928566141337
CC:
Description:
We used to have one Cta interface that dealt with the creation of a view cta and a dialog cta making it complicated to understand what method should be used for each of them plus they were very specific to a concrete type. This PR changes that to include two new interfaces depending on the cta type.
It also fixes the issue when more than one dialog cta could be displayed at the same time.
Steps to test this PR:
Concept test
meNormal CTAs
mcDouble dialog showing
meInternal references:
Software Engineering Expectations
Technical Design Template