Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.idiotfrogs.designsystem.component

import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.LocalRippleConfiguration
Expand All @@ -18,6 +16,9 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.zIndex
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.unit.dp
import com.idiotfrogs.designsystem.theme.MSTheme
import com.idiotfrogs.designsystem.util.DrawType
Expand All @@ -34,15 +35,22 @@ fun MSTabBar(
) {
var tabPositions by remember { mutableStateOf<List<TabPosition>?>(null) }

Column {
Column(modifier = Modifier.zIndex(1f)) {
CompositionLocalProvider(LocalRippleConfiguration provides null) {
TabRow(
modifier = modifier.then(
if (showBorder) {
Modifier.border(
width = 2.dp,
color = MSTheme.color.bgNormal
)
val borderColor = MSTheme.color.bgNormal
Modifier.drawWithContent {
val strokeWidthPx = 2.dp.toPx()
drawContent()
drawLine(
color = borderColor,
start = Offset(0f, size.height - strokeWidthPx / 2f),
end = Offset(size.width, size.height - strokeWidthPx / 2f),
strokeWidth = strokeWidthPx,
)
}
} else {
Modifier
}
Expand Down Expand Up @@ -71,7 +79,6 @@ fun MSTabBar(
Modifier
}
)
.offset(y = 1.dp)
.padding(horizontal = 54.dp)
.wavyStroke(
color = MSTheme.color.greyG5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import kotlinx.serialization.Serializable
data class MyTimeCapsuleResponse(
val timeCapsuleId: Long,
val title: String,
val openedAt: LocalDateTime?,
val createdAt: LocalDateTime,
val mainImageUrl: String,
val timeCapsuleStatus: TimeCapsuleStatus,
val role: TimeCapsuleRole
Expand Down
10 changes: 6 additions & 4 deletions feature/home/src/main/java/com/idiotfrogs/home/HomeScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ fun HomeScreen(
}

val lazyListState = rememberLazyListState()
val showBorder = remember {
lazyListState.firstVisibleItemScrollOffset > 0 || // 1px์ด๋ผ๋„ ์›€์ง์˜€๊ฑฐ๋‚˜
lazyListState.firstVisibleItemIndex > 0 // ์ฒซ ๋ฒˆ์งธ ์•„์ดํ…œ์„ ๋„˜์–ด๊ฐ„ ๊ฒฝ์šฐ
val showBorder by remember {
derivedStateOf {
lazyListState.firstVisibleItemScrollOffset > 0 || // 1px์ด๋ผ๋„ ์›€์ง์˜€๊ฑฐ๋‚˜
lazyListState.firstVisibleItemIndex > 0 // ์ฒซ ๋ฒˆ์งธ ์•„์ดํ…œ์„ ๋„˜์–ด๊ฐ„ ๊ฒฝ์šฐ
}
}

Column(
Expand Down Expand Up @@ -255,7 +257,7 @@ fun HomeScreen(
onAction(HomeAction.NavigateToDetail(it.timeCapsuleId))
},
buried = it.timeCapsuleStatus == TimeCapsuleStatus.BURIED,
targetDate = it.openedAt.toYearMonthDay(),
createdAt = it.createdAt.toYearMonthDay(),
title = it.title,
imageUrl = it.mainImageUrl
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import com.skydoves.landscapist.glide.GlideImage
@Composable
fun HomeTicket(
buried: Boolean,
targetDate: String,
createdAt: String,
title: String,
imageUrl: String?,
modifier: Modifier = Modifier,
Expand All @@ -53,7 +53,10 @@ fun HomeTicket(
.zIndex(1f)
.wavyStroke(
color = MSTheme.color.greyG5,
cornerRadius = 16.dp,
strokeWidth = 4.dp,
amplitude = 1.dp,
spacing = 3.dp,
fillColor = MSTheme.color.primaryNormal
)
) {
Expand All @@ -66,7 +69,7 @@ fun HomeTicket(
Row(
modifier = Modifier
.background(
color = MSTheme.color.primaryLight,
color = MSTheme.color.primaryLight.copy(0.6f),
shape = RoundedCornerShape(12.dp))
.padding(6.dp),
horizontalArrangement = Arrangement.spacedBy(4.dp),
Expand Down Expand Up @@ -95,7 +98,7 @@ fun HomeTicket(
)
Spacer(modifier = Modifier.height(8.dp))
MSText(
text = targetDate,
text = createdAt,
fontWeight = FontWeight.Normal,
fontSize = 14.dp,
color = MSTheme.color.greyG4
Expand All @@ -108,7 +111,10 @@ fun HomeTicket(
.offset(y = (-10).dp)
.wavyStroke(
color = MSTheme.color.greyG5,
cornerRadius = 16.dp,
strokeWidth = 4.dp,
amplitude = (1.5).dp,
spacing = 4.dp,
fillColor = MSTheme.color.white
)
.fillMaxWidth()
Expand Down Expand Up @@ -165,7 +171,7 @@ private fun HomeTicketPreview() {
Box(modifier = Modifier.padding(horizontal = 20.dp)) {
HomeTicket(
buried = true,
targetDate = "2027. 10. 24.",
createdAt = "2027. 10. 24.",
title = "์ œ๋ชฉ์ž…๋‹ˆ๋‹ค.",
imageUrl = null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fun ProfileScreen(
ProfileTicketCard(
imageUrl = it.mainImageUrl,
title = it.title,
date = it.openedAt.toYearMonthDay(),
date = it.createdAt.toYearMonthDay(),
onClick = {}
)
}
Expand Down
Loading