GithubHelp home page GithubHelp logo

Comments (7)

raamcosta avatar raamcosta commented on June 12, 2024 2

Hey guys

I haven’t had time to properly check shared element transitions but if you just need the animated scope, that is something that the lib already knows how to provide to the destination without any setup whatsoever.

check this

https://composedestinations.rafaelcosta.xyz/v2/styles-and-animations#animated-style

from compose-destinations.

ammargitham avatar ammargitham commented on June 12, 2024 1

@raamcosta Okay, I tried with the official lib. Same behavior. Will raise issue in Google issue tracker.

from compose-destinations.

ammargitham avatar ammargitham commented on June 12, 2024

Technically, we can use the manualComposableCallsBuilder for the destinations where we need to pass the animatedVisibilityScope. It's not pretty but it allows us to not write composable() for only required destinations.

manualComposableCallsBuilder = {
    composable(HomeScreenDestination) {
        CompositionLocalProvider(
            LocalNavAnimatedVisibilityScope provides this,
        ) {
            HomeScreen(
                ...
            )
        }
    }
    composable(WallpaperScreenDestination) {
        CompositionLocalProvider(
            LocalNavAnimatedVisibilityScope provides this,
        ) {
            WallpaperScreen(
                ...
            )
        }
    }
},

Then use the scope inside the composable.

But yeah, auto injected scope would be better.

from compose-destinations.

ammargitham avatar ammargitham commented on June 12, 2024

@raamcosta I was able to get the shared element transition to work, although it was a bit glitchy. But I guess that may be because of a combination of the new api and my own code.

But it somehow stopped working when I moved the detail screen out into another NavHost. If you want to investigate this, I can provide some code. I don't know for sure if it's a problem with the new api or compose-destinations.

from compose-destinations.

raamcosta avatar raamcosta commented on June 12, 2024

I just made use of shared element transitions with no issue. I don't think the "glichyness" is related to Compose Destinations.

That said, I will with next release do some changes that should make using it easier. Specifically with the way to send SharedTransitionScope and AnimatedVisibilityScope.

from compose-destinations.

ammargitham avatar ammargitham commented on June 12, 2024

@raamcosta I have created a sample project which shows the shared element bug when the screens are in nested navhost.
In the sample, Clicking rows which go to "Detail in List" will correctly work with shared transition, where as those with "Detail in Root" won't work.

ComposeDestinationSharedElemBug.zip

from compose-destinations.

raamcosta avatar raamcosta commented on June 12, 2024

@ammargitham have you tried the same code without Compose Destinations and with official compose navigation lib?

I really don’t think Compose Destinations is causing this issue as we just bridging things from the official lib.

from compose-destinations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.