1

I made animation for background colors of the text views like these:

final TextView textView1 = 
(TextView)findViewById(R.id.leftleft);

Resources res = getResources();
final TransitionDrawable crossfaderView1 =

getTransitionDrawableFromColors(R.color.green, R.color.lime);


textView1.setBackground(crossfaderView1);


chooseChangeColors.setOnClickListener(
new View.OnClickListener() 
{

@Override

public void onClick(View v) {

if (somethingElseIsPressed == true) {

crossfaderView1.reverseTransition(timeForTransition);
} 
else {

 crossfaderView1.startTransition(timeForTransition);
}

somethingElseIsPressed = !somethingElseIsPressed;

}

});

But I want to make text in these textViews also changing its own color and text itself.

How can I achieve this?

Heshan Sandeepa
  • 3,388
  • 2
  • 35
  • 45
  • Do the same but this time with the textColor atribute – Quark Mar 30 '15 at 15:27
  • I prefer the Animation class and using the applyTransformation method. There you may blend your textColor to whatever you like depending on the interpolatedTime parameter (0-1 relative to animationtime given) here is an example on how to blend colors yourself: http://stackoverflow.com/questions/6070163/color-mixing-in-android . inside the applyTransformation method you may just apply the resulting color to your TextColor, Background or w/e you like – blender Mar 30 '15 at 15:29

0 Answers0