feat: Simplify header transition animations in MainScreen for smoother navigation
This commit is contained in:
@@ -231,34 +231,18 @@ fun MainScreen(
|
|||||||
AnimatedContent(
|
AnimatedContent(
|
||||||
targetState = Triple(selectedUser, showSearchScreen, Unit),
|
targetState = Triple(selectedUser, showSearchScreen, Unit),
|
||||||
transitionSpec = {
|
transitionSpec = {
|
||||||
// Плавный crossfade для избежания "прыжков" header'а
|
// Только плавный fade без смещения - чтобы header не прыгал
|
||||||
val enterAnim = fadeIn(
|
fadeIn(
|
||||||
animationSpec = tween(
|
|
||||||
durationMillis = 250,
|
|
||||||
easing = FastOutSlowInEasing
|
|
||||||
)
|
|
||||||
) + slideInHorizontally(
|
|
||||||
initialOffsetX = { it / 4 },
|
|
||||||
animationSpec = tween(
|
|
||||||
durationMillis = 300,
|
|
||||||
easing = FastOutSlowInEasing
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
val exitAnim = fadeOut(
|
|
||||||
animationSpec = tween(
|
animationSpec = tween(
|
||||||
durationMillis = 200,
|
durationMillis = 200,
|
||||||
easing = FastOutSlowInEasing
|
easing = FastOutSlowInEasing
|
||||||
)
|
)
|
||||||
) + slideOutHorizontally(
|
) togetherWith fadeOut(
|
||||||
targetOffsetX = { -it / 6 },
|
|
||||||
animationSpec = tween(
|
animationSpec = tween(
|
||||||
durationMillis = 300,
|
durationMillis = 150,
|
||||||
easing = FastOutSlowInEasing
|
easing = FastOutSlowInEasing
|
||||||
)
|
)
|
||||||
)
|
) using SizeTransform(clip = false)
|
||||||
|
|
||||||
enterAnim togetherWith exitAnim using SizeTransform(clip = false)
|
|
||||||
},
|
},
|
||||||
label = "screenNavigation"
|
label = "screenNavigation"
|
||||||
) { (user, isSearchOpen, _) ->
|
) { (user, isSearchOpen, _) ->
|
||||||
|
|||||||
Reference in New Issue
Block a user