feat: Simplify header transition animations in MainScreen for smoother navigation
This commit is contained in:
@@ -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, _) ->
|
||||
|
||||
Reference in New Issue
Block a user