Skip to content

πŸ§ͺ ☠︎ Jetpack Compose - Breaking Bad

License

Notifications You must be signed in to change notification settings

shinhyo/Compose-BreakingBad

Repository files navigation

πŸ§ͺ Breaking Bad - Jetpack Compose

Tech Stack

  • Jetpack
    • Compose - Define your UI programmatically with composable functions that describe its shape and data dependencies.
    • Hilt - Extend the functionality of Dagger Hilt to enable dependency injection.
    • Lifecycle - Build lifecycle-aware components that can adjust behavior based on the current lifecycle state
    • Room - Create, store, and manage persistent data backed by a SQLite database.
    • ViewModel - Store and manage UI-related data in a lifecycle conscious.
    • App Startup - initialize components at app startup.
  • Clean Architecture (multi module)
  • MVVM pattern
  • Kotlin
    • Coroutines
    • Flows
    • Serialization
  • Type Safety Navigation
  • Material Design 3
  • Single Activity
  • StaggeredVerticalGrid
  • Gradle Version Catalog
  • Retrofit2
  • Coil-Compose
  • Timber
  • Haze
  • SharedElement
  • Kover

Multi Module

β”œβ”€β”€ app
β”œβ”€β”€ core
β”‚Β Β  β”œβ”€β”€ common
β”‚Β Β  β”œβ”€β”€ data
β”‚Β Β  β”œβ”€β”€ database
β”‚Β Β  β”œβ”€β”€ datastore
β”‚Β Β  β”œβ”€β”€ designsystem
β”‚Β Β  β”œβ”€β”€ domain
β”‚Β Β  β”œβ”€β”€ model
β”‚Β Β  └── network
└── feature
 Β Β  β”œβ”€β”€ bottombar
 Β Β  β”œβ”€β”€ detail
 Β Β  β”œβ”€β”€ favorite
 Β Β  β”œβ”€β”€ list
 Β Β  β”œβ”€β”€ main
 Β Β  └── setting

The file structure is similar to Now in Android, but to follow Clean Architecture, the domain layer does not reference the data layer.

Nested NavHosts

graph TD
    A[Main NavHost] --> B[BottomBar]
    A --> C[Detail]
    B --> D[Bottom NavHost]
    D --> E[List]
    D --> F[Favorite]
    D --> G[Setting]
Loading

Even though using nested NavHosts makes things more complex, this approach was chosen to achieve screen transition animations similar to those between Activities.

(One NavHost needs to manage how to hide the bottom navigation and apply animations during screen transitions.)

Module Graphs