How would one go about have (1) layout for landsca...
# compose
b
How would one go about have (1) layout for landscape and another layout for portrait, using jetpack Compose? and by layout I mean the arrangement of the views or elements making up the screen? Thanks
1
z
You can use BoxWithConstraints
m
but how about totally different layouts? say I want to have a totally different layout based on orientation or maybe even screen size, one single layout wont suffice it... in the current implementation I could have different xmls in different folders(layout-land/layout-portrait/layout-sw600dp, etc), this solution wouldn't really work for that case 😔
b
zachklipp, do you know of some tutorials using BoxWithConstraints?
e
just check the width
if (width > 600.dp) LandscapeLayout()
else PortraitLayout()
☝🏻 1
☝️ 4
☝🏾 2