Apoorv Patel
ConstraintLayout
ConstraintLayout(modifier = Modifier.padding(top = 16.dp, bottom = 16.dp)) { val (profileImage, progressText1) = createRefs() Image( modifier = Modifier .constrainAs(profileImage){ start.linkTo(parent.start, 16.dp) }.preferredWidth(72.dp) .preferredHeight(72.dp) .background(Color.Green), asset = imageResource(R.drawable.unknown_profile_empty) ) val half = createGuidelineFromTop(0.5f) Text(text = "Sample text", modifier = Modifier.background(Color.Red).constrainAs(progressText1) { bottom.linkTo(half, 0.dp) start.linkTo(profileImage.end, 0.dp) end.linkTo(parent.end, 16.dp) }) }
Hitanshu Dhawan
end.linkTo(parent.end, 16.dp)
apoorv9990
Text(text = "Sample text", modifier = Modifier.background(Color.Red).constrainAs(progressText1) { bottom.linkTo(half, 0.dp) start.linkTo(profileImage.end, 0.dp) end.linkTo(parent.end, 16.dp) width = Dimension.fillToConstraints })
width = Dimension.fillToConstraints
A modern programming language that makes developers happier.