Comments (7)
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.
@raamcosta Okay, I tried with the official lib. Same behavior. Will raise issue in Google issue tracker.
from compose-destinations.
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.
@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.
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.
@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.
@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)
- 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
- [DEEPLINK][2.1.0] Request to bring back withDeepLink() HOT 9
- 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 3
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.