Hey everyone :wave: I am facing a challenge for a...
# compose
c
Hey everyone 👋 I am facing a challenge for a custom TopAppBar in Compose and I suppose the ConstraintLayout could help there but I am not sure how it would work. My goal: • Have the navigation icon linked to the start • Have the title centered (between parent.start and parent.end) • Have actions linked to the end (could be zero, one or two icons) My problem: • When I center the title from parent.start to parent.end, long titles would overlap with the action icons. Therefore I would like to keep the title centered, but ellipsize the title when the title.end would overlap with actions.start
k
c
Sweet. Thanks @KamilH 🙌
d
I accomplished this by using a row with three other rows in it. There's a start row center row and end row. The center row is set to have weight of one so it takes up all of the available space the other rows don't.