Hey #fedihelp,

I'm struggling with an #Android #widget issue, and I was wondering if anyone had any clue.

Basically: I have a widget with a grid of items. I want the items in the grid to stick to a certain aspect ratio, regardless of the widget width. The height should dynamically adjust so it always stays that aspect ratio. Normally I would use a ConstraintLayout, but that doesn't seem supported on widgets and I cannot find any good alternative.

Code here: github.com/CatimaLoyalty/Andro…

Thank you!

Peter Vágner reshared this.

in reply to Sylvia

I ended up settling on just hardcoding an exact size for each grid entry in "dp", then scaling it up until it "felt right" and going with that. It should work. I'm still annoyed Android widgets are so limiting but well, this will be good enough to ship I think.

github.com/CatimaLoyalty/Andro…

Now for a good night's rest and then some final cleanups after work. Then this can probably be shipped with the next release :)