I want to add animation in android text view so that when a text changes it should change smoothly and slowly. Like, fade in or fade out when the text changes. Is it possibl
The easiest way to do this is:
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewGroup parent=(ViewGroup) tv.getParent(); //get parent of the TextView
parent.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING); //enable animations
tv.setText(String.valueOf(Integer.valueOf((String) tv.getText()) + 1)); //change the text
}
});
Now, your text should change slowly and nicely