cuongtd

    cuongtd

    1 year ago
    have anyone done navigation transition in compose?
    pawegio

    pawegio

    1 year ago
    I have a temporary solution, sth like this:
    composable("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

    cuongtd

    1 year ago
    @pawegio thank you, btw is it possible to make destination screen slide left while push previous screen slide left as well
    i

    Ian Lake

    1 year ago
    Sliding to the side would be one of the supported types of transitions that Navigation will support in the future (I think it was brought up in our previous request for transition examples: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1619464233360000)
    https://issuetracker.google.com/issues/172112072 is the tracking bug if you want to star it 🙂