Skip to content

Commit 53afd26

Browse files
authored
Merge pull request #15 from shinhyo/chore
Update README.md & Library
2 parents 8f9c6ab + d9c184c commit 53afd26

File tree

4 files changed

+43
-27
lines changed

4 files changed

+43
-27
lines changed

README.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<p align="center">
44
<a href='https://developer.android.com'><img src='http://img.shields.io/badge/platform-android-green.svg'/></a>
55
<a href="https://kotlinlang.org/docs/whatsnew1920.html"><img src = "https://shields.io/badge/kotlin-2.0.20-blue" /></a>
6-
<a href="https://developer.android.com/jetpack/compose/bom"><img src = "https://img.shields.io/badge/jetpack%20compose-2024.08.00-brightgreen" /></a>
6+
<a href="https://developer.android.com/jetpack/compose/bom"><img src = "https://img.shields.io/badge/jetpack%20compose-2024.09.00-brightgreen" /></a>
77
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg"/></a>
88
</p>
99

@@ -16,14 +16,14 @@
1616
## Tech Stack
1717

1818
- [Jetpack](https://developer.android.com/jetpack)
19-
- Compose - Define your UI programmatically with composable functions that describe its shape
20-
and data dependencies.
21-
- Hilt - Extend the functionality of Dagger Hilt to enable dependency injection.
22-
- Lifecycle - Build lifecycle-aware components that can adjust behavior based on the current
23-
lifecycle state
24-
- Room - Create, store, and manage persistent data backed by a SQLite database.
25-
- ViewModel - Store and manage UI-related data in a lifecycle conscious.
26-
- App Startup - initialize components at app startup.
19+
- Compose - Define your UI programmatically with composable functions that describe its shape
20+
and data dependencies.
21+
- Hilt - Extend the functionality of Dagger Hilt to enable dependency injection.
22+
- Lifecycle - Build lifecycle-aware components that can adjust behavior based on the current
23+
lifecycle state
24+
- Room - Create, store, and manage persistent data backed by a SQLite database.
25+
- ViewModel - Store and manage UI-related data in a lifecycle conscious.
26+
- App Startup - initialize components at app startup.
2727
- Clean Architecture (multi module)
2828
- MVVM pattern
2929
- Kotlin
@@ -65,5 +65,26 @@
6565
   └── setting
6666
```
6767

68-
## Module Graphs
68+
The file structure is similar to Now in Android, but to follow Clean Architecture, the domain layer
69+
does not reference the data layer.
70+
71+
## Nested NavHosts
72+
73+
```mermaid
74+
graph TD
75+
A[Main NavHost] --> B[BottomBar]
76+
A --> C[Detail]
77+
B --> D[Bottom NavHost]
78+
D --> E[List]
79+
D --> F[Favorite]
80+
D --> G[Setting]
81+
```
82+
83+
Even though using nested NavHosts makes things more complex, this approach was chosen to achieve screen transition animations similar to those between Activities.
84+
85+
(One NavHost needs to manage how to hide the bottom navigation and apply animations during screen transitions.)
86+
87+
# Module Graphs
88+
6989
![](project.dot.png)
90+

core/designsystem/src/main/kotlin/io/github/shinhyo/brba/core/ui/BrbaIconFavorite.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import androidx.compose.foundation.layout.size
2323
import androidx.compose.material.icons.Icons
2424
import androidx.compose.material.icons.filled.Favorite
2525
import androidx.compose.material.icons.filled.FavoriteBorder
26-
import androidx.compose.material.ripple.rememberRipple
2726
import androidx.compose.material3.Icon
27+
import androidx.compose.material3.ripple
2828
import androidx.compose.runtime.Composable
2929
import androidx.compose.runtime.remember
3030
import androidx.compose.ui.Modifier
@@ -49,7 +49,7 @@ fun BrbaIconFavorite(
4949
.clickable(
5050
onClick = onClick,
5151
interactionSource = remember { MutableInteractionSource() },
52-
indication = rememberRipple(bounded = false),
52+
indication = ripple(bounded = false),
5353
),
5454
)
5555
}

feature/detail/src/main/kotlin/io/github/shinhyo/brba/feature/detail/DetailViewModel.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package io.github.shinhyo.brba.feature.detail
1818
import androidx.lifecycle.SavedStateHandle
1919
import androidx.lifecycle.ViewModel
2020
import androidx.lifecycle.viewModelScope
21+
import androidx.navigation.toRoute
2122
import dagger.hilt.android.lifecycle.HiltViewModel
2223
import io.github.shinhyo.brba.core.common.result.Result
2324
import io.github.shinhyo.brba.core.common.result.asResult
@@ -47,12 +48,7 @@ class DetailViewModel @Inject constructor(
4748
private val updateFavoriteUseCase: UpdateFavoriteUseCase,
4849
) : ViewModel() {
4950

50-
private val args: Detail by lazy {
51-
Detail(
52-
id = checkNotNull(savedStateHandle.get<Long>("id")),
53-
image = checkNotNull(savedStateHandle.get<String>("image")),
54-
)
55-
}
51+
private val args = savedStateHandle.toRoute<Detail>()
5652

5753
private val _imageState = MutableStateFlow(args.id to args.image)
5854
val imageState = _imageState.asStateFlow()

gradle/libs.versions.toml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,33 @@ targetSdkVer = "34"
66
minSdkVer = "28"
77

88
androidGradlePlugin = "8.5.2"
9-
androidTools = "31.5.2"
9+
androidTools = "31.6.0"
1010

1111
# https://github.com/JetBrains/kotlin/releases
1212
kotlin = "2.0.20"
1313
# https://github.com/google/ksp/releases
14-
ksp = "2.0.20-1.0.24"
15-
androidDesugarJdkLibs = "2.1.0"
14+
ksp = "2.0.20-1.0.25"
15+
androidDesugarJdkLibs = "2.1.2"
1616

1717
kotlinxCoroutines = "1.8.1"
1818
kotlinxSerializationJson = "1.7.1"
1919

2020
androidxCore = "1.13.1"
2121
androidxCoreSplashscreen = "1.0.1"
2222
androidxAppCompat = "1.7.0"
23-
androidxActivity = "1.9.1"
23+
androidxActivity = "1.9.2"
2424
androidxStartup = "1.1.1"
2525
androidxHiltNavigationCompose = "1.2.0"
26-
androidxLifecycle = "2.8.4"
26+
androidxLifecycle = "2.8.5"
2727
androidxDataStore = "1.1.1"
2828

29-
androidxComposeBom = "2024.08.00"
30-
androidxCompose = "1.7.0-rc01"
29+
androidxComposeBom = "2024.09.00"
3130
androidxComposeMaterial3 = "1.1.2"
3231

3332
hilt = "2.51.1"
3433
hiltExt = "1.0.0"
3534

36-
androidxNavigation = "2.8.0-rc01"
35+
androidxNavigation = "2.8.0"
3736

3837
junit4 = "4.13.2"
3938
androidxTestCore = "1.6.1"
@@ -95,7 +94,7 @@ androidx-compose-ui-testManifest = { group = "androidx.compose.ui", name = "ui-t
9594
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
9695
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
9796
androidx-compose-ui-util = { group = "androidx.compose.ui", name = "ui-util" }
98-
androidx-compose-animation = { group = "androidx.compose.animation", name = "animation", version.ref = "androidxCompose" }
97+
androidx-compose-animation = { group = "androidx.compose.animation", name = "animation" }
9998

10099
# hilt
101100
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }

0 commit comments

Comments
 (0)