Skip to content
Open
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
Binary file added common/resource/src/main/res/drawable/ic_people.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.idiotfrogs.designsystem.util.noRippleClickable
import com.idiotfrogs.resource.R
Expand All @@ -23,6 +24,7 @@ fun MSDetailHeader(
navigateToBack: () -> Unit,
modifier: Modifier = Modifier,
title: String = "",
fontSize: Dp = 14.dp,
paddingValues: PaddingValues = PaddingValues(horizontal = 20.dp, vertical = 16.dp),
trailingContent: @Composable (() -> Unit)? = null,
) {
Expand All @@ -41,7 +43,8 @@ fun MSDetailHeader(
)
MSText(
modifier = Modifier.align(Alignment.Center),
text = title
text = title,
fontSize = fontSize
)
trailingContent?.let {
Box(Modifier.align(Alignment.CenterEnd)) { it() }
Expand Down
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
3 changes: 2 additions & 1 deletion core/designsystem/stability/designsystem-debug.stability
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ public fun com.idiotfrogs.designsystem.component.MSDashHorizontalDivider(modifie
- gapWidth: STABLE (marked @Stable or @Immutable)

@Composable
public fun com.idiotfrogs.designsystem.component.MSDetailHeader(navigateToBack: kotlin.Function0<kotlin.Unit>, modifier: androidx.compose.ui.Modifier, title: kotlin.String, paddingValues: androidx.compose.foundation.layout.PaddingValues, trailingContent: @[Composable] androidx.compose.runtime.internal.ComposableFunction0<kotlin.Unit>?): kotlin.Unit
public fun com.idiotfrogs.designsystem.component.MSDetailHeader(navigateToBack: kotlin.Function0<kotlin.Unit>, modifier: androidx.compose.ui.Modifier, title: kotlin.String, fontSize: androidx.compose.ui.unit.Dp, paddingValues: androidx.compose.foundation.layout.PaddingValues, trailingContent: @[Composable] androidx.compose.runtime.internal.ComposableFunction0<kotlin.Unit>?): kotlin.Unit
skippable: true
restartable: true
params:
- navigateToBack: STABLE (function type)
- modifier: STABLE (marked @Stable or @Immutable)
- title: STABLE (String is immutable)
- fontSize: STABLE (marked @Stable or @Immutable)
- paddingValues: STABLE (marked @Stable or @Immutable)
- trailingContent: STABLE (composable function type)

Expand Down
3 changes: 2 additions & 1 deletion core/designsystem/stability/designsystem-release.stability
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ public fun com.idiotfrogs.designsystem.component.MSDashHorizontalDivider(modifie
- gapWidth: STABLE (marked @Stable or @Immutable)

@Composable
public fun com.idiotfrogs.designsystem.component.MSDetailHeader(navigateToBack: kotlin.Function0<kotlin.Unit>, modifier: androidx.compose.ui.Modifier, title: kotlin.String, paddingValues: androidx.compose.foundation.layout.PaddingValues, trailingContent: @[Composable] androidx.compose.runtime.internal.ComposableFunction0<kotlin.Unit>?): kotlin.Unit
public fun com.idiotfrogs.designsystem.component.MSDetailHeader(navigateToBack: kotlin.Function0<kotlin.Unit>, modifier: androidx.compose.ui.Modifier, title: kotlin.String, fontSize: androidx.compose.ui.unit.Dp, paddingValues: androidx.compose.foundation.layout.PaddingValues, trailingContent: @[Composable] androidx.compose.runtime.internal.ComposableFunction0<kotlin.Unit>?): kotlin.Unit
skippable: true
restartable: true
params:
- navigateToBack: STABLE (function type)
- modifier: STABLE (marked @Stable or @Immutable)
- title: STABLE (String is immutable)
- fontSize: STABLE (marked @Stable or @Immutable)
- paddingValues: STABLE (marked @Stable or @Immutable)
- trailingContent: STABLE (composable function type)

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
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,9 @@ interface TimeCapsuleService {
@Path("capsuleId") capsuleId: Long,
@Body body: BuryTimeCapsuleRequest
): TimeCapsuleResponse

@DELETE("time-capsules/{capsuleId}/leave")
suspend fun leaveTimeCapsule(
@Path("capsuleId") capsuleId: Long
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ interface TimeCapsuleDataSource {
capsuleId: Long,
body: BuryTimeCapsuleRequest
): TimeCapsuleResponse

suspend fun leaveTimeCapsule(capsuleId: Long)
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,8 @@ class TimeCapsuleDataSourceImpl @Inject constructor(
): TimeCapsuleResponse {
return timeCapsuleService.buryTimeCapsule(capsuleId, body)
}

override suspend fun leaveTimeCapsule(capsuleId: Long) {
return timeCapsuleService.leaveTimeCapsule(capsuleId)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ interface TimeCapsuleRepository {
capsuleId: Long,
body: BuryTimeCapsuleRequest
): TimeCapsuleResponse

suspend fun leaveTimeCapsule(capsuleId: Long)
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,8 @@ class TimeCapsuleRepositoryImpl @Inject constructor(
): TimeCapsuleResponse {
return timeCapsuleDataSource.buryTimeCapsule(capsuleId, body)
}

override suspend fun leaveTimeCapsule(capsuleId: Long) {
return timeCapsuleDataSource.leaveTimeCapsule(capsuleId)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.idiotfrogs.domain.usecase.timecapsule

import com.idiotfrogs.data.repository.timecapsule.TimeCapsuleRepository
import com.idiotfrogs.util.safeCatching
import javax.inject.Inject

class LeaveTimeCapsuleUseCase @Inject constructor(
private val timeCapsuleRepository: TimeCapsuleRepository
) {
suspend operator fun invoke(capsuleId: Long) = safeCatching {
timeCapsuleRepository.leaveTimeCapsule(capsuleId = capsuleId)
}
}
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
Loading
Loading