David Corrado
06/21/2022, 10:51 PMRow {
Row {
Text("test")
Spacer(modifier = Modifier.weight(1f))
Text("test2")
}
Text("test3")
}
Row {
Row {
Text("test")
Spacer(modifier = Modifier.weight(1f))
Text("test2")
}
Row {
Text("test")
Spacer(modifier = Modifier.weight(1f))
Text("test2")
}
Text("test3")
}
dorche
06/21/2022, 11:48 PMhorizontalArrangement = Arrangement.SpaceBetween
On your RowsChris Sinco [G]
06/21/2022, 11:59 PMDavid Corrado
06/22/2022, 12:09 AMFrancesc
06/22/2022, 5:06 AMLayout
for more flexibility. That would be my choice.Stylianos Gakis
06/22/2022, 11:32 AMCard {
Row(verticalAlignment = Alignment.CenterVertically) {
Column(Modifier.weight(1f, true)) {
HorizontalTextsWithMaximumSpaceTaken(
{
Text("45m")
},
{ textAlign ->
Text("Nov1", textAlign = textAlign)
}
)
HorizontalTextsWithMaximumSpaceTaken(
{
Text("Jogging or running")
},
{ textAlign ->
Text("10:45 AM", textAlign = textAlign, style = MaterialTheme.typography.h4)
}
)
}
Icon(Icons.Default.ArrowForward, null, Modifier.size(40.dp))
}
}
Is it what you’re going after?HorizontalTextsWithMaximumSpaceTaken
name isn’t necessarily true, since it’s two slots, they could also not be texts in your use case and you can add the running icon in there or whatever. HorizontalItemsWithMaximumSpaceTaken maybe 😅 I am bad at naming stuffDavid Corrado
06/22/2022, 2:52 PMRow {
Row(modifier = Modifier.weight(1f)) {
Text("test")
Spacer(modifier = Modifier.weight(1f))
Text("test2")
}
Text("test3")
}
Like the above. Basically I wanted
|test test2test3| which is what the above doesStylianos Gakis
06/22/2022, 3:11 PMFrancesc
06/22/2022, 3:14 PMfill
parameter on weight
can be used for, set it to false
if you want to ensure the non-weighted item is not pushed off the scerenStylianos Gakis
06/23/2022, 7:01 AM