How to use efficiently Jazzy ViewPager

3.6k Views Asked by At

In my app I want swiping my screen horizontally.I use view pager And Fragment for that.But I want to use Jazzy ViewPager. Which is More Stylist And sexy.I used this link https://github.com/jfeinstein10/JazzyViewPager.But i want to inflate my layout xml here .How I will do it.plz help me

1

There are 1 best solutions below

1
On BEST ANSWER

The answer itself is given there, just import the library JazzyViewpager in your project by right clicking your project and add it as a reference library and then in your code write the following code:

In your PagerAdapter write:

private JazzyViewPager mJazzy;
@Override
public Object instantiateItem(ViewGroup container, final int position) {
Object obj = super.instantiateItem(container, position);
mJazzy.setObjectForPosition(obj, position);
return obj;
}

and select your animation by calling:

 private JazzyViewPager mJazzy;
 mJazzy.setTransitionEffect(TransitionEffect.*);

The JazzyViewPager's animations are encapsulated in TransitionEffect.

public enum TransitionEffect {
    Standard,
    Tablet,
    CubeIn,
    CubeOut,
    Flip,
    Stack,
    ZoomIn,
    ZoomOut,
    RotateUp,
    RotateDown,
    Accordion
}