Skip to content

Alpha Animation

Weiping Huang edited this page Apr 5, 2017 · 3 revisions

WoWoAlphaAnimation is used to change the opacity of the view to a value from 0 to 1, where 0 means the view is completely transparent and 1 means the view is completely opaque. This can be useful to perform a disappearing animation. Check the example activity for more details.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ViewAnimation viewAnimation = new ViewAnimation(findViewById(R.id.test));
    viewAnimation.add(WoWoAlphaAnimation.builder().page(0).from(1).to(0.5).build());
    viewAnimation.add(WoWoAlphaAnimation.builder().page(1).from(0.5).to(1).build());
    viewAnimation.add(WoWoAlphaAnimation.builder().page(2).start(0).end(0.5).from(1).to(0).build());
    viewAnimation.add(WoWoAlphaAnimation.builder().page(2).start(0.5).end(1).from(0).to(1).build());
    viewAnimation.add(WoWoAlphaAnimation.builder().page(3).start(0).end(0.5).from(1).to(0.3).build());
    viewAnimation.add(WoWoAlphaAnimation.builder().page(3).start(0.5).end(1).from(0.3).to(1).build());
    wowo.addAnimation(viewAnimation);
    wowo.setEase(ease);
    wowo.setUseSameEaseBack(useSameEaseTypeBack);
    wowo.ready();
}

WoWoAlphaAnimation extends PageAnimation. Check more implementation details in its superclass.

Methods List of WoWoAlphaAnimation.builder()