Search in sources :

Example 11 with WoWoViewPagerAdapter

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

the class WoWoStateListColorAnimationActivity 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_state_list_color_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);
    setAnimation(findViewById(R.id.test1), ColorChangeType.RGB);
    setAnimation(findViewById(R.id.test2), ColorChangeType.HSV);
}
Also used : WoWoViewPagerAdapter(com.nightonke.wowoviewpager.WoWoViewPagerAdapter)

Example 12 with WoWoViewPagerAdapter

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

the class WoWoTextViewTextSizeAnimationActivity 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_textview_textsize_animation);
    init();
    wowo = (WoWoViewPager) findViewById(R.id.wowo_viewpager);
    adapter = new WoWoViewPagerAdapter(getSupportFragmentManager());
    adapter.setFragmentsNumber(3);
    adapter.setColorRes(R.color.white);
    wowo.setAdapter(adapter);
    setPageTV(wowo);
    ViewAnimation animation = new ViewAnimation(findViewById(R.id.test));
    animation.addPageAnimaition(new WoWoTextViewSizeAnimation(0, 0f, 1f, 50, 20, easeType, useSameEaseTypeBack));
    animation.addPageAnimaition(new WoWoTextViewSizeAnimation(1, 0f, 1f, 20, 60, easeType, useSameEaseTypeBack));
    wowo.addAnimation(animation);
}
Also used : ViewAnimation(com.nightonke.wowoviewpager.ViewAnimation) WoWoViewPagerAdapter(com.nightonke.wowoviewpager.WoWoViewPagerAdapter) WoWoTextViewSizeAnimation(com.nightonke.wowoviewpager.WoWoTextViewSizeAnimation)

Example 13 with WoWoViewPagerAdapter

use of com.nightonke.wowoviewpager.WoWoViewPagerAdapter 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

WoWoViewPagerAdapter (com.nightonke.wowoviewpager.WoWoViewPagerAdapter)13 ViewAnimation (com.nightonke.wowoviewpager.ViewAnimation)4 WoWoAlphaAnimation (com.nightonke.wowoviewpager.WoWoAlphaAnimation)1 WoWoScaleAnimation (com.nightonke.wowoviewpager.WoWoScaleAnimation)1 WoWoTextViewSizeAnimation (com.nightonke.wowoviewpager.WoWoTextViewSizeAnimation)1 WoWoTranslationAnimation (com.nightonke.wowoviewpager.WoWoTranslationAnimation)1