This is my code:
@Preview
@Composable
private fun composable(){
ConstraintLayout(
modifier = Modifier
.padding(all = 8.dp)
) {
val (title, type) = createRefs()
Image(
painter = painterResource(R.drawable.ic_chat_grey),
contentDescription = "Badge",
colorFilter = ColorFilter.tint(
colorResource(
id = R.color.white
)
),
modifier = Modifier
.size(28.dp)
.constrainAs(type) {
top.linkTo(parent.top)
end.linkTo(parent.end)
},
)
Text(
text = "123456789009876554431213TEST12312312312TEST12312312334234TEST 123456789009876554431213TEST12312312312TEST12312312334234TEST 123456789009876554431213TEST12312312312TEST12312312334234TEST",
modifier = Modifier.constrainAs(title) {
top.linkTo(parent.top)
end.linkTo(type.start)
},
fontSize = 16.sp,
style = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Light,
color = colorResource(
id = R.color.white
)
),
textAlign = TextAlign.Start
)
}
}
And as you can see, the start of me text is not all present:
I tried setting text to be also start linked to parent -> but then it's always 0.dp, even if text is not bigger than screen. (with Dimension.fillToConstraint)
What am I doing wrong?