Skip to content

TextView Text Animation

Weiping Huang edited this page Apr 6, 2017 · 2 revisions

WoWoTextViewTextAnimation helps to change text in an instance of TextView. Any views that extends TextView is accepted to this animation. Check the demo activity for usage details:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    addTextAnimation(findViewById(R.id.test0), WoWoTypewriter.InsertFromLeft);
    addTextAnimation(findViewById(R.id.test1), WoWoTypewriter.DeleteThenType);
    addTextAnimation(findViewById(R.id.test2), WoWoTypewriter.InsertFromRight);

    wowo.setEase(ease);
    wowo.setUseSameEaseBack(useSameEaseTypeBack);
    wowo.ready();
}
private void addTextAnimation(View view, Typewriter typewriter) {
    wowo.addAnimation(view)
            .add(WoWoTextViewTextAnimation.builder().page(0)
                    .from("Nightonke").to("WoWoViewPager").typewriter(typewriter).build())
            .add(WoWoTextViewTextAnimation.builder().page(1)
                    .from("WoWoViewPager").to("").typewriter(typewriter).build())
            .add(WoWoTextViewTextAnimation.builder().page(2)
                    .from("").to("Nightonke").typewriter(typewriter).build())
            .add(WoWoTextViewTextAnimation.builder().page(3).start(0).end(0.5)
                    .from("Nightonke").to("Huang").typewriter(typewriter).build())
            .add(WoWoTextViewTextAnimation.builder().page(3).start(0.5).end(1)
                    .from("Huang").to("Weiping").typewriter(typewriter).build());
}

WoWoTextViewTextAnimation extends TextPageAnimation. In TextPageAnimation, you can define your own text-transformation-rule by providing an implementation of Typewriter. Check Typewriter Wiki for more details. As like other animations, WoWoTextViewTextAnimation extends PageAnimation too. Check more implementation details in its superclasses.

Methods List of WoWoTextViewTextAnimation.builder()

Clone this wiki locally