A robust, offline-first Android application built with Kotlin and Jetpack Compose. This project demonstrates modern Android development practices, featuring paginated data caching, custom UI animations, text-to-speech integration.
- Offline-First Pagination: Seamless infinite scrolling using Paging 3 with a RemoteMediator that caches data into a Room database.
- Favorites System: Save your favorite brews locally to access them anytime.
- Text-to-Speech (TTS): Listen to beer descriptions with a built-in accessibility player.
- Custom Navigation: A custom-built Animated Bottom Navigation Bar using Canvas and Spring animations.
- Language: Kotlin
- UI: Jetpack Compose (Material3)
- Architecture: MVVM (Model-View-ViewModel) with Unidirectional Data Flow (MVI pattern for Events/State)
- Dependency Injection: Dagger Hilt
- Network: Retrofit & Moshi
- Local Storage: Room Database
- Pagination: Paging 3
- Image Loading: Coil
- Asynchronous: Coroutines & Flow
- Navigation: Jetpack Navigation Compose
The app follows the Repository Pattern and Clean Architecture principles.
- Data Layer:
- Remote: Retrofit service fetching data from the API.
- Local: Room database acting as the single source of truth.
- Mediator: BeerRemoteMediator coordinates fetching data from the network and saving it to the DB for the Paging library.
- Domain Layer:
- Contains pure data classes (Beer) and Mappers.
- Resource sealed class handles UI states (Success, Error, Loading) for detail operations.
- UI Layer:
- ViewModels: Handle business logic and expose StateFlow to Composables. Use a robust onEvent pattern for user interactions.
- Composables: Stateless UI components that react to state changes.
- Clone the repository:
- Open in Android Studio:
Ensure you are using the latest version of Android Studio (Koala or newer recommended). - Configure API:
- API source - https://github.com/alxiw/punkapi
- Navigate to Constant.
- Update the IMAGE_BASE_URL constant if you are hosting the images locally or on a different server.
private const val IMAGE_BASE_URL = "[https://your-api-host.com/images\](https://your-api-host.com/images)"
- Run the App:
Connect your device or start an emulator and run the application.