has anyone seen decent examples of master/detail a...
# compose
j
has anyone seen decent examples of master/detail apps built with Compose? looking at building something which I’d like to run on both phones and tablets with a slightly enhanced tablet view. last time I had to do this was before Android Architecture components even existed (so pre-ViewModel etc).. I’m wondering if anyone has seen anything with a master/detail tablet view which is using modern architecture, and specifically Compose?
i
Note that in the non-Compose world, we just released specific guidance and components around two pane layouts: https://developer.android.com/guide/topics/ui/layout/twopane
👍 1
tl/dr: every screen should be responsive. Some subset of your screens may want to use a two pane layout. Generally, that means a fixed left pane (managed by the two pane screen) and using a nested NavHost / etc. for the right pane
There's no
SlidingPaneLayout
equivalent in Compose as of yet (something that would automatically adapt to the available size to either overlap the two panes or show them side by side), so you would need to write that yourself at this moment (it is on the todo list for later this year though)
I'm a big fan of the Compose layouts code lab if you want to dive into how exactly you might approach making that layout: https://developer.android.com/codelabs/jetpack-compose-layouts
j
😮 I totally missed the release and info around
SlidingPaneLayout
, thanks for that!
a
Adapting to different available sizes like that is a great use for
BoxWithConstraints
☝️ 2
👍 2
i
Yeah, custom layouts in general are way easier in Compose, same with the slide in of the detail pane
1