https://kotlinlang.org logo
#compose-wear
Title
# compose-wear
a

amoledwatchfaces

02/27/2023, 1:01 PM
Hello, I'm currently migrating my app to Compose Wear OS and I'm struggling with ToggleChips & multiple lines. What exactly to do if I want to have ToggleChip height adapted to the number of lines of label / secondarylabel? I can specify maxlines but without success, wrap content height does not help either. Label text will replace secondarylabel with 2nd line but there is still some text missing and secondary label is missing completely. I'll be happy for any help 🙂
IMG_20230227_140743_783.jpg
a

Ataul Munim

02/27/2023, 2:50 PM
Are you wanting the chip itself to grow/shrink with its content's height?
a

amoledwatchfaces

02/27/2023, 4:07 PM
Yes
Any Idea? Maybe that fillMaxWidth modifier is not good to use?
a

Ataul Munim

02/28/2023, 6:23 AM
Did you try setting the wrap content height on the chip? In the screenshot, you've set it on the text
j

John Nichol

02/28/2023, 8:03 AM
The
ToggleChip
is not designed to adapt its height. The UX guidance is here https://developer.android.com/training/wearables/compose/toggle-chips. You can override the height if you want to using modifiers. But I would suggest if you are looking for larger content think whether other UX approaches might be a better fit.
a

amoledwatchfaces

03/02/2023, 5:00 AM
Thanks for your answers 🙂 Solved it by different UX approach
9 Views