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
You can use TranslateAnimation
An animation that controls the position of an object.
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TranslateAnimation animObj= new TranslateAnimation(0,tv.getWidth(), 0, 0);
animObj.setDuration(2000);
tv.startAnimation(animObj);
tv.setText(String.valueOf(Integer.valueOf((String) tv.getText()) + 1));
}
});
You can check below links for demo case