mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 23:27:04 +05:30
fix: make nav rail animate horizontally
This commit is contained in:
parent
3db05fb3b1
commit
1e5ae4048c
1 changed files with 8 additions and 8 deletions
|
@ -11,8 +11,8 @@ import androidx.compose.animation.Crossfade
|
||||||
import androidx.compose.animation.core.FastOutLinearInEasing
|
import androidx.compose.animation.core.FastOutLinearInEasing
|
||||||
import androidx.compose.animation.core.LinearOutSlowInEasing
|
import androidx.compose.animation.core.LinearOutSlowInEasing
|
||||||
import androidx.compose.animation.core.tween
|
import androidx.compose.animation.core.tween
|
||||||
import androidx.compose.animation.slideInVertically
|
import androidx.compose.animation.slideInHorizontally
|
||||||
import androidx.compose.animation.slideOutVertically
|
import androidx.compose.animation.slideOutHorizontally
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.NavigationRail
|
import androidx.compose.material3.NavigationRail
|
||||||
|
@ -35,15 +35,15 @@ fun ClawNavigationRail(
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
visible = isVisible,
|
visible = isVisible,
|
||||||
enter =
|
enter =
|
||||||
slideInVertically(
|
slideInHorizontally(
|
||||||
// Enters by sliding up from offset 0 to fullHeight.
|
// Enters by sliding in from offset -fullWidth to 0.
|
||||||
initialOffsetY = { fullHeight -> fullHeight },
|
initialOffsetX = { fullWidth -> -fullWidth },
|
||||||
animationSpec = tween(durationMillis = AnimationDuration, easing = LinearOutSlowInEasing),
|
animationSpec = tween(durationMillis = AnimationDuration, easing = LinearOutSlowInEasing),
|
||||||
),
|
),
|
||||||
exit =
|
exit =
|
||||||
slideOutVertically(
|
slideOutHorizontally(
|
||||||
// Exits by sliding up from offset 0 to -fullHeight.
|
// Exits by sliding out from offset 0 to -fullWidth.
|
||||||
targetOffsetY = { fullHeight -> fullHeight },
|
targetOffsetX = { fullWidth -> -fullWidth },
|
||||||
animationSpec = tween(durationMillis = AnimationDuration, easing = FastOutLinearInEasing),
|
animationSpec = tween(durationMillis = AnimationDuration, easing = FastOutLinearInEasing),
|
||||||
),
|
),
|
||||||
modifier = Modifier,
|
modifier = Modifier,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue