Is there any trick or way to use nested navigation...
# compose
a
Is there any trick or way to use nested navigation with some sharable UI content ? Fir example in my case I want all the :
Copy code
policyGraph()
contactUsGraph()
aboutUsGraph()
conditionOfUseGraph()
share the same "Custom Parent Layout" but the other graphs do not share that layout ?
i
We talked about this recently as well as the long term vision for these types of UI that is shared across multiple destinations: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1654836389534839?thread_ts=1654793995.106589&cid=CJLTWPH7S
But right now, that shared content would need to be hoisted up out of the
NavHost
(just like any other shared UI, probably using
AnimatedVisibility
+ looking at the currentBackStackEntry and its
hierarchy
to determine if you are in a particular graph to know when that UI should be visible or not
d
I am experimenting with what it would take to have a single Scaffold for the entire app that responds to screen changes. I imagine it will be a lot of work and infrastructure but I believe I could make beautifully animated screen transitions.
♥️ 1
l
I just have to ask, what is
Modifier.sharedElement
and where does it exist? I mean, it’s referred to as the secret sauce and that seems to be oh so true.
i
The "in a shared element based world" doesn't exist yet - it is referring to the future state
👍 1
s
https://kotlinlang.slack.com/archives/CJLTWPH7S/p1712495286104259?thread_ts=1668617994.752349&cid=CJLTWPH7S I’ll take the role of the shared element evangelist and let you know that this is now possible 😄
👍 1
l
Thanks