-
Notifications
You must be signed in to change notification settings - Fork 451
Typewriter
Weiping Huang edited this page Apr 6, 2017
·
2 revisions
Typewriter interface is used to change text from fromText
or toText
or in reverse by offset
(0<=offset<=1).
String type(String fromText, String toText, float offset);
In the builder of TextPageAnimation, you can define a custom typewriter to make a funny text transformation. For example:
wowo.addAnimation(view)
.add(WoWoTextViewTextAnimation.builder().page(0)
.from("Nightonke").to("WoWoViewPager").typewriter(new Typewriter() {
@Override
public String type(String fromText, String toText, float offset) {
if (0 < offset && offset < 1) return "Typing...";
else if (offset == 0) return fromText;
else return toText;
}
}).build());
Or just use the default typewriter implementations in WoWoTypewriter:
/**
* ABC->123:
* ABC->AB->A->{empty}->1->12->123
*/
WoWoTypewriter.DeleteThenType;
/**
* ABC->123:
* ABC->1AB->12A->123
*/
WoWoTypewriter.InsertFromLeft;
/**
* ABC->123:
* ABC->AB1->A12->123
*/
WoWoTypewriter.InsertFromRight;
Basic Animations
- Position Animation
- Position 3D Animation
- Translation Animation
- Translation 3D Animation
- Scale Animation
- Alpha Animation
- Rotation Animation
- Elevation Animation
TextView Animations
Color Animations
- Background Color Animation
- Shape Color Animation
- State-List Color Animation
- Layer-List Color Animation
Interface Expansibility