Skip to content

Commit 6fa3d25

Browse files
authored
Merge pull request #46 from rbqks529/ui/#44-group_home
[UI] 모임페이지 홈 추가 UI 구현
2 parents 4fc60d8 + c01329c commit 6fa3d25

32 files changed

Lines changed: 2169 additions & 473 deletions

.idea/codeStyles/Project.xml

Lines changed: 158 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/texthip/thip/ui/common/buttons/GenreChipButton.kt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,30 @@ import com.texthip.thip.ui.theme.ThipTheme.typography
2929
fun GenreChipButton(
3030
modifier: Modifier = Modifier,
3131
text: String,
32-
onClick: () -> Unit = { }
32+
onClick: () -> Unit = {},
33+
onCloseClick: () -> Unit = {}
3334
) {
3435
Box(
3536
modifier = modifier
3637
.border(
3738
width = 1.dp,
38-
color = colors.White,
39+
color = colors.Grey02,
3940
shape = RoundedCornerShape(20.dp)
4041
)
4142
.background(color = Color.Transparent, shape = RoundedCornerShape(12.dp))
42-
.padding(top = 4.dp, bottom = 4.dp, end = 8.dp, start = 12.dp)
43+
.padding(top = 8.dp, bottom = 8.dp, end = 8.dp, start = 12.dp)
4344
.clickable {
4445
onClick()
4546
},
4647
contentAlignment = Alignment.Center,
4748
) {
4849
Row(
4950
verticalAlignment = Alignment.CenterVertically,
50-
horizontalArrangement = Arrangement.spacedBy(2.dp),
51+
horizontalArrangement = Arrangement.spacedBy(4.dp),
5152
) {
5253
Text(
5354
text = text,
54-
color = colors.White,
55+
color = colors.Grey01,
5556
style = typography.info_r400_s12,
5657
)
5758
Icon(
@@ -60,6 +61,9 @@ fun GenreChipButton(
6061
tint = Color.Unspecified,
6162
modifier = Modifier
6263
.size(20.dp)
64+
.clickable {
65+
onCloseClick()
66+
}
6367
)
6468
}
6569
}

app/src/main/java/com/texthip/thip/ui/common/buttons/GenreChipRow.kt

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import androidx.compose.runtime.Composable
55
import androidx.compose.ui.Modifier
66
import androidx.compose.ui.tooling.preview.Preview
77
import androidx.compose.ui.unit.dp
8+
import com.texthip.thip.ui.theme.ThipTheme
89

910
@Composable
1011
fun GenreChipRow(
@@ -22,7 +23,13 @@ fun GenreChipRow(
2223
text = genre,
2324
isFilled = true,
2425
isSelected = selectedIndex == idx,
25-
onClick = { onSelect(idx) }
26+
onClick = {
27+
if (selectedIndex == idx) {
28+
onSelect(-1)
29+
} else {
30+
onSelect(idx)
31+
}
32+
}
2633
)
2734
if (idx < genres.size - 1) {
2835
Spacer(modifier = modifier)
@@ -31,12 +38,14 @@ fun GenreChipRow(
3138
}
3239
}
3340

34-
@Preview(showBackground = true, backgroundColor = 0xFF000000, widthDp = 360)
41+
@Preview()
3542
@Composable
3643
fun PreviewGenreChipRow() {
37-
GenreChipRow(
38-
genres = listOf("문학", "과학·IT", "사회과학", "인문학", "예술"),
39-
selectedIndex = 0,
40-
onSelect = {}
41-
)
44+
ThipTheme {
45+
GenreChipRow(
46+
genres = listOf("문학", "과학·IT", "사회과학", "인문학", "예술"),
47+
selectedIndex = 0,
48+
onSelect = {}
49+
)
50+
}
4251
}

app/src/main/java/com/texthip/thip/ui/common/cards/CardItemRoom.kt

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fun CardItemRoom(
4141
participants: Int,
4242
maxParticipants: Int,
4343
isRecruiting: Boolean,
44-
endDate: Int,
44+
endDate: Int? = null,
4545
imageRes: Int? = R.drawable.bookcover_sample,
4646
hasBorder: Boolean = false,
4747
onClick: () -> Unit = {}
@@ -91,9 +91,11 @@ fun CardItemRoom(
9191
Spacer(modifier = Modifier.width(16.dp))
9292

9393
Column(
94-
modifier = Modifier.fillMaxWidth()
94+
modifier = Modifier
95+
.fillMaxWidth()
96+
.height(107.dp),
97+
verticalArrangement = Arrangement.Center
9598
) {
96-
Spacer(modifier = Modifier.height(16.dp))
9799
Text(
98100
text = title,
99101
color = colors.White,
@@ -139,7 +141,10 @@ fun CardItemRoom(
139141
verticalAlignment = Alignment.CenterVertically
140142
) {
141143
Text(
142-
text = stringResource(R.string.card_item_participant, participants),
144+
text = stringResource(
145+
R.string.card_item_participating_count,
146+
participants
147+
),
143148
style = typography.menu_sb600_s12,
144149
color = colors.White
145150
)
@@ -153,20 +158,22 @@ fun CardItemRoom(
153158
}
154159
}
155160
}
156-
Spacer(modifier = Modifier.height(5.dp))
161+
endDate?.let {
162+
Spacer(modifier = Modifier.height(5.dp))
157163

158-
Text(
159-
text = stringResource(
160-
R.string.card_item_end_date,
161-
endDate
162-
) + if (isRecruiting) stringResource(
163-
R.string.card_item_end
164-
) else stringResource(R.string.card_item_finish),
164+
Text(
165+
text = stringResource(
166+
R.string.card_item_end_date,
167+
endDate
168+
) + if (isRecruiting) stringResource(
169+
R.string.card_item_end
170+
) else stringResource(R.string.card_item_finish),
165171

166-
color = if (isRecruiting) colors.Red else colors.Grey01,
167-
style = typography.menu_sb600_s12_h20,
168-
maxLines = 1
169-
)
172+
color = if (isRecruiting) colors.Red else colors.Grey01,
173+
style = typography.menu_sb600_s12_h20,
174+
maxLines = 1
175+
)
176+
}
170177
}
171178
}
172179
}
@@ -213,6 +220,14 @@ fun CardItemRoomPreview() {
213220
imageRes = R.drawable.bookcover_sample,
214221
hasBorder = true
215222
)
223+
CardItemRoom(
224+
title = "모임방 이름입니다. 모임방 이름입니다.",
225+
participants = 22,
226+
maxParticipants = 30,
227+
isRecruiting = false,
228+
imageRes = R.drawable.bookcover_sample,
229+
hasBorder = true
230+
)
216231
}
217232
}
218233
}

0 commit comments

Comments
 (0)