ursus
07/10/2025, 6:15 PMmaxWidth
which is from the box with constraints scopeSergey Y.
07/10/2025, 6:19 PMthis.maxWidth
ursus
07/10/2025, 6:20 PMStylianos Gakis
07/10/2025, 8:02 PMursus
07/10/2025, 8:03 PMStylianos Gakis
07/10/2025, 8:12 PMModifier
.fillMaxWidth()
.wrapContentWidth()
.fillMaxWidth(0.9f)
Play around with it a bit.
We do this here https://github.com/HedvigInsurance/android/blob/develop/app%2Ffeature%2Ffeature-chat%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fhedvig%2Fandroid%2Ffeature%2Fchat%2FChatLoadedScreen.kt#L430-L434 for some chat messages that should take at most 80% of the available width.
You skip a Subcomposition completely that wayursus
07/10/2025, 8:14 PMursus
07/10/2025, 8:15 PMStylianos Gakis
07/11/2025, 12:18 AM.widthIn(max = 400.dp)
or something like that.
This post https://blog.zachklipp.com/centering-in-compose/ will explain a lot of things much better than I ever could. I suggest you start there and see if it makes any more sense to you