Skip to content

Instantly share code, notes, and snippets.

@bitvale
Created January 7, 2019 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitvale/5d99dbcf26c7d1c8567e3ab1eb7deb51 to your computer and use it in GitHub Desktop.
Save bitvale/5d99dbcf26c7d1c8567e3ab1eb7deb51 to your computer and use it in GitHub Desktop.
For Medium article "The power of Android Porter/Duff Mode"
private var animator = ValueAnimator.ofFloat(0f, 1f).apply {
addUpdateListener {
val value = it.animatedValue as Float
angle = lerp(0f, FULL_CIRCLE, value)
}
interpolator = CustomSpringInterpolator(INTERPOLATOR_FACTOR)
repeatMode = ValueAnimator.RESTART
repeatCount = ValueAnimator.INFINITE
duration = ANIMATION_DURATION
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment