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:
@@ -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,7 +88,14 @@ fun App(
|
|||||||
}
|
}
|
||||||
|
|
||||||
MyIceTheme {
|
MyIceTheme {
|
||||||
when (val screen = currentScreen) {
|
AnimatedContent(
|
||||||
|
targetState = currentScreen,
|
||||||
|
transitionSpec = {
|
||||||
|
fadeIn(tween(300)) togetherWith fadeOut(tween(300))
|
||||||
|
},
|
||||||
|
label = "screenTransition",
|
||||||
|
) { screen ->
|
||||||
|
when (screen) {
|
||||||
Screen.Login -> LoginScreen(viewModel = authViewModel)
|
Screen.Login -> LoginScreen(viewModel = authViewModel)
|
||||||
Screen.Schedule -> ScheduleScreen(
|
Screen.Schedule -> ScheduleScreen(
|
||||||
scheduleViewModel = scheduleViewModel,
|
scheduleViewModel = scheduleViewModel,
|
||||||
@@ -103,4 +115,5 @@ fun App(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user