feat: 워치 앱 첫 장을 하늘 장 대신 주변 축제로 (축제가 없으면 오늘의 각부터)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HyeongBaeYangandClaude Opus 5.5 committed 2026-10-13 11:00:39 +09:00
1 parent c0e0363759
commit 1990a1f998
3 files changed
+5 -176

No files matched your search

@@ -50,7 +50,7 @@ class MainActivity : ComponentActivity() {
}
}
private enum class Page { DETAIL, SKY, TOP, PICKS, EVENTS, SUNSET, HOURS }
private enum class Page { DETAIL, EVENTS, TOP, PICKS, SUNSET, HOURS }
@Composable
private fun App(s: Summary?, loading: Boolean, opened: String?, onRetry: () -> Unit) {
@@ -65,14 +65,13 @@ private fun App(s: Summary?, loading: Boolean, opened: String?, onRetry: () -> U
StatePage(loading, onRetry)
return
}
// 스킨 링에서 누른 각이 있으면 그 상세부터, 아니면 하늘 장부터
// 스킨 링에서 누른 각이 있으면 그 상세부터, 아니면 주변 축제부터 (축제가 없으면 오늘의 각부터)
val detail = opened?.let { c -> (s.top + s.picks).firstOrNull { it.code == c } }
val pages = buildList {
if (detail != null) add(Page.DETAIL)
add(Page.SKY)
if (s.events.isNotEmpty()) add(Page.EVENTS)
if (s.top.isNotEmpty()) add(Page.TOP)
if (s.picks.isNotEmpty()) add(Page.PICKS)
if (s.events.isNotEmpty()) add(Page.EVENTS)
if (s.sunset != null) add(Page.SUNSET)
if (s.slots.isNotEmpty()) add(Page.HOURS)
}
@@ -81,16 +80,15 @@ private fun App(s: Summary?, loading: Boolean, opened: String?, onRetry: () -> U
VerticalPager(state = state, modifier = Modifier.fillMaxSize()) { i ->
when (pages[i]) {
Page.DETAIL -> DetailPage(detail!!, now)
Page.SKY -> SkyPage(s, now)
Page.EVENTS -> EventsPage(s.events, now)
Page.TOP -> GakListPage("오늘의 각", s.top.take(3), bgButter, medals = true, now)
Page.PICKS -> GakListPage("내 각", s.picks, bgMint, medals = false, now)
Page.EVENTS -> EventsPage(s.events, now)
Page.SUNSET -> SunsetPage(s.sunset!!, now)
Page.HOURS -> HoursPage(s, now)
}
}
val page = pages[state.currentPage]
val dot = if (page == Page.SUNSET || (page == Page.SKY && isDark(s.mode))) Color.White else Tok.ink
val dot = if (page == Page.SUNSET) Color.White else Tok.ink
VerticalPageIndicator(pagerState = state, selectedColor = dot, unselectedColor = dot.copy(alpha = 0.35f), backgroundColor = Color.Transparent)
}
}