I have a blinking method, but this only works for the whole checkbox. I just want to blink the text inside the checkbox. Anyone know how to do this? And also, how can I change the text color when blinking?
Blink code:
fun View.blink(
times: Int = Animation.INFINITE,
duration: Long = 300L,
offset: Long = 100L,
minAlpha: Float = 0.0f,
maxAlpha: Float = 1.0f,
repeatMode: Int = Animation.REVERSE
) {
startAnimation(AlphaAnimation(minAlpha, maxAlpha).also {
it.duration = duration
it.startOffset = offset
it.repeatMode = repeatMode
it.repeatCount = times
})
}
and then in the checkbox:
checkBoxText.blink(3)