android-viewmodel
CommunityMaster Android ViewModel best practices.
AuthorAerisG222
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill provides clear guidelines and best practices for implementing Android ViewModels, focusing on efficient state management for modern Android development using Jetpack Compose and Views.
Core Features & Use Cases
- StateFlow for UI State: Manages persistent UI states (loading, success, error) with proper initialization and thread-safe updates.
- SharedFlow for Events: Handles transient UI events (toasts, navigation) without re-triggering on configuration changes.
- UI Collection Strategies: Demonstrates how to collect state and events in both Compose and traditional View-based UIs using lifecycle-aware methods.
- Use Case: Ensure your Android app's UI state is robustly managed, reacting correctly to user interactions and system events while surviving configuration changes.
Quick Start
Implement the provided ViewModel pattern using StateFlow for UI state and SharedFlow for one-off events.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: android-viewmodel Download link: https://github.com/AerisG222/maw-photos-android/archive/main.zip#android-viewmodel Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.