Comments (9)
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.
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.
Yes, that's exactly the problem.
from compose-destinations.
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.
Just realized that by doing your approach we can start generating instead of building our owns.
from compose-destinations.
So, is that good or bad? I'm not sure I understand what you mean 🤔
from compose-destinations.
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.
Ahh, yes. With v2 there should be no reason for implementing NavGraphSpec of core library manually.
from compose-destinations.
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)
- Can not make dependenciesContainerBuilder example work HOT 2
- Serializer for class 'DirectionImpl' is not found in v2 HOT 10
- [2.1.0-beta03] Navgraphs.* cannot be imported in the generated NavGraphs HOT 3
- navargs.* cannot be imported in ArgsToSavedStateHandle.kt HOT 2
- HorizontalPager pageContent can't save state HOT 2
- NavGraphArhs are visible only in "start" destination HOT 6
- Removing from composition and re-adding when navigating HOT 3
- java.lang.IllegalStateException: Duplicate route found X_destination'. Routes must be unique!. In Muli-module project. HOT 2
- Missing classes detected while running R8 on AGP 8.4.0 HOT 2
- Video tutorials for using the library. HOT 1
- [KSP][2.1.0] _ModuleRegistry missing visibility modifiers HOT 4
- Can compose-destinations used in compose for desktop project ? HOT 1
- Accompanist Navigation Material functionality now available in androidx.compose.material.navigation.* HOT 2
- "Reproducible build" possible with Compose Destinations? HOT 5
- popUpTo matches navArgs exactly HOT 4
- Multiple Backstacks HOT 1
- [Improvement] moduleName could be automatically raname to "main" HOT 1
- Multiple NavGraphs with shared routes on V2 HOT 1
- Sharing a view model between destinations but with a view model factory HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compose-destinations.