Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
update sample
Browse files Browse the repository at this point in the history
  • Loading branch information
florent champigny committed Mar 13, 2018
1 parent da543a7 commit 4b0abe4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ package com.github.florent37.kotlin.pleaseanimate.core.custom

import android.animation.Animator
import android.animation.ArgbEvaluator
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.view.View
import android.widget.TextView

class TextColorAnimExpectation(private val textColor: Int) : CustomAnimExpectation() {

override fun getAnimator(viewToMove: View): Animator? {
if (viewToMove is TextView) {
return ObjectAnimator.ofInt(viewToMove, "textColor", viewToMove.currentTextColor, textColor).apply {
return ValueAnimator.ofInt(viewToMove.currentTextColor, textColor).apply {
addUpdateListener { valueAnimator ->
viewToMove.setTextColor(valueAnimator.getAnimatedValue() as Int)
}
setEvaluator(ArgbEvaluator())
}
} else {
Expand Down

0 comments on commit 4b0abe4

Please sign in to comment.