Fixed animation for TopBar text

This commit is contained in:
Sad Ellie 2022-07-22 20:47:27 +03:00
parent 34e918c8b4
commit 12c5f312e6

View File

@ -19,6 +19,7 @@
package com.sadellie.unitto.screens.main package com.sadellie.unitto.screens.main
import androidx.compose.animation.AnimatedContent import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.SizeTransform
import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut import androidx.compose.animation.fadeOut
import androidx.compose.animation.slideInVertically import androidx.compose.animation.slideInVertically
@ -42,7 +43,9 @@ fun AnimatedTopBarText(showAppName: Boolean) {
AnimatedContent( AnimatedContent(
targetState = showAppName, targetState = showAppName,
transitionSpec = { transitionSpec = {
fadeIn() + slideInVertically() with fadeOut() + slideOutVertically() (slideInVertically { height -> height } + fadeIn() with
slideOutVertically { height -> -height } + fadeOut())
.using(SizeTransform(clip = false))
} }
) { ) {
Text( Text(