Skip to content

Conversation

riggaroo
Copy link
Collaborator

@riggaroo riggaroo commented Jun 12, 2022

Added two usages of AnimatedContent into JetSurvey.

  1. Switching between Question Content
Before After
Survey_Questions_No_animation_Demo_Mode End_Questions_optimized
  1. Switching from questions to results
Before After
End_Congrats_Before_DemoMode End_Congrats_Final_Demo_Mode

Animate the changes between different question screens, as well as the end result screen.

@riggaroo riggaroo requested a review from a team as a code owner June 12, 2022 16:55
@riggaroo riggaroo requested review from IanGClifton and kul3r4 and removed request for kul3r4 June 12, 2022 16:55
@riggaroo riggaroo self-assigned this Jun 12, 2022
Copy link
Contributor

@IanGClifton IanGClifton left a comment

Choose a reason for hiding this comment

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

This is great! Thank you! I had just one super minor comment

Copy link
Contributor

@simona-anomis simona-anomis left a comment

Choose a reason for hiding this comment

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

LGTM!

JetsurveyTheme {
viewModel.uiState.observeAsState().value?.let { surveyState ->
when (surveyState) {
val state = viewModel.uiState.observeAsState().value ?: return@JetsurveyTheme
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the ?: return@JetsurveyTheme change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I needed a non-nullable state, and I generally prefer early returns instead of wrapping content in lets 😄 https://betterprogramming.pub/are-early-returns-any-good-eed4b4d03866

@riggaroo riggaroo merged commit 3d0b54f into main Jun 20, 2022
@riggaroo riggaroo deleted the riggaroo/jetsurvey-animated-content branch June 20, 2022 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants