-
Notifications
You must be signed in to change notification settings - Fork 0
Added ConfettiBurst to CheckInPopUp feature #102
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
base: main
Are you sure you want to change the base?
Conversation
zachseidner1
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.
Amazing job with this! I have one small structural concern and a few nits, but the animation looks awesome.
|
|
||
| val rect = originRectInRoot | ||
|
|
||
| var started by remember(uiState.showing) { mutableStateOf(false) } |
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.
do we really need this started variable or could we use uiState.showing?
| val g = 1750f | ||
| val t = progress * 1.2f |
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.
nit: avoid one letter variable names
| ) | ||
|
|
||
| when (particle.shape) { | ||
| //draws circle |
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.
nit: this comment is not needed
| ) | ||
| } | ||
|
|
||
| //draws rectangle |
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.
nit: this comment is not needed
| * Renders a confetti burst anchored to a given popup rectangle.(checkinpopup). | ||
| * | ||
| * Reads 'showing' from [ConfettiViewModel]. If false or rect is null, renders nothing. | ||
| * When shown, spawns particles inside the bounds of 'originRectInRoot'. |
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.
if this is the case, would particleSpawningBounds be a better name?
| val systemUiController: SystemUiController = rememberSystemUiController() | ||
|
|
||
| val checkInUiState = checkInViewModel.collectUiStateValue() | ||
| var confettiBounds by remember { mutableStateOf<Rect?>(null) } |
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.
do you think we could have the confettiBounds be stored as a part of the repository, so this way the UI doesn't necessarily have to be in this file so it can modify them?
Overview
Sourced and modified from Resell's falling confetti, ConfettiOverlay.
Added a confetti animation that bursts from the Check-In Pop-Up on a successful check-in, using a physic-based burst. The effect is anchored to the pop-up's bounds and is triggered by a ConfettiEvent.
Changes Made
UI
Integration
Testing
Tested manually/visually on emulator
Related PRs or Issues
#99 and cuappdev/resell-android#86
Screenshots
Confetti Burst Demo
confettiBurstDemo.webm