Joseph Hawkes-Cates
05/23/2022, 4:44 PMJoseph Hawkes-Cates
05/23/2022, 4:46 PMJoseph Hawkes-Cates
05/23/2022, 4:47 PMZach Klippenstein (he/him) [MOD]
05/24/2022, 4:56 PM@Composable
fun NumberLine(
count: Int,
numberLabel: @Composable (Int) -> Unit
) {
require(count > 0)
Row(horizontalArrangement = Arrangement.SpaceBetween) {
for (i in 0 until count) {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
Box(
Modifier
.size(1.dp, 50.dp)
.background(Color.Black)
)
numberLabel(i)
}
}
}
}
It’s not much more to add the gradient, but depends how you want your component to interact with incoming height constraints.Zach Klippenstein (he/him) [MOD]
05/24/2022, 4:57 PMJoseph Hawkes-Cates
05/24/2022, 4:59 PMJoseph Hawkes-Cates
05/24/2022, 5:02 PMhttps://prod.smassets.net/assets/cms/sm/uploads//nps-question-survey-question-types-1130x313.png▾
Joseph Hawkes-Cates
05/24/2022, 5:03 PMJoseph Hawkes-Cates
05/24/2022, 5:04 PMJoseph Hawkes-Cates
05/24/2022, 5:06 PMwrapContentWidth(unbound=false)
modifier.Joseph Hawkes-Cates
05/24/2022, 5:07 PMJoseph Hawkes-Cates
05/24/2022, 5:08 PMJoseph Hawkes-Cates
05/24/2022, 5:08 PMJoseph Hawkes-Cates
05/24/2022, 5:10 PM