Skip to content

Conversation

@marcosholgado
Copy link
Contributor

@marcosholgado marcosholgado commented Feb 5, 2021

Finish animation if dialog is not dismissible when the user clicks outisde.

Task/Issue URL: https://app.asana.com/0/715106103902962/1199405563917479
Tech Design URL:
CC:

Description:
This PR adds a few onboarding optimizations:

  1. Makes the Dax Dialogs non-dismissible and finishes the typing animation when the user clicks outside of them. These changes do not apply to the fire button dialog.
  2. Changes the behaviour of the welcome page so if a user clicks in the background the animation will begin immediately, if the animation was already running it finishes the animation.
  3. Changes the icon used in the onboarding dialogs (also the same we have in the location dialog).

Steps to test this PR:

New dax icon

  1. In the Welcome screen and Dax dialogs the new dax icon should show, the new one has an orange outer circle.

Welcome Page

  1. Install the app
  2. Pressing anywhere (apart from the welcome text) should begin the fade in animation if it hasn't started yet.
  3. Once the animation has started, pressing anywhere in the background should finish the typing animation.

Home screen

  1. Once you press Let's do it in the welcome screen you will be taken to the home screen.
  2. Pressing anywhere around the Dax CTA (blank space) should finish the animation.

Click outside doesn't dismiss first time

  1. Go to wikipedia.org and before the dialog animation finishes, click outside of the dialog.
  2. The dialog should not be dismissed and the tying animation should finish.
  3. Tapping outside again will not dismiss the dialog.

Waiting for the animation to finish

  1. Go to SERP.
  2. Wait for the animation to finish
  3. Tapping outside should not dismiss the dialog.

Finish animation by clicking text

  1. Go to google.com and before the dialog animation finishes, click inside the dialog.
  2. The dialog should not be dismissed and the typing animation should finish.
  3. Tapping outside of the dialog should not dismiss the dialog.

New icon in location dialog

  1. This is a side effect of changing the dax icon.
  2. Go to maps.google.com.
  3. Click in your location in the bottom right corner of the map.
  4. The location dialog show should up.
  5. Notice how the icon has an orange outer circle.

Internal references:

Software Engineering Expectations
Technical Design Template

@cmonfortep
Copy link
Contributor

Hey @marcosholgado, please ping me here once the product review is done. thanks!

@marcosholgado marcosholgado changed the title Do not dismiss dax dialogs when clicking outside. Onboarding optimizations Feb 10, 2021
@marcosholgado
Copy link
Contributor Author

Hey @marcosholgado, please ping me here once the product review is done. thanks!

@cmonfortep, product review approved! This is now ready.

@cmonfortep
Copy link
Contributor

@marcosholgado while testing this I've noticed there's a ripple effect when clicking outside the dialog. It feels weird to me to have that effect there. Is this something intentional?

ripple-background

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.

Code looks great, just some minor comments. I will wait for that final check on the ripple effect.

private var typingAnimationJob: Job? = null
private var delayAfterAnimationInMs: Long = 300
var typingDelayInMs: Long = 20
lateinit var textInDialog: Spanned
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion here, but I think is safer to use a nullable type in here instead of a lateinit. Since this will be initialized by startTypingAnimation but there are other public methods that could be called by mistake before that, I will put a safety net and go for nullable instead.

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 think it makes sense, yes. You could be calling finish animation when textInDialog is not initialized which it will crash the app. Changed!

newTabLayout.setOnClickListener { daxCtaContainer.dialogTextCta.finishAnimation() }
}

private fun resetNewTabLayoutClickListener() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about removeNewTabLayoutClickListener? reset sounds more like you are going to set a new one instead of just removing the listener.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, done!

@marcosholgado
Copy link
Contributor Author

Thanks @cmonfortep, this should be ready to re-review. I was only able to reproduce the ripple in effect on emulators but in any cases I made that foreground invisible to avoid it.

secondaryButtonText: String? = "",
toolbarDimmed: Boolean = true,
dismissible: Boolean = true,
dismissible: Boolean = false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is perfect, but I would also change line 53 in this same file. Just to keep this aligned with default property

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 changed!

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, just the comment related to also changing the dismissable value in DaxDialog.ktL53

Good work!

@marcosholgado
Copy link
Contributor Author

LGTM, just the comment related to also changing the dismissable value in DaxDialog.ktL53

Good work!

Good catch! I've just changed it and will merge once it passes CI. Thanks!

@marcosholgado marcosholgado merged commit a3558c0 into develop Feb 12, 2021
@marcosholgado marcosholgado deleted the feature/marcos/make_dax_dialog_non_dismissable branch February 12, 2021 11:39
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