[Animation · Snackbar · UI · State Management] – Shaky Egg
textpost · published
Attachments
🎭 Scenario
You’ve been invited to help out with a quirky Easter app with digital shaking eggs. Your job is to bring a playful, dynamic egg to life. This egg has a mind of its own and responds to your taps, but only when it feels like it. Your motion designer friend had a vision of a fun, slightly mischievous egg, and now it’s up to you to code that behaviour.
🎯 Feature Goal
Create a full-screen UI with a periodically shaking egg that, when tapped, shows a snackbar with a time-dependent message.
All this feature does is automatically start an egg-shaking animation and play it until the user taps the egg. Once tapped, the egg stops shaking, and a snack bar is shown. After a few seconds, the egg starts shaking again until it is tapped.
📌 Requirements
Solid blue background (#0F1241)
Large egg in center of the screen
The egg should perform a continuous shaking animation
When tapped:
Egg should stop shaking
Show custom snackbar message with text: "You've hatched it!"
After a short delay of a random duration between four (4) and six (6) seconds, the egg should automatically start shaking again
Tapping the egg while it is not shaking should show a custom snackbar with text: "Easter egg not ready yet!"
The shaking animation is left up to you - it should resemble an egg shaking.
The Figma mockups include an example of the shaking behaviour (Accessible by tapping the play icon found at the top right in between your profile icon and the share button).
To the right are two more example GIFs that you can use for inspiration when creating the shaking animation 👉🏼
Two different custom snackbar UI components
A yellow and orange gradient shown when the shaking egg is tapped
A grey one shown when the idle egg is tapped
🤔 What's Allowed?
Standard Android/Jetpack libraries
No 3rd party libraries are allowed or would be required to complete this challenge
⚠️ What's NOT important for a valid submission?
The aim of this challenge is not to create an elaborate shaking animation; as long as it reasonably appears to be shaking, it will be accepted 👍🏼 We want to test your ability to work with Compose animations.
🧠 Disclaimer
This is not a full animation system or state machine challenge. The focus is on understanding animation timing, user interaction, and managing transient UI state with Jetpack Compose.
🏆 Submission & Rewards
A successful submission of this challenge via the
/submit-challengecommand on Discord grants you 100 XP. You can use it in any channel on Discord :)A successful submission consists of these parts
A link to a Gist showing your code for this challenge.
Record a screen (max 10s) showing the egg shaking, then tap it to display a snackbar and stop the shaking. While the egg is idle, tap it again to show the alternate snackbar. Wait for the egg to start shaking again before ending the recording.