A simple Android timer application built with Jetpack Compose that demonstrates the usage of Kotlin Flows, specifically StateFlow for state management.
Screen.Recording.2025-01-25.at.6.58.38.PM.mov
- Simple countdown timer functionality
- Real-time updates using StateFlow
- Clean MVVM architecture
- Material 3 Design implementation
- Haptic feedback on timer completion
- Visual feedback with customized Snackbar
The app showcases the power of StateFlow for reactive state management:
Key benefits demonstrated:
- Thread-safe state updates
- Hot stream of data that maintains the latest state
- Lifecycle-aware state management
- Efficient UI updates
The app implements vibration feedback when the timer completes:
- Version-aware implementation supporting Android 8.0 and above
- Customizable vibration patterns
- Integrated with visual feedback (Snackbar)
- ViewModel: Manages timer logic and state
- StateFlow: Handles reactive state updates
- Jetpack Compose: Declarative UI with state observation
- Material 3: Modern Android design implementation
- VibrationHelper: Utility class for handling device vibrations
- Clone the repository
- Open in Android Studio
- Run on an emulator or physical device
- Android Studio Arctic Fox or newer
- Minimum SDK: 24
- Kotlin 1.8.0 or higher
- Device with vibration capability
- Required Permissions:
android.permission.VIBRATE
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.