Search in sources :

Example 46 with ViewAnimation

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

the class WoWoTranslationAnimationActivity 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_translation_animation);
    init();
    int screenW = WoWoUtil.getScreenWidth(this);
    int screenH = WoWoUtil.getScreenHeight(this);
    wowo = (WoWoViewPager) findViewById(R.id.wowo_viewpager);
    adapter = new WoWoViewPagerAdapter(getSupportFragmentManager());
    adapter.setFragmentsNumber(5);
    adapter.setColorsRes(new Integer[] { R.color.white, R.color.light_blue, R.color.white, R.color.light_blue, R.color.white });
    wowo.setAdapter(adapter);
    setPageTV(wowo);
    ViewAnimation animation = new ViewAnimation(findViewById(R.id.test));
    animation.addPageAnimaition(new WoWoTranslationAnimation(0, 0f, 1f, findViewById(R.id.test).getTranslationX(), findViewById(R.id.test).getTranslationY(), -screenW / 2 + WoWoUtil.dp2px(40, this), -screenH / 2 + WoWoUtil.dp2px(40, this), easeType, useSameEaseTypeBack));
    animation.addPageAnimaition(new WoWoTranslationAnimation(1, 0f, 1f, -screenW / 2 + WoWoUtil.dp2px(40, this), -screenH / 2 + WoWoUtil.dp2px(40, this), screenW - WoWoUtil.dp2px(80, this), screenH - WoWoUtil.dp2px(80, this), easeType, useSameEaseTypeBack));
    animation.addPageAnimaition(new WoWoTranslationAnimation(2, 0f, 0.5f, screenW / 2 - WoWoUtil.dp2px(40, this), screenH / 2 - WoWoUtil.dp2px(40, this), 0, -screenH / 2 + WoWoUtil.dp2px(40, this), easeType, useSameEaseTypeBack));
    animation.addPageAnimaition(new WoWoTranslationAnimation(2, 0.5f, 1f, screenW / 2 - WoWoUtil.dp2px(40, this), 0, -screenW + WoWoUtil.dp2px(80, this), 0, easeType, useSameEaseTypeBack));
    animation.addPageAnimaition(new WoWoTranslationAnimation(3, 0f, 0.5f, -screenW / 2 + WoWoUtil.dp2px(40, this), 0, screenW / 2 - WoWoUtil.dp2px(40, this), -screenH / 2 + WoWoUtil.dp2px(40, this), easeType, useSameEaseTypeBack));
    animation.addPageAnimaition(new WoWoTranslationAnimation(3, 0.5f, 1f, 0, -screenH / 2 + WoWoUtil.dp2px(40, this), 0, screenH / 2 - WoWoUtil.dp2px(40, this), easeType, useSameEaseTypeBack));
    wowo.addAnimation(animation);
}
Also used : ViewAnimation(com.nightonke.wowoviewpager.ViewAnimation) WoWoViewPagerAdapter(com.nightonke.wowoviewpager.WoWoViewPagerAdapter) WoWoTranslationAnimation(com.nightonke.wowoviewpager.WoWoTranslationAnimation)

Aggregations

ViewAnimation (com.nightonke.wowoviewpager.ViewAnimation)46 WoWoTranslationAnimation (com.nightonke.wowoviewpager.WoWoTranslationAnimation)33 ViewGroup (android.view.ViewGroup)7 WoWoRotationAnimation (com.nightonke.wowoviewpager.WoWoRotationAnimation)6 ImageView (android.widget.ImageView)4 WoWoScaleAnimation (com.nightonke.wowoviewpager.WoWoScaleAnimation)4 WoWoViewPagerAdapter (com.nightonke.wowoviewpager.WoWoViewPagerAdapter)4 Path (android.graphics.Path)3 WoWoPathAnimation (com.nightonke.wowoviewpager.WoWoPathAnimation)3 WoWoPathView (com.nightonke.wowoviewpager.WoWoPathView)3 WoWoShapeColorAnimation (com.nightonke.wowoviewpager.WoWoShapeColorAnimation)3 WoWoAlphaAnimation (com.nightonke.wowoviewpager.WoWoAlphaAnimation)2 WoWoBackgroundColorAnimation (com.nightonke.wowoviewpager.WoWoBackgroundColorAnimation)2 WoWoTextViewSizeAnimation (com.nightonke.wowoviewpager.WoWoTextViewSizeAnimation)2 WoWoLayerListColorAnimation (com.nightonke.wowoviewpager.WoWoLayerListColorAnimation)1 WoWoStateListColorAnimation (com.nightonke.wowoviewpager.WoWoStateListColorAnimation)1 WoWoTextViewColorAnimation (com.nightonke.wowoviewpager.WoWoTextViewColorAnimation)1