Skip to content

Commit c5ae3b2

Browse files
authored
Merge pull request #101 from YAPP-Github/BOOK-215-feature/#100
feat: 홈, 도서 상세화면 디자인 반영 및 클릭 영역 조정
2 parents 42923f5 + a7f505f commit c5ae3b2

File tree

6 files changed

+95
-84
lines changed

6 files changed

+95
-84
lines changed

core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ interface ReedService {
4545
suspend fun searchBook(
4646
@Query("query") query: String,
4747
@Query("queryType") queryType: String = "Title",
48-
@Query("searchTarget") searchTarget: String? = null,
48+
@Query("searchTarget") searchTarget: String = "Book",
4949
@Query("maxResults") maxResults: Int = 20,
5050
@Query("start") start: Int = 1,
5151
@Query("sort") sort: String = "Accuracy",
5252
@Query("cover") cover: String? = "Big",
53-
@Query("categoryId") categoryId: Int? = null,
53+
@Query("categoryId") categoryId: Int = 0,
5454
): BookSearchResponse
5555

5656
@GET("api/v1/books/detail")

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.height
99
import androidx.compose.foundation.layout.padding
1010
import androidx.compose.foundation.layout.size
1111
import androidx.compose.foundation.layout.width
12+
import androidx.compose.foundation.layout.widthIn
1213
import androidx.compose.foundation.rememberScrollState
1314
import androidx.compose.foundation.shape.RoundedCornerShape
1415
import androidx.compose.foundation.verticalScroll
@@ -204,7 +205,7 @@ internal fun BookDetailContent(
204205
text = "읽는 중",
205206
sizeStyle = largeButtonStyle,
206207
colorStyle = ReedButtonColorStyle.SECONDARY,
207-
modifier = Modifier.weight(1f),
208+
modifier = Modifier.widthIn(min = 98.dp),
208209
trailingIcon = {
209210
Icon(
210211
imageVector = ImageVector.vectorResource(designR.drawable.ic_chevron_down),
@@ -222,7 +223,7 @@ internal fun BookDetailContent(
222223
text = "독서 기록 추가",
223224
sizeStyle = largeButtonStyle,
224225
colorStyle = ReedButtonColorStyle.PRIMARY,
225-
modifier = Modifier.weight(2.34f),
226+
modifier = Modifier.weight(1f),
226227
)
227228
}
228229

feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUi.kt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,25 @@ internal fun HomeUi(
4343
) {
4444
HandleHomeSideEffects(state = state)
4545

46-
Column(
47-
modifier = modifier.fillMaxSize(),
48-
) {
49-
// TODO: Android 15에서 statusBar 색상 적용 안되는 문제 있음. 해결 예정.
50-
val systemUiController = rememberSystemUiController()
46+
// TODO: Android 15에서 statusBar 색상 적용 안되는 문제 있음. 해결 예정.
47+
val systemUiController = rememberSystemUiController()
5148

52-
DisposableEffect(systemUiController) {
49+
DisposableEffect(systemUiController) {
50+
systemUiController.setStatusBarColor(
51+
color = HomeBg,
52+
darkIcons = true,
53+
)
54+
onDispose {
5355
systemUiController.setStatusBarColor(
54-
color = HomeBg,
56+
color = White,
5557
darkIcons = true,
5658
)
57-
onDispose {
58-
systemUiController.setStatusBarColor(
59-
color = White,
60-
darkIcons = true,
61-
)
62-
}
6359
}
60+
}
6461

62+
Column(
63+
modifier = modifier.fillMaxSize(),
64+
) {
6565
HomeHeader(
6666
onSettingsClick = {
6767
state.eventSink(HomeUiEvent.OnSettingsClick)

feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/component/BookCard.kt

Lines changed: 62 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -70,73 +70,75 @@ fun BookCard(
7070
width = 1.dp,
7171
color = ReedTheme.colors.borderSecondary,
7272
shape = RoundedCornerShape(ReedTheme.radius.sm),
73-
)
74-
.padding(
75-
start = ReedTheme.spacing.spacing5,
76-
top = ReedTheme.spacing.spacing6,
77-
end = ReedTheme.spacing.spacing5,
78-
bottom = ReedTheme.spacing.spacing5,
7973
),
8074
horizontalAlignment = Alignment.CenterHorizontally,
8175
) {
82-
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing5))
83-
NetworkImage(
84-
imageUrl = recentBookInfo.coverImageUrl,
85-
contentDescription = "Book CoverImage",
76+
Column(
8677
modifier = Modifier
87-
.width(86.dp)
88-
.height(125.dp)
89-
.clip(RoundedCornerShape(size = ReedTheme.radius.sm))
90-
.border(
91-
width = 1.dp,
92-
color = ReedTheme.colors.borderPrimary,
93-
shape = RoundedCornerShape(ReedTheme.radius.sm),
94-
)
95-
.noRippleClickable {
96-
onBookDetailClick()
97-
},
98-
placeholder = painterResource(designR.drawable.ic_placeholder),
99-
)
100-
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing5))
101-
Text(
102-
text = recentBookInfo.title,
103-
color = ReedTheme.colors.contentPrimary,
104-
overflow = TextOverflow.Ellipsis,
105-
maxLines = 1,
106-
style = ReedTheme.typography.headline1SemiBold,
107-
)
108-
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing1))
109-
Row(
110-
modifier = Modifier.fillMaxWidth(),
111-
verticalAlignment = Alignment.CenterVertically,
112-
horizontalArrangement = Arrangement.Center,
78+
.padding(bottom = ReedTheme.spacing.spacing6)
79+
.noRippleClickable { onBookDetailClick() }
80+
.padding(horizontal = ReedTheme.spacing.spacing5),
81+
horizontalAlignment = Alignment.CenterHorizontally,
11382
) {
114-
Text(
115-
text = recentBookInfo.author,
116-
color = ReedTheme.colors.contentTertiary,
117-
overflow = TextOverflow.Ellipsis,
118-
maxLines = 1,
119-
style = ReedTheme.typography.label1Medium,
120-
modifier = Modifier.weight(0.7f, fill = false),
121-
)
122-
Spacer(Modifier.width(ReedTheme.spacing.spacing1))
123-
VerticalDivider(
124-
modifier = Modifier.height(14.dp),
125-
thickness = 1.dp,
126-
color = ReedTheme.colors.contentTertiary,
83+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing10))
84+
NetworkImage(
85+
imageUrl = recentBookInfo.coverImageUrl,
86+
contentDescription = "Book CoverImage",
87+
modifier = Modifier
88+
.width(86.dp)
89+
.height(125.dp)
90+
.clip(RoundedCornerShape(size = ReedTheme.radius.sm))
91+
.border(
92+
width = 1.dp,
93+
color = ReedTheme.colors.borderPrimary,
94+
shape = RoundedCornerShape(ReedTheme.radius.sm),
95+
),
96+
placeholder = painterResource(designR.drawable.ic_placeholder),
12797
)
128-
Spacer(Modifier.width(ReedTheme.spacing.spacing1))
98+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing5))
12999
Text(
130-
text = recentBookInfo.publisher,
131-
color = ReedTheme.colors.contentTertiary,
100+
text = recentBookInfo.title,
101+
color = ReedTheme.colors.contentPrimary,
132102
overflow = TextOverflow.Ellipsis,
133103
maxLines = 1,
134-
style = ReedTheme.typography.label1Medium,
135-
modifier = Modifier.weight(0.3f, fill = false),
104+
style = ReedTheme.typography.headline1SemiBold,
136105
)
106+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing1))
107+
Row(
108+
modifier = Modifier.fillMaxWidth(),
109+
verticalAlignment = Alignment.CenterVertically,
110+
horizontalArrangement = Arrangement.Center,
111+
) {
112+
Text(
113+
text = recentBookInfo.author,
114+
color = ReedTheme.colors.contentTertiary,
115+
overflow = TextOverflow.Ellipsis,
116+
maxLines = 1,
117+
style = ReedTheme.typography.label1Medium,
118+
modifier = Modifier.weight(0.7f, fill = false),
119+
)
120+
Spacer(Modifier.width(ReedTheme.spacing.spacing1))
121+
VerticalDivider(
122+
modifier = Modifier.height(14.dp),
123+
thickness = 1.dp,
124+
color = ReedTheme.colors.contentTertiary,
125+
)
126+
Spacer(Modifier.width(ReedTheme.spacing.spacing1))
127+
Text(
128+
text = recentBookInfo.publisher,
129+
color = ReedTheme.colors.contentTertiary,
130+
overflow = TextOverflow.Ellipsis,
131+
maxLines = 1,
132+
style = ReedTheme.typography.label1Medium,
133+
modifier = Modifier.weight(0.3f, fill = false),
134+
)
135+
}
136+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing5))
137137
}
138-
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing5))
139-
Row(verticalAlignment = Alignment.CenterVertically) {
138+
Row(
139+
modifier = Modifier.padding(horizontal = ReedTheme.spacing.spacing5),
140+
verticalAlignment = Alignment.CenterVertically,
141+
) {
140142
Row(
141143
modifier = Modifier
142144
.background(
@@ -187,6 +189,7 @@ fun BookCard(
187189
},
188190
)
189191
}
192+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing5))
190193
}
191194
}
192195

@@ -215,18 +218,18 @@ fun EmptyBookCard(
215218
)
216219
.padding(
217220
start = ReedTheme.spacing.spacing5,
218-
top = ReedTheme.spacing.spacing6,
219221
end = ReedTheme.spacing.spacing5,
220222
bottom = ReedTheme.spacing.spacing5,
221223
),
222224
horizontalAlignment = Alignment.CenterHorizontally,
223225
) {
224-
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing5))
226+
Spacer(modifier = Modifier.height(52.dp))
225227
ResourceImage(
226228
imageRes = R.drawable.img_empty_book,
227229
contentDescription = "Empty Book",
230+
modifier = Modifier.size(112.dp),
228231
)
229-
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing5))
232+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing6))
230233
Text(
231234
text = stringResource(R.string.empty_book_card_title),
232235
color = ReedTheme.colors.contentPrimary,

feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/component/HomeBanner.kt

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import androidx.compose.ui.unit.dp
2020
import com.ninecraft.booket.core.common.extensions.clickableSingle
2121
import com.ninecraft.booket.core.designsystem.ComponentPreview
2222
import com.ninecraft.booket.core.designsystem.component.ResourceImage
23-
import com.ninecraft.booket.core.designsystem.R as designR
2423
import com.ninecraft.booket.core.designsystem.theme.HomeBg
2524
import com.ninecraft.booket.core.designsystem.theme.ReedTheme
2625
import com.ninecraft.booket.feature.home.R
26+
import com.ninecraft.booket.core.designsystem.R as designR
2727

2828
@Composable
2929
fun HomeBanner(
@@ -34,14 +34,15 @@ fun HomeBanner(
3434
modifier = modifier
3535
.fillMaxWidth()
3636
.height(160.dp)
37-
.background(HomeBg)
38-
.padding(
37+
.background(HomeBg),
38+
) {
39+
Column(
40+
modifier = Modifier.padding(
3941
top = ReedTheme.spacing.spacing4,
4042
start = ReedTheme.spacing.spacing6,
4143
end = ReedTheme.spacing.spacing5,
4244
),
43-
) {
44-
Column {
45+
) {
4546
Text(
4647
text = stringResource(R.string.home_banner_title),
4748
color = ReedTheme.colors.contentPrimary,
@@ -66,11 +67,19 @@ fun HomeBanner(
6667
)
6768
}
6869
}
70+
Spacer(
71+
modifier = Modifier
72+
.fillMaxWidth()
73+
.height(5.dp)
74+
.background(ReedTheme.colors.baseSecondary)
75+
.align(Alignment.BottomCenter),
76+
)
6977
ResourceImage(
7078
imageRes = R.drawable.img_home_seed,
7179
contentDescription = "Home Seed Image",
7280
modifier = Modifier
73-
.align(Alignment.BottomEnd),
81+
.align(Alignment.BottomEnd)
82+
.padding(end = ReedTheme.spacing.spacing5),
7483
)
7584
}
7685
}

feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUi.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ internal fun LibraryUi(
4545

4646
Column(
4747
modifier = modifier.fillMaxSize(),
48-
horizontalAlignment = Alignment.CenterHorizontally,
49-
verticalArrangement = Arrangement.Center,
5048
) {
5149
LibraryContent(
5250
state = state,

0 commit comments

Comments
 (0)