Skip to content

Conversation

@marcosholgado
Copy link
Contributor

@marcosholgado marcosholgado commented Jan 29, 2020

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

  1. Using variant me
  2. Launch the app and navigate to get the different CTAs

Normal CTAs

  1. Using variant mc
  2. Launch the app, you should see the default browser CTA and the widget CTA

Double dialog showing

  1. Using variant me
  2. Launch and API 21 emulator
  3. Load google.com
  4. Open privacy grade while it is still loading
  5. Close privacy grade and see dialog
  6. Tap in url to load cnn.com
  7. Only one dialog is shown

Internal references:

Software Engineering Expectations
Technical Design Template

Copy link
Contributor

@cmonfortep cmonfortep left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

@cmonfortep cmonfortep left a 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

@marcosholgado marcosholgado merged commit 82362dc into develop Jan 31, 2020
@marcosholgado marcosholgado deleted the feature/marcos/cta_new_interfaces branch March 2, 2020 11:24
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.

2 participants