I am using ComposeDestinations library, with botto...
# compose
s
I am using ComposeDestinations library, with bottomsheets as destination , now i have a scenario where i have screen B over screen A meaning screen B is a bottomsheet which is current active destination and the bottom sheet is lets say almost half height of screen so screen A is visible(dim) partially in background and now i want to update a text value displayed in that partially visible screen A from the screen B i.e bottom sheet .I need to do it from the bottom sheet without closing it. Any idea how to do it?
👀 1
s
Actually curious about it. I wonder if you shouldn't use another activity with a transparent theme so that the previous activity (holding A) stays started to keep receiving some events bound to this lifecycle while B is visible 🤔
I have the same requirements to display a screen B on top of A while still seeing A (without the update requirement you have). I managed this with another activity as suggested above but I didn't consider using a fullscreen bottom sheet 🙂
s
I am using single activity and composables
s
That's my intent too but I wonder if that's feasible given the composable lifecycle to kept being notified. Would love to have someone else's opinion on this 🙂
👍 1
s
Actually if possible i want solution with current design otherwise i will have to make bottomsheet fullscreen and change design which i cant`t afford at the moment
c
I would not have it as a destination as per Ian Lakes advice he gave me a few weeks ago. It's like if you had a time picker dialog related to a screen. You wouldn't have that as a separate destination. So it just makes more sense to use a modalBottomasheet wrapper on your screen. If you're convinced that you still need to go this route you could just share a view model?
i
Navigation supports returning a result that would work just fine for updating screen A from screen B and has no requirement that screen B be closed before the result is returned (screen A would still be started while screen B is on top of it, so
observeAsState()
still works just fine).
today i learned 2
I know Compose Destination has some support for returning a result; if they've forced tying that to popping back to the other destination, you should reach out to them to ensure that instantly returning a result is also an option, as it is in Navigation itself