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);
}
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);
}
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);
}
Aggregations