how are you going between screens? what are you using for navigation?
b
Bryan Lee
12/19/2019, 11:22 PM
I start in ActivityA with setViewContent{..}
Then something triggers a startActivity(ActivityB) and I transfer data data using @Model object
Now I'm in ActivityB with setContent{..} and trying to mimic how JetNews navigates between Composable screens and now figuring out how to move data between the composable screens.
& I start in activityA with setViewContent since i'm working with a custom mapview & this is how i'm working around going from setViewContent to setContent
a
alexsullivan114
12/20/2019, 3:20 PM
Is there a good reason to actually transition activites?
➕ 1
(not saying there isn't; I'm just imagining a compose world being a single activity world)
a
Adam Powell
12/20/2019, 4:00 PM
most android app UI worlds are a lot easier with single activity per entry point, not just compose 🙂
when you decide to implement a screen as its own activity, you've decided that it must be able to stand in isolation, able to derive and load all necessary state from only the parcelable arguments in the intent that started it
this is a great tradeoff when you want to publish that intent-based interface to the system or to other apps as API for your app, not nearly as useful for internal navigation.
b
Bryan Lee
12/20/2019, 4:11 PM
I would prefer to use a single activity, but not sure how to transition between older views that need setViewContent and composable functions that need setContent. I'm assuming that's still a WIP so this is my work around for now.
Or maybe there is a way to transition that I haven't come across?
a
Adam Powell
12/20/2019, 4:14 PM
Leland might know the transition api off the top of his head but it's changed a few times and I don't remember it. In the absence of that, fragments that host either compose or view UI are an option