feat: Simplify header transition animations in MainScreen for smoother navigation

This commit is contained in:
k1ngsterr1
2026-01-12 16:31:14 +05:00
parent 718c2e705f
commit 325c5ace4b

View File

@@ -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, _) ->