Code example for ValueAnimator

Methods: addListeneraddUpdateListener

        if (v.getBackground() instanceof BackgroundAlphaColorDrawable) { 
            final BackgroundAlphaColorDrawable bg = (BackgroundAlphaColorDrawable) v 
            anim = ValueAnimator.ofObject(new ArgbEvaluator(), info.color, 
                    BackgroundAlphaColorDrawable.applyAlphaToColor(bg.getBgColor(), alpha)); 
            anim.addUpdateListener(new AnimatorUpdateListener() { 
                public void onAnimationUpdate(ValueAnimator animation) { 
                    info.color = (Integer) animation.getAnimatedValue(); 
        } else { 
            // custom image is set by the theme, let's just apply the alpha if we can. 
            return null; 
        anim.addListener(new AnimatorListener() { 
            public void onAnimationStart(Animator animation) {
            public void onAnimationRepeat(Animator animation) {
Experience pair programming with AI  Get Codota for Java