Skip to content

Commit 2c3b9e7

Browse files
authored
Merge pull request #219 from YAPP-Github/BOOK-427-fix/#218
fix: 디자인 QA 반영
2 parents 07596ab + c9c1ccd commit 2c3b9e7

File tree

9 files changed

+44
-28
lines changed

9 files changed

+44
-28
lines changed

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultRemoteConfigRepository.kt

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,32 @@ package com.ninecraft.booket.core.data.impl.repository
33
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
44
import com.google.firebase.remoteconfig.get
55
import com.ninecraft.booket.core.common.utils.isUpdateRequired
6+
import com.ninecraft.booket.core.common.utils.runSuspendCatching
67
import com.ninecraft.booket.core.data.api.repository.RemoteConfigRepository
78
import com.ninecraft.booket.core.data.impl.BuildConfig
89
import com.orhanobut.logger.Logger
9-
import kotlinx.coroutines.suspendCancellableCoroutine
10+
import kotlinx.coroutines.tasks.await
1011
import javax.inject.Inject
11-
import kotlin.coroutines.resume
1212

1313
class DefaultRemoteConfigRepository @Inject constructor(
1414
private val remoteConfig: FirebaseRemoteConfig,
1515
) : RemoteConfigRepository {
16-
override suspend fun getLatestVersion(): Result<String> = suspendCancellableCoroutine { continuation ->
17-
remoteConfig.fetchAndActivate().addOnCompleteListener { task ->
18-
if (task.isSuccessful) {
19-
val latestVersion = remoteConfig[KEY_LATEST_VERSION].asString()
20-
Logger.d("LatestVersion: $latestVersion")
21-
continuation.resume(Result.success(latestVersion))
22-
} else {
23-
Logger.e(task.exception, "getLatestVersion failed")
24-
continuation.resume(Result.failure(task.exception ?: Exception("Unknown error")))
25-
}
26-
}
16+
override suspend fun getLatestVersion(): Result<String> = runSuspendCatching {
17+
remoteConfig.fetchAndActivate().await()
18+
val latestVersion = remoteConfig[KEY_LATEST_VERSION].asString()
19+
Logger.d("LatestVersion: $latestVersion")
20+
latestVersion
21+
}.onFailure { exception ->
22+
Logger.e(exception, "getLatestVersion failed")
2723
}
2824

29-
override suspend fun shouldUpdate(): Result<Boolean> = suspendCancellableCoroutine { continuation ->
30-
remoteConfig.fetchAndActivate().addOnCompleteListener { task ->
31-
if (task.isSuccessful) {
32-
val minVersion = remoteConfig[KEY_MIN_VERSION].asString()
33-
val currentVersion = BuildConfig.APP_VERSION
34-
continuation.resume(Result.success(isUpdateRequired(currentVersion, minVersion)))
35-
} else {
36-
Logger.e(task.exception, "shouldUpdate: getMinVersion failed")
37-
continuation.resume(Result.failure(task.exception ?: Exception("Unknown error")))
38-
}
39-
}
25+
override suspend fun shouldUpdate(): Result<Boolean> = runSuspendCatching {
26+
remoteConfig.fetchAndActivate().await()
27+
val minVersion = remoteConfig[KEY_MIN_VERSION].asString()
28+
val currentVersion = BuildConfig.APP_VERSION
29+
isUpdateRequired(currentVersion, minVersion)
30+
}.onFailure { exception ->
31+
Logger.e(exception, "shouldUpdate: getMinVersion failed")
4032
}
4133

4234
companion object {

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/component/BookItem.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.ninecraft.booket.feature.detail.record.component
22

3+
import androidx.compose.foundation.border
34
import androidx.compose.foundation.layout.BoxWithConstraints
45
import androidx.compose.foundation.layout.Column
56
import androidx.compose.foundation.layout.Row
@@ -48,7 +49,12 @@ internal fun BookItem(
4849
.padding(end = ReedTheme.spacing.spacing4)
4950
.width(46.dp)
5051
.height(68.dp)
51-
.clip(RoundedCornerShape(size = ReedTheme.radius.xs)),
52+
.clip(RoundedCornerShape(size = ReedTheme.radius.xs))
53+
.border(
54+
width = 1.dp,
55+
color = ReedTheme.colors.borderPrimary,
56+
shape = RoundedCornerShape(ReedTheme.radius.xs),
57+
),
5258
placeholder = painterResource(R.drawable.ic_placeholder),
5359
)
5460
Column(modifier = Modifier.weight(1f)) {
65.1 KB
Loading
67.9 KB
Loading
62.1 KB
Loading
68.7 KB
Loading

feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/component/LibraryBookItem.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.ninecraft.booket.feature.library.component
22

3+
import androidx.compose.foundation.border
34
import androidx.compose.foundation.layout.BoxWithConstraints
45
import androidx.compose.foundation.layout.Column
56
import androidx.compose.foundation.layout.Row
@@ -52,7 +53,12 @@ fun LibraryBookItem(
5253
)
5354
.width(68.dp)
5455
.height(100.dp)
55-
.clip(RoundedCornerShape(size = ReedTheme.radius.sm)),
56+
.clip(RoundedCornerShape(size = ReedTheme.radius.sm))
57+
.border(
58+
width = 1.dp,
59+
color = ReedTheme.colors.borderPrimary,
60+
shape = RoundedCornerShape(ReedTheme.radius.sm),
61+
),
5662
placeholder = painterResource(designR.drawable.ic_placeholder),
5763
)
5864
Column(modifier = Modifier.weight(1f)) {

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookItem.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.ninecraft.booket.feature.search.book.component
22

33
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.border
45
import androidx.compose.foundation.clickable
56
import androidx.compose.foundation.layout.Box
67
import androidx.compose.foundation.layout.BoxWithConstraints
@@ -65,7 +66,12 @@ fun BookItem(
6566
)
6667
.width(68.dp)
6768
.height(100.dp)
68-
.clip(RoundedCornerShape(size = ReedTheme.radius.sm)),
69+
.clip(RoundedCornerShape(size = ReedTheme.radius.sm))
70+
.border(
71+
width = 1.dp,
72+
color = ReedTheme.colors.borderPrimary,
73+
shape = RoundedCornerShape(ReedTheme.radius.sm),
74+
),
6975
) {
7076
NetworkImage(
7177
imageUrl = book.coverImageUrl,

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/component/LibraryBookItem.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.ninecraft.booket.feature.search.library.component
22

3+
import androidx.compose.foundation.border
34
import androidx.compose.foundation.layout.BoxWithConstraints
45
import androidx.compose.foundation.layout.Column
56
import androidx.compose.foundation.layout.Row
@@ -52,7 +53,12 @@ fun LibraryBookItem(
5253
)
5354
.width(68.dp)
5455
.height(100.dp)
55-
.clip(RoundedCornerShape(size = ReedTheme.radius.sm)),
56+
.clip(RoundedCornerShape(size = ReedTheme.radius.sm))
57+
.border(
58+
width = 1.dp,
59+
color = ReedTheme.colors.borderPrimary,
60+
shape = RoundedCornerShape(ReedTheme.radius.sm),
61+
),
5662
placeholder = painterResource(designR.drawable.ic_placeholder),
5763
)
5864
Column(modifier = Modifier.weight(1f)) {

0 commit comments

Comments
 (0)