Skip to content

Instantly share code, notes, and snippets.

@SerggioC
Last active May 19, 2019 14:16
Show Gist options
  • Save SerggioC/1330bcaf8c72cf6e3b336d6bc8d558d6 to your computer and use it in GitHub Desktop.
Save SerggioC/1330bcaf8c72cf6e3b336d6bc8d558d6 to your computer and use it in GitHub Desktop.
fun View.flickerAnimation() {
AnimatorInflater.loadAnimator(this.context, R.animator.cycle_alpha_animator).apply {
setTarget(this)
start()
}
}
<?xml version="1.0" encoding="utf-8"?>
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="100"
android:propertyName="alpha"
android:repeatCount="4"
android:repeatMode="restart"
android:valueFrom="0"
android:valueTo="1"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment