Comments (4)
My use case is the main screen (also a destination) has many navigables to other screens and so I have them created separately as a list and passing them around - then I need to type them.
I kind of like that a Destination annotation generates a Destination
I'd say it can also bring some confusion. We are marking a composable as a destination, but the generated resulting object is much more than a "destination", it is a routing specs, argument processor, navigation factory... Since this interface is used much less than the annotation I'd change its name. Surprisingly, I've just realized the interface is already named correctly - DestinationSpec
. It seems quite right to me.
Knowing this it seems to be solved for me as I don't utilize the sealed interface.
from compose-destinations.
Hi @hrach 👋
Thanks for the feedback!
I understand, but at the same time I kind of like that a Destination annotation generates a Destination.
What I found is that it should be rare that you want to import both of them in the same file.
What is your use case for wanting to import both in the same file?
I'm definitely not excluding the possibility of renaming the interface. It's just that I'd like to know exactly the cases where we'd want to import both of them before I make a decision.
from compose-destinations.
Btw, this might be a good solution in the meantime:
typealias AppDestination = com.ramcosta.composedestinations.Destination
Put this anywhere and then you can refer to the Destination interface as AppDestination
.
from compose-destinations.
Yap, in the core, the interface is DestinationSpec
. The only reason we have Destination
generated is so that it can be sealed. I think it allows for some neat extension functions/properties.
I think with both solutions described here typealias
and just using DestinationSpec
, we can close this issue for now, if you agree. Later if this comes up again, I'll rethink the name of the generated one.
Please close it if you agree 🙂
from compose-destinations.
Related Issues (20)
- Multi-module setup throws compilation error that start route does not exist. HOT 3
- Incompatible with androidx.navigation 2.8.0-alpha06 and newer HOT 1
- Theme doesn't carry over to other destinations HOT 1
- Navigate to another module with args HOT 3
- NavTypeSerializer HOT 3
- ModuleDestinations$Includes is defined multiple times in Multi-Module project HOT 4
- [ksp] java.lang.NullPointerException when using custom NavArgument type HOT 13
- No NavGraphs in V2 HOT 14
- Support for Shared Element Transition. HOT 2
- Tab navigation support. HOT 1
- 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
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.