cuongtd
05/17/2021, 1:04 PMpawegio
05/17/2021, 3:20 PMcomposable("screen") {
EnterTransition { Screen() }
}
// ...
@Composable
private fun EnterTransition(
content: @Composable () -> Unit,
) {
if (/* check if is not on back stack */) {
AnimatedVisibility(
visible = true,
enter = slideInHorizontally(initialOffsetX = { it }),
exit = slideOutHorizontally(targetOffsetX = { -it }),
content = content,
initiallyVisible = false
)
} else {
content()
}
}
cuongtd
05/17/2021, 5:39 PMIan Lake
05/17/2021, 8:51 PMIan Lake
05/17/2021, 8:52 PM