текст без многоточия
Код: Выделить всё
@Preview(showBackground = true)
@Composable
fun Preview() {
MyApplicationTheme {
Box(
modifier = Modifier.size(100.dp),
contentAlignment = Alignment.Center
) {
Text(
text = "Hello ".repeat(1),
style = MaterialTheme.typography.bodyMedium.copy(
shadow = Shadow(
Color.Black,
blurRadius = 30f
)
),
modifier = Modifier
.width(100.dp),
fontSize = 12.sp,
overflow = TextOverflow.Ellipsis,
maxLines = 1
)
}
}
}

текст с многоточием
Код: Выделить всё
@Preview(showBackground = true)
@Composable
fun Preview() {
MyApplicationTheme {
Box(
modifier = Modifier.size(100.dp),
contentAlignment = Alignment.Center
) {
Text(
text = "Hello ".repeat(20),
style = MaterialTheme.typography.bodyMedium.copy(
shadow = Shadow(
Color.Black,
blurRadius = 30f
)
),
modifier = Modifier
.width(100.dp),
fontSize = 12.sp,
overflow = TextOverflow.Ellipsis,
maxLines = 1
)
}
}
}

Подробнее здесь: https://stackoverflow.com/questions/791 ... n-ellipsis