Smooth text change in android animation

前端 未结 7 2028
刺人心
刺人心 2020-12-11 00:29

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

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 01:14

    If you want to support Android 4+. check out the Transitions Everywhere lib. You can achieve all sorts of different animations with backward compatibility.

    Here you can find some examples.

    Just a few lines and you are good to go!

    TransitionManager.beginDelayedTransition(transitionsContainer,
            new ChangeText().setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN));
    

    Now all you have to do is change the text and all the magic is done for you.

提交回复
热议问题