Search in sources :

Example 1 with WoWoAlphaAnimation

use of com.nightonke.wowoviewpager.WoWoAlphaAnimation in project WoWoViewPager by Nightonke.

the class AppIntroExampleActivity method setPath.

private void setPath() {
    WoWoPathView pathView = (WoWoPathView) findViewById(R.id.pathview);
    ViewGroup.LayoutParams layoutParams = pathView.getLayoutParams();
    layoutParams.height = screenH;
    layoutParams.width = screenW + 200;
    pathView.setLayoutParams(layoutParams);
    int xoff = -300;
    int yoff = screenH - 616 - 300;
    float xScale = 1.5f;
    float yScale = 1;
    Path path = new Path();
    path.moveTo(xScale * (565 + xoff), screenH + yoff);
    path.cubicTo(xScale * (509 + xoff), yScale * (385 + yoff), xScale * (144 + xoff), yScale * (272 + yoff), xScale * (394 + xoff), yScale * (144 + yoff));
    path.cubicTo(xScale * (477 + xoff), yScale * (99 + yoff), xScale * (596 + xoff), yScale * (91 + yoff), xScale * (697 + xoff), yScale * (128 + yoff));
    path.cubicTo(xScale * (850 + xoff), yScale * (189 + yoff), xScale * (803 + xoff), yScale * (324 + yoff), xScale * (66 + xoff), yScale * (307 + yoff));
    pathView.setPath(path);
    ViewAnimation animation = new ViewAnimation(pathView);
    animation.addPageAnimaition(new WoWoPathAnimation(1, 0f, 1f, EaseType.Linear, true));
    animation.addPageAnimaition(new WoWoAlphaAnimation(2, 0, 1, 1, 0, EaseType.Linear, true));
    animation.addPageAnimaition(new WoWoTranslationAnimation(2, 0, 1, 0, 0, -screenW, 0, EaseType.Linear, true));
    wowo.addAnimation(animation);
}
Also used : Path(android.graphics.Path) WoWoPathView(com.nightonke.wowoviewpager.WoWoPathView) ViewAnimation(com.nightonke.wowoviewpager.ViewAnimation) WoWoPathAnimation(com.nightonke.wowoviewpager.WoWoPathAnimation) ViewGroup(android.view.ViewGroup) WoWoTranslationAnimation(com.nightonke.wowoviewpager.WoWoTranslationAnimation) WoWoAlphaAnimation(com.nightonke.wowoviewpager.WoWoAlphaAnimation)

Example 2 with WoWoAlphaAnimation

use of com.nightonke.wowoviewpager.WoWoAlphaAnimation in project WoWoViewPager by Nightonke.

the class WoWoAlphaAnimationActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_wowo_alpha_animation);
    init();
    wowo = (WoWoViewPager) findViewById(R.id.wowo_viewpager);
    adapter = new WoWoViewPagerAdapter(getSupportFragmentManager());
    adapter.setFragmentsNumber(5);
    adapter.setColorRes(R.color.white);
    wowo.setAdapter(adapter);
    setPageTV(wowo);
    ViewAnimation animation = new ViewAnimation(findViewById(R.id.test));
    animation.addPageAnimaition(new WoWoAlphaAnimation(0, 0f, 1f, 1, 0.5f, easeType, useSameEaseTypeBack));
    animation.addPageAnimaition(new WoWoAlphaAnimation(1, 0f, 1f, 0.5f, 1f, easeType, useSameEaseTypeBack));
    animation.addPageAnimaition(new WoWoAlphaAnimation(2, 0f, 0.5f, 1, 0f, easeType, useSameEaseTypeBack));
    animation.addPageAnimaition(new WoWoAlphaAnimation(2, 0.5f, 1f, 0, 1f, easeType, useSameEaseTypeBack));
    animation.addPageAnimaition(new WoWoAlphaAnimation(3, 0f, 0.5f, 1, 0.3f, easeType, useSameEaseTypeBack));
    animation.addPageAnimaition(new WoWoAlphaAnimation(3, 0.5f, 1f, 0.3f, 1f, easeType, useSameEaseTypeBack));
    wowo.addAnimation(animation);
}
Also used : ViewAnimation(com.nightonke.wowoviewpager.ViewAnimation) WoWoViewPagerAdapter(com.nightonke.wowoviewpager.WoWoViewPagerAdapter) WoWoAlphaAnimation(com.nightonke.wowoviewpager.WoWoAlphaAnimation)

Aggregations

ViewAnimation (com.nightonke.wowoviewpager.ViewAnimation)2 WoWoAlphaAnimation (com.nightonke.wowoviewpager.WoWoAlphaAnimation)2 Path (android.graphics.Path)1 ViewGroup (android.view.ViewGroup)1 WoWoPathAnimation (com.nightonke.wowoviewpager.WoWoPathAnimation)1 WoWoPathView (com.nightonke.wowoviewpager.WoWoPathView)1 WoWoTranslationAnimation (com.nightonke.wowoviewpager.WoWoTranslationAnimation)1 WoWoViewPagerAdapter (com.nightonke.wowoviewpager.WoWoViewPagerAdapter)1