Это фрагмент кода
Код: Выделить всё
val saturation by animateFloatAsState(
targetValue = if (isSelected) 1f else 0f,
animationSpec = tween(durationMillis = 1_000)
)
var rememberSaturation = remember(saturation) {
ColorMatrix().apply {
this.setToSaturation(if (isSelected) 1f else 0f)
}
}
Код: Выделить всё
Image(
modifier = Modifier.size(24.dp),
painter = painterResource(currencyCode.flag),
contentDescription = null,
colorFilter = ColorFilter.colorMatrix(rememberSaturation)
)

Подробнее здесь: https://stackoverflow.com/questions/786 ... a-duration
Мобильная версия