https://kotlinlang.org logo
#android
Title
# android
a

Alex Davidyuk

08/07/2019, 4:43 PM
I have a ImageButton with a drawable shape as the background. The shape has a solid android:color="someColor". I'm wondering how I could animate the color with a breathing/puslating effect so that it beckons the user to tap on the button? Anybody have ideas? I've look around on multiple stack overflow approaches, but they're quite dated and I couldn't translate the Java code presented to the proper Kotlin. Any help would be appreaciated!
v

voben

08/07/2019, 4:48 PM
Maybe an animated vector drawable? More on animations here

https://www.youtube.com/watch?v=N_x7SV3I3P0

a

Alex Davidyuk

08/07/2019, 6:50 PM
I will check that out. Thanks. Any other input from others?
g

gildor

08/08/2019, 12:54 AM
First try to use Java and if everything will work, convert to Kotlin using auth converter, if you have any questions how convert particular code to Kotlin post it in #general or #getting-started
m

Mike Wolfson

08/08/2019, 5:09 PM
You can use an alpha transition, to modulate the color of a View (and change its transparency)...then if you add an interpolator to that (which changes the way the animation happens), and adjust the timing, you can get pretty far.
4 Views