android-motion-animations
Skill11 starsChanged 8 months agoMITView on GitHub
Use when creating advanced Compose animations, shared element transitions, or physics-based motions for Android.
In this repository40 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- android-accessibilitySkill
- android-adaptive-layoutsSkill
- android-adb-terminalSkill
- android-background-executionSkill
- android-bluetooth-bleSkill
- android-build-verificationSkill
- android-camerax-mlkitSkill
- android-ci-cd-expertSkill
- android-clean-architectureSkill
- android-code-review-expertSkill
- android-coroutines-expertSkill
- android-custom-drawing-canvasSkill
- android-design-system-m3Skill
- android-design-to-codeSkill
- android-detekt-expertSkill
- android-enterprise-securitySkill
- android-gemini-nanoSkill
- android-google-workspace-expertSkill
- android-gradle-expertSkill
- android-hardware-testingSkill
- android-jetpack-composeSkill
- android-kmp-compose-uiSkill
- android-kmp-platform-channelsSkill
- android-kmp-sharedSkill
- android-ktlint-formattingSkill
- android-lint-and-qualitySkill
- android-local-stt-ttsSkill
- android-location-mapsSkill
- android-macrobenchmarkSkill
- android-media3-exoplayerSkill
- android-media-and-image-expertSkill
- android-navigation-expertSkill
- android-offline-firstSkill
- android-performance-auditSkill
- android-rag-localSkill
- android-screenshot-testingSkill
- android-security-hardenedSkill
- android-unit-testingSkill
- android-wear-os-composeSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 44
Use LookaheadLayout (now built into Compose) to calculate intermediate positions for complex reordering or morphing.
- Very specific: line 49
Use SharedTransitionLayout to morph an image from a list into a detail view.
- Very specific: line 53
Avoid rigid tween (linear/ease).
- Very specific: line 58
Use a Brush.linearGradient with an infinite transition to create skeleton loading effects.
- Distinctive: line 68
Duration: Keep UI transitions between 200ms and 400ms.
- Distinctive: line 69
User Control: Ensure animations can be skipped or disabled via system accessibility settings.
- Distinctive: line 70
Purpose: Every animation should serve a purpose (e.g., providing feedback or guidance).
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Android Motion & Animations 🎭✨
Expert strategies for building fluid, high-performance, and delightful user experiences using the Jetpack Compose animation system.
⚡ When to Use
- Screen Transitions: Implementing Shared Element Transitions (Compose 1.7+).
- Interactive UI: Creating elastic or physics-based movements.
- Dynamic Layouts: Animating content size changes or visibility.
- Micro-interactions: Adding subtle "magic" to buttons, icons, or cards.
- Lottie/Rive: Integrating complex vector-based animations.
🏗️ The 4 Layers of Compose Animation
1. High-Level (Simple)
AnimatedVisibility: Slide/Fade in and out.AnimatedContent: Transition between different UI states.Modifier.animateContentSize(): Smoothly resize a container as children change.
2. Intermediate (Transition)
updateTransition: Manage multiple animation states (e.g., Expanded/Collapsed).rememberInfiniteTransition: For looping animations (e.g., Shimmer).
3. Low-Level (Control)
Animatable: Precise control over a single value (Float, Color).AnimationSpec: Customizingspring,tween, orkeyframes.
4. Layout-Level (Lookahead)
- Use LookaheadLayout (now built into Compose) to calculate intermediate positions for complex reordering or morphing.
🚀 Premium Motion Patterns
1. Shared Element Transitions (The Gold Standard)
- Use
SharedTransitionLayoutto morph an image from a list into a detail view. - Rule: Give each shared element a unique
key.
2. Physics-Based Motion (Springs)
- Avoid rigid
tween(linear/ease). Usespringfor a natural feel. - Damping Ratio:
Spring.DampingRatioLowBouncyfor personality. - Stiffness:
Spring.StiffnessMediumfor responsiveness.
3. Content Shimmer
- Use a
Brush.linearGradientwith an infinite transition to create skeleton loading effects.
📦 Performance & Tips
- State Read Isolation: Prefer "Lambda modifiers" (e.g.,
Modifier.graphicsLayer { ... }) to avoid excessive recompositions during high-frequency animations. - Avoid Clipping: Use
clip = falseon parents if elements need to overlap during transitions. - Hardware Acceleration: Always use
graphicsLayerfor translations, rotations, and scale to ensure GPU rendering.
📏 Design Best Practices
- Duration: Keep UI transitions between 200ms and 400ms.
- User Control: Ensure animations can be skipped or disabled via system accessibility settings.
- Purpose: Every animation should serve a purpose (e.g., providing feedback or guidance).
🧪 Verification & Checklist
- No Jank: Check for dropped frames using the "Profile GPU Rendering" tool.
- Accessibility: Does the animation obey "Reduce Motion" settings?
- Recomposition: Does the animation cause the whole screen to recompose? (Optimize!)
- Edge Cases: What happens if the animation is interrupted?
🔗 Related Resources
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

