sigran0 / FixedParallaxViewPagerTransformer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FixedParallaxTransformer

What is this?


FixParallaxTransformer Plugin is ViewPager.PageTransformer plugin to parallax moving. it is easy to use. and can make beautiful ViewPager in your app.

Alt Text

Install


Add this line in your app gradle.build

compile 'com.smtown.sigran0:FixedParallaxTransformer:0.1.4'

just end!

Useage


To make parallax, just add Resource ID of view that you want to parallax moving in your Fragment of ViewPager

Follow below code.

ParallaxItem backgroundItem = new ParallaxItem(R.id.fr_sample_rl_background);
ParallaxItem fixItem = new ParallaxItem(R.id.fr_sample_tv_title, ParallaxItem.SPEED.FIXED);
ParallaxItem fastMoveItem = new ParallaxItem(R.id.fr_sample_tv_right, ParallaxItem.SPEED.SLOWER);
ParallaxItem leftToRightMoveItem = new ParallaxItem(R.id.fr_sample_tv_left, ParallaxItem.SPEED.FASTEST, ParallaxItem.DIRECTION.REVERSE);

And create instance of ParallaxTransformer and add your ParallaxItem into this instance. The constructor of ParallaxTransformer can have following parameters

  • List
  • Single ParallaxItem
  • Multi ParallaxItem

Follow below code

ViewPager mPager;
...
ParallaxTransformer pt = new ParallaxTransformer(fixItem, backgroundItem, fastMoveItem, leftToRightMoveItem);
mPager.setPageTransformer(false, pt);

Todos


  • Make moving forward and backward equal position

License


MIT

Thanks to use this plugin

About

License:MIT License


Languages

Language:Java 100.0%