Closed DatL4g closed 2 months ago
Can you elaborate on what you expect from Decompose? Maybe some examples?
Exactly. Not sure if you want to do something like Pages which has a direct Decompose integration for Adaptive Layouts as well.
But an example would be nice.
I mean, if you are missing anything in particular, feel free to add an example or describe your use case. Currently I don't think we should anyway to Decompose.
Well I'm not quite sure how to implement it "correctly", as there are a few things to think about.
Normally I just use ChildStack for my screens and ChildSlot for views like bottomsheets or dialogs. When we use adaptive layouts it becomes something in between.
For example if we have a ListScreen with an overview of all items and DetailsScreen for them, then on small screens it should just behave like a stack (so ChildStack?) put the view above the other and with predictiveBack animation. However on large screens it should behave more like a view (so ChildSlot?) as the details screen should align next to the list screen then and has no predictiveBack animation.
This sounds quite complicated and something decompose should handle directly, but as I said I'm not sure if you want to add a component for this.
Do you have any best practices or example projects, how we should handle this?
Thanks for the use case! I think in this particular case Adaptive Layouts won't work with Decompose. Some manual work is needed. You can check out the Multi-Pane sample, as it exists exactly for this reason. Please keep in mind that the sample supports dynamic resize. If you don't needed, then the code could be simplified.
To be honest not sure how jetpack-navigation works with adaptive layouts either, not sure they have dug into good integration. So yeah probably going to be a bit custom until there is a bit more expectations for how these "should" work
Sounds good, closing for now.
The latest release 3.2.0-beta01 adds the new Child Panels navigation model (experimental).
Seems like Compose 1.7.0 will come with full adaptive support.
Looking forward to some documentation how we should use it with components or direct Decompose integration.