Search in sources :

Example 31 with WoWoTranslationAnimation

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

the class CVExampleActivity method setLogo.

private void setLogo() {
    ViewAnimation animation = new ViewAnimation(findViewById(R.id.cv_logo));
    animation.addPageAnimaition(new WoWoTranslationAnimation(0, 0, 1, findViewById(R.id.cv_logo).getTranslationX(), findViewById(R.id.cv_logo).getTranslationY(), -screenW / 2 + 150, -screenH / 2 + 200, EaseType.EaseOutBack, false));
    animation.addPageAnimaition(new WoWoScaleAnimation(0, 0, 1, 0.5f, 0.5f, EaseType.EaseOutBack, false));
    wowo.addAnimation(animation);
}
Also used : ViewAnimation(com.nightonke.wowoviewpager.ViewAnimation) WoWoScaleAnimation(com.nightonke.wowoviewpager.WoWoScaleAnimation) WoWoTranslationAnimation(com.nightonke.wowoviewpager.WoWoTranslationAnimation)

Example 32 with WoWoTranslationAnimation

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

the class CVExampleActivity method setName.

private void setName() {
    ViewAnimation animation = new ViewAnimation(findViewById(R.id.name));
    animation.addPageAnimaition(new WoWoTranslationAnimation(0, 0, 1, findViewById(R.id.name).getTranslationX(), findViewById(R.id.name).getTranslationY(), -screenW / 2 + 150 + WoWoUtil.dp2px(105, this) + 20, -screenH / 2 + 200 - WoWoUtil.dp2px(70, this), EaseType.EaseOutBack, false));
    animation.addPageAnimaition(new WoWoTextViewSizeAnimation(0, 0, 1, 30f, 22f, EaseType.Linear, false));
    wowo.addAnimation(animation);
}
Also used : ViewAnimation(com.nightonke.wowoviewpager.ViewAnimation) WoWoTextViewSizeAnimation(com.nightonke.wowoviewpager.WoWoTextViewSizeAnimation) WoWoTranslationAnimation(com.nightonke.wowoviewpager.WoWoTranslationAnimation)

Example 33 with WoWoTranslationAnimation

use of com.nightonke.wowoviewpager.WoWoTranslationAnimation 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)33 WoWoTranslationAnimation (com.nightonke.wowoviewpager.WoWoTranslationAnimation)33 ViewGroup (android.view.ViewGroup)5 WoWoRotationAnimation (com.nightonke.wowoviewpager.WoWoRotationAnimation)5 ImageView (android.widget.ImageView)4 WoWoScaleAnimation (com.nightonke.wowoviewpager.WoWoScaleAnimation)2 Path (android.graphics.Path)1 WoWoAlphaAnimation (com.nightonke.wowoviewpager.WoWoAlphaAnimation)1 WoWoPathAnimation (com.nightonke.wowoviewpager.WoWoPathAnimation)1 WoWoPathView (com.nightonke.wowoviewpager.WoWoPathView)1 WoWoShapeColorAnimation (com.nightonke.wowoviewpager.WoWoShapeColorAnimation)1 WoWoTextViewSizeAnimation (com.nightonke.wowoviewpager.WoWoTextViewSizeAnimation)1 WoWoViewPagerAdapter (com.nightonke.wowoviewpager.WoWoViewPagerAdapter)1