Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a7397ea
[UI] 파일명 수정 및 CardItemRoom 추가 (#25)
rbqks529 Jun 24, 2025
764672e
Merge pull request #2 from rbqks529/develop
rbqks529 Jun 24, 2025
7667ca7
[UI] 기존 OptionChipButton 수정 및 CardItemRoomData 추가 (#25)
rbqks529 Jun 26, 2025
b9478be
[UI] CardItemRoomSmall 추가 (#25)
rbqks529 Jun 27, 2025
f85d220
[UI] GroupRoomScreen(모임방 내부 페이지) 추가 (#25)
rbqks529 Jun 27, 2025
b4ed51a
[UI] GroupRoomScreen(모임방 페이지) 구현 - 1 (#25)
rbqks529 Jun 27, 2025
77a563e
[UI] GrpupPageScreen 임시 TopBar 추가 및 검색 component 구현 (#25)
rbqks529 Jun 30, 2025
e33d471
[UI] 내 모임방 페이지, 장르 칩 버튼 구현 (#25)
rbqks529 Jun 30, 2025
ce38896
[UI] 마감 임박한 독서 모임방 구현 (#25)
rbqks529 Jun 30, 2025
67d9bc1
[UI] 네비게이션 모임에 해당하는 페이지 구현 (#25)
rbqks529 Jun 30, 2025
fc316b8
[UI] import 최적화, stringResource 추출 (#25)
rbqks529 Jun 30, 2025
15c7670
Merge branch 'UI-#25]' into develop
rbqks529 Jun 30, 2025
fd29940
Merge pull request #3 from THIP-TextHip/develop
rbqks529 Jun 30, 2025
717d13c
[UI] TopAppBar 수정 (#25)
rbqks529 Jun 30, 2025
acdbc13
[Refactor] FormTextFieldDefault에서 Boolean 값으로 아이콘과 limit을 구분할 수 있도록 수정
rbqks529 Jun 30, 2025
ff0a7d5
[Refactor] NotificationCard의 Badge Text를 파라미터로 받도록 수정
rbqks529 Jun 30, 2025
621e9d8
[Refactor] CardAlam 함수 이름 수정
rbqks529 Jun 30, 2025
30a4423
[refactor]: PR 기반으로 StringResource 추출 (#25)
rbqks529 Jul 1, 2025
e49f283
[refactor]: Padding 수정 및 상태값 수정 (#25)
rbqks529 Jul 1, 2025
448aa6e
[refactor]: 색을 파라미터로 입력 받을 수 있게 수정(#25)
rbqks529 Jul 1, 2025
2f60da1
[refactor]: dependency방식 수정 (#25)
rbqks529 Jul 2, 2025
a8c48a7
[feat]: ChipButton 복구 및 Screen 버튼 작동 방식 수정 (#25)
rbqks529 Jul 2, 2025
836f60b
[refactor]: Preview ThipTheme으로 수정해보기 (#25)
rbqks529 Jul 2, 2025
1f4a111
[refactor]: 파일명 수정 및 enum class 추출 (#25)
rbqks529 Jul 2, 2025
dee751b
[refactor]: 파일명 수정 및 enum class 추출 (#25)
rbqks529 Jul 2, 2025
bdb5e85
[feat]: Chip 버튼 로직 수정 (#25)
rbqks529 Jul 2, 2025
bf69a77
[UI]: 독서 모임방을 Pager로 구성 (#25)
rbqks529 Jul 2, 2025
8e005c4
[refactor]: 프로젝트 구조 수정 (#25)
rbqks529 Jul 2, 2025
3e8bf5c
[ui]: String 추출 및 LazyColumn을 Column으로 변경 (#25)
rbqks529 Jul 2, 2025
59e7cda
[refactor]: preview 수정 (#25)
rbqks529 Jul 2, 2025
b879c35
[refactor]: StringResource를 snake_case로 변경 (#25)
rbqks529 Jul 2, 2025
f46d9db
[ui]: 세부적으로 stringResource 추출 및 ui 디테일 구현 (#25)
rbqks529 Jul 2, 2025
d70deb5
Merge branch 'develop' into UI-#25]
rbqks529 Jul 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.gradle.kotlin.dsl.implementation

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
Expand Down Expand Up @@ -50,6 +52,9 @@ dependencies {
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.navigation.runtime.android)
implementation(libs.accompanist.pager)
implementation(libs.accompanist.pager.indicators)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,24 @@ fun OptionChipButton(
modifier: Modifier = Modifier,
text: String,
isFilled: Boolean = false,
isSelected: Boolean? = null, // 추가
onClick: () -> Unit,
) {
var isClicked by remember { mutableStateOf(false) }
val checked = isSelected ?: isClicked

val textColor = when {
isFilled -> colors.White
isClicked -> colors.Purple
checked -> colors.Purple
else -> colors.Grey01
}
val backgroundColor = when {
isFilled && isClicked -> colors.Purple
isFilled && checked -> colors.Purple
isFilled -> colors.DarkGrey
else -> Color.Transparent
}
val borderColor = when {
!isFilled && isClicked -> colors.Purple
!isFilled && checked -> colors.Purple
!isFilled -> colors.Grey02
else -> Color.Transparent
}
Expand All @@ -62,7 +64,7 @@ fun OptionChipButton(
shape = RoundedCornerShape(20.dp)
)
.clickable {
isClicked = !isClicked
if (isSelected == null) isClicked = !isClicked
onClick()
}
.padding(vertical = 8.dp, horizontal = 12.dp),
Expand Down
43 changes: 37 additions & 6 deletions app/src/main/java/com/texthip/thip/ui/common/cards/CardAlarm.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.texthip.thip.ui.common.cards

import androidx.compose.ui.graphics.Color
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
Expand Down Expand Up @@ -34,20 +35,23 @@ import com.texthip.thip.ui.theme.ThipTheme.typography


@Composable
fun NotificationCard(
fun CardAlarm(
modifier: Modifier = Modifier,
badgeText: String,
title: String,
message: String,
timeAgo: String,
isRead: Boolean = false,
containerColorUnread: Color = colors.DarkGrey, // 안읽음 상태의 배경색
containerColorRead: Color = colors.DarkGrey02, // 읽음 상태의 배경색
onClick: () -> Unit = {}
) {
Card(
modifier = modifier
.fillMaxWidth()
.clickable { onClick() },
colors = CardDefaults.cardColors(
containerColor = if (isRead) colors.DarkGrey else colors.DarkGrey02
containerColor = if (isRead) containerColorUnread else containerColorRead
),
elevation = CardDefaults.cardElevation(defaultElevation = 2.dp),
shape = RoundedCornerShape(12.dp)
Expand All @@ -65,7 +69,6 @@ fun NotificationCard(
// 뱃지
Box(
modifier = Modifier
.size(width = 40.dp, height = 24.dp)
.clip(RoundedCornerShape(13.dp))
.border(
width = 1.dp,
Expand All @@ -75,7 +78,9 @@ fun NotificationCard(
contentAlignment = Alignment.Center
) {
Text(
text = stringResource(R.string.group),
modifier = Modifier
.padding(horizontal = 10.dp, vertical = 2.dp),
text = badgeText,
color = if (isRead) colors.Grey01 else colors.Grey,
style = typography.menu_sb600_s12_h20
)
Expand Down Expand Up @@ -147,8 +152,9 @@ fun PreviewNotificationCards() {
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
// 안읽은 알림
NotificationCard(
CardAlarm(
title = "같이 읽기를 시작했어요!",
badgeText = "모임",
message = "한줄만 입력이 가능합니다. 한줄만 입력이 가능합니다. 한줄만 입력이 가능합니다.",
timeAgo = "12",
isRead = isRead
Expand All @@ -157,12 +163,37 @@ fun PreviewNotificationCards() {
}

// 읽은 알림
NotificationCard(
CardAlarm(
title = "같이 읽기를 시작했어요!",
badgeText = "모임",
message = "한줄만 입력이 가능합니다. 한줄만 입력이 가능합니다. 한줄만 입력이 가능합니다.",
timeAgo = "12",
isRead = true
)

CardAlarm(
title = "같이 읽기를 시작했어요!",
badgeText = "피드",
message = "한줄만 입력이 가능합니다. 한줄만 입력이 가능합니다. 한줄만 입력이 가능합니다.",
timeAgo = "12",
isRead = false
)

CardAlarm(
title = "같이 읽기를 시작했어요!",
badgeText = "좋아요",
message = "한줄만 입력이 가능합니다. 한줄만 입력이 가능합니다. 한줄만 입력이 가능합니다.",
timeAgo = "12",
isRead = isRead
)

CardAlarm(
title = "같이 읽기를 시작했어요!",
badgeText = "댓글",
message = "한줄만 입력이 가능합니다. 한줄만 입력이 가능합니다. 한줄만 입력이 가능합니다.",
timeAgo = "12",
isRead = isRead
)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fun CardInputBook(
)
Spacer(modifier = Modifier.height(8.dp))
Text(
text = "$author 저",
text = stringResource(R.string.card_input_author, author),
style = typography.view_m500_s12_h20,
color = colors.Grey01
)
Expand Down
218 changes: 218 additions & 0 deletions app/src/main/java/com/texthip/thip/ui/common/cards/CardItemRoom.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
package com.texthip.thip.ui.common.cards

import androidx.compose.foundation.Image
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.texthip.thip.R
import com.texthip.thip.ui.theme.ThipTheme
import com.texthip.thip.ui.theme.ThipTheme.colors
import com.texthip.thip.ui.theme.ThipTheme.typography

@Composable
fun CardItemRoom(
modifier: Modifier = Modifier,
title: String,
participants: Int,
maxParticipants: Int,
isRecruiting: Boolean,
endDate: Int,
imageRes: Int? = R.drawable.bookcover_sample,
hasBorder: Boolean = false,
onClick: () -> Unit = {}
) {
Card(
modifier = modifier
.fillMaxWidth()
.then(
if (hasBorder)
Modifier
.border(
width = 1.dp,
color = colors.Grey02,
shape = RoundedCornerShape(12.dp)
)
else Modifier
)
.clickable { onClick() },
colors = CardDefaults.cardColors(
containerColor = colors.DarkGrey50
),
shape = RoundedCornerShape(12.dp)
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(12.dp)
) {
Row(
modifier = Modifier.fillMaxWidth()
) {
// 이미지
Box(
modifier = Modifier
.size(width = 80.dp, height = 107.dp)
) {
imageRes?.let {
Image(
painter = painterResource(id = it),
contentDescription = null,
modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.Crop
)
}
}

Spacer(modifier = Modifier.width(16.dp))

Column(
modifier = Modifier.fillMaxWidth()
) {
Spacer(modifier = Modifier.height(16.dp))
Text(
text = title,
color = colors.White,
style = typography.smalltitle_sb600_s18_h24,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
Spacer(modifier = Modifier.height(8.dp))
Row(verticalAlignment = Alignment.CenterVertically) {
Icon(
modifier = Modifier.size(20.dp),
painter = painterResource(id = R.drawable.ic_group),
contentDescription = "그룹 아이콘",
tint = Color.White
)
Spacer(modifier = Modifier.width(4.dp))

if (isRecruiting) {
Row(
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(
R.string.card_item_participant_count,
participants,
),
style = typography.menu_sb600_s12,
color = colors.White
)
Spacer(modifier = Modifier.width(2.dp))

Text(
text = stringResource(
R.string.card_item_participant_count_max,
maxParticipants
),
style = typography.info_m500_s12,
color = colors.Grey
)
}
} else {
Row(
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(R.string.card_item_participant, participants),
style = typography.menu_sb600_s12,
color = colors.White
)
Spacer(modifier = Modifier.width(2.dp))

Text(
text = stringResource(R.string.card_item_participant_string),
style = typography.info_m500_s12,
color = colors.Grey
)
}
}
}
Spacer(modifier = Modifier.height(5.dp))

Text(
text = stringResource(
R.string.card_item_end_date,
endDate
) + if (isRecruiting) stringResource(
R.string.card_item_end
) else stringResource(R.string.card_item_finish),

color = if (isRecruiting) colors.Red else colors.Grey01,
style = typography.menu_sb600_s12_h20,
maxLines = 1
)
}
}
}
}
}


@Preview()
@Composable
fun CardItemRoomPreview() {
ThipTheme {
Column(verticalArrangement = Arrangement.spacedBy(16.dp)) {
CardItemRoom(
title = "모임방 이름입니다. 모임방 이름입니다.",
participants = 22,
maxParticipants = 30,
isRecruiting = true,
endDate = 3,
imageRes = R.drawable.bookcover_sample
)
CardItemRoom(
title = "모임방 이름입니다. 모임방 이름입니다.",
participants = 22,
maxParticipants = 30,
isRecruiting = false,
endDate = 3,
imageRes = R.drawable.bookcover_sample
)
CardItemRoom(
title = "모임방 이름입니다. 모임방 이름입니다.",
participants = 22,
maxParticipants = 30,
isRecruiting = true,
endDate = 3,
imageRes = R.drawable.bookcover_sample,
hasBorder = true
)
CardItemRoom(
title = "모임방 이름입니다. 모임방 이름입니다.",
participants = 22,
maxParticipants = 30,
isRecruiting = false,
endDate = 3,
imageRes = R.drawable.bookcover_sample,
hasBorder = true
)
}
}
}
Loading