Colton Idle
01/18/2023, 3:46 AMeygraber
01/18/2023, 3:51 AMromainguy
01/18/2023, 3:56 AMColton Idle
01/18/2023, 4:10 AMromainguy
01/18/2023, 4:11 AMephemient
01/18/2023, 4:30 AMephemient
01/18/2023, 5:22 AMvar size by remember { mutableStateOf(IntSize.Zero) }
val t by rememberInfiniteTransition().animateFloat(
initialValue = -1f,
targetValue = 1f,
animationSpec = infiniteRepeatable(
animation = tween(durationMillis = 7_500, easing = EaseInOut),
repeatMode = RepeatMode.Reverse,
),
)
Box(
modifier = Modifier
.onSizeChanged { size = it }
.background(
brush = Brush.linearGradient(
0 / 3f to Color(0xffee7752),
1 / 3f to Color(0xffe73c7e),
2 / 3f to Color(0xff23a6d5),
3 / 3f to Color(0xff23d5ab),
start = Offset(size.width * t, 0f),
end = Offset(size.width * (t + 1), Float.POSITIVE_INFINITY),
)
)
.fillMaxSize()
)
Colton Idle
01/18/2023, 2:13 PMste
01/18/2023, 3:35 PMColton Idle
01/18/2023, 4:36 PMromainguy
01/18/2023, 4:40 PMdarkmoon_uk
01/19/2023, 1:44 AM@Composable
working across Android, iOS and Desktop.