How do I center something in parent and then draw something next to it?
if it were a
Row
then obviously the center would be in the middle of the two, which is not what I want
Only a custom layout? (Am I basically thinking of RelativeLayout?)
f
Francesc
01/18/2023, 8:47 PM
a custom layout seems the best approach. You could use
onGloballyPositioned
and adjust the 2nd view based on the info from the 1st, but that's not the way I'd go
u
ursus
01/18/2023, 8:57 PM
Hmm yea, or hacky way could be to put a spacer in the Row to act as counterweight. which then would center the center thing,
LL CCCC SS
k
Kirill Grouchnikov
01/18/2023, 9:14 PM
What is the “draw something next to it”? A canvas, a composable with interactable content in it, an image?
u
ursus
01/18/2023, 9:22 PM
Its just a Button with CircularProgressIndicator and Text, where I want the text centered, not their combined width
g
Giang
01/18/2023, 9:50 PM
Compose constraint layout can do that, but too overkilling. Maybe add a square box that has the same size with indicator to the other side of the text