[Android TV] 選択時の枠の強調(animateColor)

androidx.tv.material3の選択可能なコントロールであれば選択時自動で枠が表示されて強調されるのでそのままでもよいですが、せっかくなのでFire TV Cube(Stickの方も同じかも)と同じように枠の点滅アニメーションを追加してみます

@Composable
fun animationBlinkColor(): State<Color> {
    val infinityTransition = rememberInfiniteTransition(label = "BlinkColorInfiniteTransition")
    return infinityTransition.animateColor(
        initialValue = Color(0xFFD0D0D0),
        targetValue = Color(0xFF404040),
        animationSpec = infiniteRepeatable(
            tween(1000, easing = LinearEasing),
            repeatMode = RepeatMode.Reverse
        ),
        label = "BlinkColorAnimation"
    )
}
val animationColor = animationBlinkColor()
ClassicCard(
    border = CardDefaults.border(
        focusedBorder = Border(
            border = BorderStroke(
                width = 2.dp,
                color = animationColor.value
            ),
        )
    ),
...

Android Studio Hedgehog 2023.1.1 RC 3 built on November 3, 2023