Giter Club home page Giter Club logo

Comments (9)

raamcosta avatar raamcosta commented on June 10, 2024 1

Ok.
What do you think of an API like this:

DestinationsNavHost(
    //...
) {
    // next to other "runtime" setup we can have with Compose Destinations
    MyDestination addDeepLink { uriPattern = "URI PATTERN" }
}

You could create an extension function too if you prefer:

public fun ManualComposableCallsBuilder.addDeepLink(destination: DestinationSpec, scheme: DeeplinkScheme) {
    return destination addDeepLink { uriPattern = "${scheme.value}://${destination.route}" }
}

But you would need to call it inside the DestinationsNavHost trailing lambda.

Haven't even tried to code this, but just from the top of my head, it should be possible.

from compose-destinations.

raamcosta avatar raamcosta commented on June 10, 2024

Hey 👋

So essentially you need to be able to set deep links at runtime. The problem is not where it is set, since there's ways to override things like deep links when importing destinations or graphs. The problem is that you cannot use annotations coz those can only take constants.

Is that it?

from compose-destinations.

extmkv avatar extmkv commented on June 10, 2024

Yes, that's exactly the problem.

from compose-destinations.

extmkv avatar extmkv commented on June 10, 2024

I think that will solve our problem, but tbh, I would prefer to be able to add it to the destination instead, so everything can be together on the graph.

from compose-destinations.

extmkv avatar extmkv commented on June 10, 2024

Just realized that by doing your approach we can start generating instead of building our owns.

from compose-destinations.

raamcosta avatar raamcosta commented on June 10, 2024

So, is that good or bad? I'm not sure I understand what you mean 🤔

from compose-destinations.

extmkv avatar extmkv commented on June 10, 2024

It's better. We had to have the custom graphs just to include deeplinks, by using that approach it will be not necessary because the deeplinks will be added to the DestinationsNavHost trailing lambda.

from compose-destinations.

raamcosta avatar raamcosta commented on June 10, 2024

Ahh, yes. With v2 there should be no reason for implementing NavGraphSpec of core library manually.

from compose-destinations.

raamcosta avatar raamcosta commented on June 10, 2024

Went with above approach. It is included in beta07 that is currently building, so probably up in about 30min or so.
That version will also contain your PR changes (thanks for that! 🙏 )

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.