Nat Strangerweather
05/22/2021, 3:23 PMNat Strangerweather
05/22/2021, 3:23 PMNat Strangerweather
05/22/2021, 3:23 PMlistOf(
Color(0xffDFFF00),
Color(0xffFFBF00),
Color(0xffFF7F50),
Color(0xffDE3163),
Color(0xff9FE2BF),
Color(0xff40E0D0),
Color(0xff6495ED),
Color(0xffCCCCFF),
).forEachIndexed { index, color ->
val infiniteTransition = rememberInfiniteTransition()
val positionState = infiniteTransition.animateFloat(
initialValue = 0f,
targetValue = 1f,
animationSpec = infiniteRepeatable(
animation = tween(
durationMillis = 2500,
delayMillis = delay,
easing = LinearEasing
)
)
)
delay += 1000
val modifier = Modifier.offset(
x = (maxWidth - tileSize),
y = maxHeight - (maxHeight * positionState.value),
)
Box(
modifier = modifier
.size(tileSize)
.clip(RoundedCornerShape(5.dp))
.background(color = color)
) {
Text(
text = text,
Modifier.align(Alignment.Center),
style = TextStyle(fontWeight = FontWeight.Bold)
)
}
Saiedmomen
05/22/2021, 6:46 PMNat Strangerweather
05/22/2021, 7:25 PMSaiedmomen
05/22/2021, 7:43 PMNat Strangerweather
05/22/2021, 7:45 PM