mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-07-26 22:42:17 +00:00
feat: add animated tab visibility with alpha transitions in AppScreen
This commit is contained in:
parent
5144a2b036
commit
5c998be2c2
1 changed files with 8 additions and 1 deletions
|
|
@ -5,6 +5,8 @@ import androidx.compose.foundation.layout.Box
|
|||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.animation.core.animateFloatAsState
|
||||
import androidx.compose.animation.core.tween
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.Home
|
||||
import androidx.compose.material.icons.rounded.Search
|
||||
|
|
@ -191,11 +193,16 @@ fun App() {
|
|||
.padding(innerPadding),
|
||||
) {
|
||||
AppScreenTab.entries.forEach { tab ->
|
||||
val tabAlpha by animateFloatAsState(
|
||||
targetValue = if (selectedTab == tab) 1f else 0f,
|
||||
animationSpec = tween(durationMillis = 220),
|
||||
label = "tab_alpha_${tab.name}",
|
||||
)
|
||||
AppScreen(
|
||||
tab = tab,
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.alpha(if (selectedTab == tab) 1f else 0f)
|
||||
.alpha(tabAlpha)
|
||||
.zIndex(if (selectedTab == tab) 1f else 0f),
|
||||
onCatalogClick = onCatalogClick,
|
||||
onPosterClick = { meta ->
|
||||
|
|
|
|||
Loading…
Reference in a new issue