David Breneisen
09/22/2024, 1:44 PMChrimaeon
09/22/2024, 2:28 PMromainguy
09/22/2024, 3:30 PMDavid Breneisen
09/22/2024, 4:52 PMDavid Breneisen
09/22/2024, 5:34 PMval scope = rememberCoroutineScope()
val animation = remember { Animatable(0f) }
Card(
backgroundColor = AppColors.button(),
modifier = Modifier
.fillMaxWidth()
.padding(animation.value.interval(16.dp, 0.dp))
.height(animation.value.interval(height, with(LocalDensity.current) { containerSize.value.height.toDp() }))
.clickable() {
scope.launch {
animation.animateTo(1f, animationSpec = tween(durationMillis = 200))
}
}
)
fun Float.interval(start: Dp, end: Dp) = ((end - start) * this) + start
romainguy
09/22/2024, 5:37 PMromainguy
09/22/2024, 5:37 PMromainguy
09/22/2024, 5:37 PMromainguy
09/22/2024, 5:41 PMDavid Breneisen
09/22/2024, 5:47 PM