feat: add screen transitions and rebrand to MyIce

- AnimatedContent with fade transitions between screens (300ms)
- Desktop window title 'MyIce' (dropped 'K' codename)
This commit is contained in:
2026-08-06 17:19:21 +02:00
parent c9841b6744
commit 85e2391833
2 changed files with 32 additions and 19 deletions
@@ -17,6 +17,11 @@
package ch.parano.myicek package ch.parano.myicek
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.togetherWith
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
@@ -83,24 +88,32 @@ fun App(
} }
MyIceTheme { MyIceTheme {
when (val screen = currentScreen) { AnimatedContent(
Screen.Login -> LoginScreen(viewModel = authViewModel) targetState = currentScreen,
Screen.Schedule -> ScheduleScreen( transitionSpec = {
scheduleViewModel = scheduleViewModel, fadeIn(tween(300)) togetherWith fadeOut(tween(300))
authViewModel = authViewModel, },
onEventClick = { gameId, account, eventTitle, eventStart, eventEnd -> label = "screenTransition",
currentScreen = Screen.EventDetail(gameId, account, eventTitle, eventStart, eventEnd) ) { screen ->
}, when (screen) {
) Screen.Login -> LoginScreen(viewModel = authViewModel)
is Screen.EventDetail -> EventDetailScreen( Screen.Schedule -> ScheduleScreen(
gameId = screen.gameId, scheduleViewModel = scheduleViewModel,
account = screen.account, authViewModel = authViewModel,
eventTitle = screen.eventTitle, onEventClick = { gameId, account, eventTitle, eventStart, eventEnd ->
eventStart = screen.eventStart, currentScreen = Screen.EventDetail(gameId, account, eventTitle, eventStart, eventEnd)
eventEnd = screen.eventEnd, },
viewModel = eventDetailViewModel, )
onBack = { currentScreen = Screen.Schedule }, is Screen.EventDetail -> EventDetailScreen(
) gameId = screen.gameId,
account = screen.account,
eventTitle = screen.eventTitle,
eventStart = screen.eventStart,
eventEnd = screen.eventEnd,
viewModel = eventDetailViewModel,
onBack = { currentScreen = Screen.Schedule },
)
}
} }
} }
} }
@@ -22,7 +22,7 @@ import androidx.compose.ui.window.application
import ch.parano.myicek.auth.DesktopOAuthClient import ch.parano.myicek.auth.DesktopOAuthClient
fun main() = application { fun main() = application {
Window(onCloseRequest = ::exitApplication, title = "MyIceK") { Window(onCloseRequest = ::exitApplication, title = "MyIce") {
App(oauthClient = DesktopOAuthClient()) App(oauthClient = DesktopOAuthClient())
} }
} }