Question

Eclipse won't let me compile my project because of this error:

The method playTogether(Animator...) in the type AnimatorSet is not applicable for the arguments (ObjectAnimator, ObjectAnimator, ObjectAnimator)

Here is a snippet of code illustrating the problem:

AnimatorSet s = new AnimatorSet();             
//IMPORTED NINEOLDANDROID LIBRARY TO HANDLE THIS PRE-HONEYCOMB
           ObjectAnimator colorAnimation = ObjectAnimator.ofInt(findViewById(v.getId()), "backgroundColor", colorFrom, colorTo);
           colorAnimation.setEvaluator(new ArgbEvaluator());
           //colorAnimation.start();

           ObjectAnimator txtColor = ObjectAnimator.ofInt(txtDesc, "textColor", getResources().getColor(R.color.bg), getResources().getColor(R.color.white));
           txtColor.setEvaluator(new ArgbEvaluator());
           //txtColor.start();

           ObjectAnimator txtAnimation = ObjectAnimator.ofInt(txtDesc, "backgroundColor", getResources().getColor(R.color.white), colorTo);
           txtAnimation.setEvaluator(new ArgbEvaluator());
           //txtAnimation.start();

           s.playTogether(colorAnimation, txtColor, txtAnimation);

            s.setDuration(250).start();

Essentially what I'm doing is when a user touches the screen I want to change the colour of a number of views.

Thank you in advance for any assistance you can offer.

Was it helpful?

Solution

I had both the standard android.animation.* import and the nineoldandroids import.That was obviously causing Eclipse to become confused.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top