Ellipsis overflow in glance widget

202 Views Asked by At

Is there any way how to make Glance Text overflow ellipsis? (Three dots, if text is too long). In Jetpack compose, there is overflow parameter, but in Glance not...

2

There are 2 best solutions below

0
On

Please try maxLines.

Text(
    text = text,
    maxLines = 1,
)
0
On

Just set maxLines attribute to the Text and the ellipsis will be applied automatically

Text(
    text = text,
    maxLines = 2,
)