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(
targetState = Triple(selectedUser, showSearchScreen, Unit),
transitionSpec = {
// Плавный crossfade для избежания "прыжков" header'а
val enterAnim = fadeIn(
animationSpec = tween(
durationMillis = 250,
easing = FastOutSlowInEasing
)
) + slideInHorizontally(
initialOffsetX = { it / 4 },
animationSpec = tween(
durationMillis = 300,
easing = FastOutSlowInEasing
)
)
val exitAnim = fadeOut(
// Только плавный fade без смещения - чтобы header не прыгал
fadeIn(
animationSpec = tween(
durationMillis = 200,
easing = FastOutSlowInEasing
)
) + slideOutHorizontally(
targetOffsetX = { -it / 6 },
) togetherWith fadeOut(
animationSpec = tween(
durationMillis = 300,
durationMillis = 150,
easing = FastOutSlowInEasing
)
)
enterAnim togetherWith exitAnim using SizeTransform(clip = false)
) using SizeTransform(clip = false)
},
label = "screenNavigation"
) { (user, isSearchOpen, _) ->