Nacho Ruiz Martin
08/11/2021, 1:16 PMadjustViewBounds
in Compose’s Image
?
I want an image’s height to be driven by the width + keep original aspect ratio so I’m using
alignment = Alignment.Center,
contentScale = ContentScale.FillWidth,
but this creates vertical padding that I want to get rid of.
In traditional view system I would just ad adjustViewBounds=true
.Nacho Ruiz Martin
08/11/2021, 1:17 PMModifier.aspectRatio
for this but I’d want to avoid calculating the aspect ratio manually if possible since I’m working with android.net.Uri
and I don’t want to open the file twice.Colton Idle
08/12/2021, 8:15 AMNacho Ruiz Martin
08/12/2021, 3:43 PMColton Idle
08/12/2021, 4:15 PMNacho Ruiz Martin
08/12/2021, 4:24 PM