Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen Transition #524

Open
BoburjonMurodov opened this issue Feb 17, 2025 · 3 comments
Open

Screen Transition #524

BoburjonMurodov opened this issue Feb 17, 2025 · 3 comments

Comments

@BoburjonMurodov
Copy link

Per Screen Transitions doesn’t work when screen is replaced. it is only applied when screen is pushed.

@tilpap
Copy link

tilpap commented Mar 21, 2025

Its working, I just tested it. Try this:

@OptIn(ExperimentalVoyagerApi::class)
class YourScreen : Screen, ScreenTransition {
    override val key: ScreenKey = uniqueScreenKey

    @Transient
    private val fadeTransition = CustomFadeTransition()

    override fun enter(lastEvent: StackEvent) = fadeTransition.enter(lastEvent)
    override fun exit(lastEvent: StackEvent)  = fadeTransition.exit(lastEvent)

    @Composable
    override fun Content() { ... }

where CustomFadeTransition():

@OptIn(ExperimentalVoyagerApi::class)
class CustomFadeTransition : ScreenTransition {

    override fun enter(lastEvent: StackEvent): EnterTransition {
        return fadeIn(tween(300))
    }

    override fun exit(lastEvent: StackEvent): ExitTransition {
        return fadeOut(tween(300))
    }
}

@BoburjonMurodov
Copy link
Author

this also is not working as expected

"1.1.0-beta03" voyager version i am using

@kagg886
Copy link

kagg886 commented Mar 22, 2025

pls report a MINIMAL reappear environment(Github Gist or Github Repo and some on) to test it, other we can't test your problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants