/ViewPagerTransformerLibrary

A library that contains animations for the viewpager in android

Primary LanguageJava

ViewPagerTransformerLibrary

A library that contains animations for the viewpager in android.


Release

Transformers Available

1. Default Transformer

Options : viewPager.setPageTransformer(true, new DefaultTransformer());

2. CubeOut Transformer

Options :

  • Not specifying Cube Angle: viewPager.setPageTransformer(true, new CubeOutTransformer());

  • Specifying Cube Angle: viewPager.setPageTransformer(true, new CubeOutTransformer(CubeOutTransformer.CUBE_ANGLE_60));

Angle options available are CUBE_ANGLE_45 (45°), CUBE_ANGLE_60 (60°) & CUBE_ANGLE_90 (90°).

3. Scale Transformer

Options : viewPager.setPageTransformer(true, new ScaleTransformer());

4. TranslateY Transformer

Options :

  • Not specifying movement direction: viewPager.setPageTransformer(true, new TranslationYTransformer());

  • Specifying movement direction: viewPager.setPageTransformer(true, new TranslationYTransformer(TOP_TO_BOTTOM));

Movement options available are TOP_TO_BOTTOM & BOTTOM_TO_TOP.

5. DepthPage Transformer

Options : viewPager.setPageTransformer(true, new DepthPageTransformer());

6. Drawer Transformer

Options : viewPager.setPageTransformer(true, new DrawerTransformer());

7. Windmill Transformer

Options :

  • Not specifying rotation pivot: viewPager.setPageTransformer(true, new WindmillTransformer());

  • Specifying pivot point: viewPager.setPageTransformer(true, new WindmillTransformer(WindmillTransformer.TOP_LEFT_CORNER));

Pivot options available are TOP_LEFT_CORNER & BOTTOM_RIGHT_CORNER.

8. ZoomOut Transformer

Options :

  • Default, i.e Fade Enabled : viewPager.setPageTransformer(true, new ZoomOutTransformer());
  • Disabling Fade option : viewPager.setPageTransformer(true, new ZoomOutTransformer(false));

9. RaiseFromCenter Transformer

Options : viewPager.setPageTransformer(true, new RaiseFromCenterTransformer());

10. RotateAboutTop Transformer

Options : viewPager.setPageTransformer(true, new RotateAboutTopTransformer());

11. RotateAboutBottom Transformer

Options : viewPager.setPageTransformer(true, new RotateAboutBottomTransformer());

12. Accordion Transformer

Options : viewPager.setPageTransformer(true,new AccordionTransformer());

13. Random Transformer

Select a Random Transformer from the available ones.

Options :viewPager.setPageTransformer(true, new RandomTransformer());


Add to your project

  • Add the jitpack maven repository
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  • Add the dependency
dependencies {
          compile 'com.github.kungfucat:ViewPagerTransformerLibrary:v1.2.0'
}

Usage

        ViewPager viewPager = findViewById(R.id.viewPager);
        ViewPagerAdapter pagerAdapter = new YourViewPagerAdapter(getSupportFragmentManager());
        viewPager.setAdapter(pagerAdapter);
        viewPager.setPageTransformer(true, new CubeOutTransformer());

Contributing

To get started...

Step 1

  • 🍴 Fork this repo!

Step 2

  • 👯 Clone this repo to your local machine.

Step 3

  • HACK AWAY! 🔨🔨🔨

Step 4


Developed By

Harsh Bhardwaj (kungfucat)