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
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fun PictureDayCell(
modifier =
Modifier
.size(36.dp)
.rotate(-16f)
.rotate(16f)
.border(1.dp, GrayColor.C400, cornerShape)
.background(CommonColor.White, cornerShape),
)
Expand All @@ -68,8 +68,8 @@ fun PictureDayCell(
.size(36.dp)
.clip(cornerShape)
.then(
if (showBackgroundCard) {
Modifier.border(1.dp, borderColor, cornerShape)
if (hasImage) {
Modifier.border((1.2).dp, borderColor, cornerShape)
} else {
Modifier
},
Expand Down Expand Up @@ -104,7 +104,7 @@ fun PictureDayCell(

AppText(
text = date.dayOfMonth.toString(),
style = AppTextStyle.B1,
style = AppTextStyle.B3,
color = textColor,
textAlign = TextAlign.Center,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ fun StampCell(
AppText(
text = stats.nickname,
style = AppTextStyle.B4,
color = GrayColor.C500,
color = GrayColor.C400,
)

Spacer(modifier = Modifier.weight(1f))

AppText(
text = stringResource(R.string.stats_stamp_end_count).format(stats.completedCount),
style = AppTextStyle.B4,
color = GrayColor.C500,
color = GrayColor.C400,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
Expand Down Expand Up @@ -82,16 +82,20 @@ private fun DayOfWeekHeader() {
modifier = Modifier.fillMaxWidth(),
) {
days.forEach { day ->
AppText(
text = day,
style = AppTextStyle.B2,
color = GrayColor.C300,
Box(
modifier =
Modifier
.weight(1f)
.height(24.dp),
textAlign = TextAlign.Center,
)
contentAlignment = Alignment.Center,
) {
AppText(
text = day,
style = AppTextStyle.C1,
color = GrayColor.C300,
textAlign = TextAlign.Center,
)
}
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions core/design-system/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
<string name="word_friday">금</string>
<string name="word_saturday">토</string>

<!-- 날짜 포맷 -->
<string name="date_year_month_day">%s년 %02d월 %02d일</string>
<string name="date_year_month_day_no_padding">%1$d년 %2$d월 %3$d일</string>

<!-- 동작 -->
<string name="action_edit">수정하기</string>
<string name="action_delete">삭제하기</string>
Expand Down Expand Up @@ -73,7 +77,6 @@
<string name="goal_list_title_previous">지난 우리 목표</string>
<string name="goal_list_title_today">오늘 우리 목표</string>
<string name="goal_list_title_next">다음 우리 목표</string>
<string name="date_year_month_day">%s년 %02d월 %02d일</string>
<string name="goal_detail_empty_goal_guide">아직 목표가 없어요!</string>

<!-- 설정 화면 -->
Expand All @@ -92,7 +95,7 @@
<string name="stats_stamp_end_tab_title">종료</string>

<!-- 통계 상세 화면 -->
<string name="stats_complete_count">%1$s %2$d/%3$d</string>
<string name="stats_complete_count">%1$s - %2$d/%3$d</string>

<!-- 알림 화면 -->
<string name="notification_recent_14_days">최근 14일</string>
Expand Down
1 change: 0 additions & 1 deletion core/util/src/main/java/com/twix/util/.gitkeep

This file was deleted.

11 changes: 7 additions & 4 deletions feature/main/src/main/java/com/twix/stats/StatsViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ class StatsViewModel(
)

init {
collectMonthChange()
fetchInProgressStats(YearMonth.from(currentState.currentDate))
fetchCompletedStats()
collectEventBus()
}

private fun collectMonthChange() {
viewModelScope.launch {
monthChangeFlow
.distinctUntilChanged()
Expand All @@ -52,10 +59,6 @@ class StatsViewModel(
fetchInProgressStats(yearMonth)
}
}

fetchInProgressStats(YearMonth.from(currentState.currentDate))
fetchCompletedStats()
collectEventBus()
}

override suspend fun handleIntent(intent: StatsIntent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fun EndStatsContent(
)
}
} else {
item { Spacer(Modifier.height(12.dp)) }
item { Spacer(Modifier.height(20.dp)) }

items(
items = statsGoals,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.twix.ui.image.ImageGenerator
import com.twix.util.bus.GoalRefreshBus
import com.twix.util.bus.PhotologRefreshBus
import com.twix.util.bus.StatsDetailRefreshBus
import com.twix.util.bus.StatsRefreshBus
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
Expand All @@ -32,6 +33,7 @@ class PhotologCaptureViewModel(
private val detailRefreshBus: PhotologRefreshBus,
private val goalRefreshBus: GoalRefreshBus,
private val statsDetailRefreshBus: StatsDetailRefreshBus,
private val statsRefreshBus: StatsRefreshBus,
savedStateHandle: SavedStateHandle,
) : BaseViewModel<PhotologCaptureUiState, PhotologCaptureIntent, PhotologCaptureSideEffect>(
PhotologCaptureUiState(),
Expand Down Expand Up @@ -176,11 +178,16 @@ class PhotologCaptureViewModel(

private fun handleUploadPhotologSuccess() {
when (navArgs.from) {
NavRoutes.PhotologRoute.From.HOME ->
NavRoutes.PhotologRoute.From.HOME -> {
goalRefreshBus.notifyGoalListChanged()
statsRefreshBus.notifyChanged(StatsRefreshBus.Target.All)
}

NavRoutes.PhotologRoute.From.DETAIL ->
NavRoutes.PhotologRoute.From.DETAIL -> {
detailRefreshBus.notifyChanged(PhotologRefreshBus.Publisher.PHOTOLOG)
statsDetailRefreshBus.notifyChanged()
statsRefreshBus.notifyChanged(StatsRefreshBus.Target.All)
}

NavRoutes.PhotologRoute.From.EDITOR -> Unit
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ fun StatsDetailScreen(
modifier =
Modifier
.fillMaxSize()
.verticalScroll(scrollState)
.background(GrayColor.C050),
) {
StatsDetailTopbar(
Expand Down Expand Up @@ -158,26 +159,25 @@ fun StatsDetailScreen(
modifier =
Modifier
.fillMaxWidth()
.verticalScroll(scrollState),
.padding(top = 32.dp),
) {
Image(
imageVector = ImageVector.vectorResource(R.drawable.ic_hug),
contentDescription = null,
modifier =
Modifier
.align(Alignment.TopStart)
.padding(start = 20.dp, top = 30.dp),
.padding(start = 20.dp),
)

Column(
modifier =
Modifier
.fillMaxWidth()
.padding(horizontal = 20.dp),
.padding(horizontal = 20.dp)
.padding(top = 4.dp),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Spacer(Modifier.height(32.dp))

CalendarNavigator(
currentDate = uiState.detail.currentDate,
onPreviousMonth = onPreviousMonth,
Expand Down Expand Up @@ -210,7 +210,7 @@ fun StatsDetailScreen(
modifier =
Modifier
.align(Alignment.TopEnd)
.padding(end = 27.dp, top = 30.dp),
.padding(end = 27.dp),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fun SummaryContent(
label = stringResource(R.string.word_start_date),
value =
stringResource(
R.string.date_year_month_day,
R.string.date_year_month_day_no_padding,
statsSummary.startDate.year,
statsSummary.startDate.monthValue,
statsSummary.startDate.dayOfMonth,
Expand All @@ -116,7 +116,7 @@ fun SummaryContent(
value =
statsSummary.endDate?.let {
stringResource(
R.string.date_year_month_day,
R.string.date_year_month_day_no_padding,
it.year,
it.monthValue,
it.dayOfMonth,
Expand Down Expand Up @@ -170,7 +170,7 @@ private fun SummaryContentPreview() {
partnerCompletedCount = 8,
totalCount = 20,
repeatCycle = RepeatCycle.DAILY,
startDate = LocalDate.now(),
startDate = LocalDate.of(2025, 11, 12),
endDate = LocalDate.now(),
),
)
Expand Down
Loading