ViewPagerCardTransformer

Introduction: 各种方向的 ViewPager 层叠卡片
More: Author   ReportBugs   
Tags:

各种方向的 ViewPager 层叠卡片

->>相关介绍

来先看看效果

最新版本

setp 1

    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }

step 2

    dependencies {
            compile 'com.github.aohanyao:ViewPagerCardTransformer:1.2'
    }

step 3

     vpMain.setPageTransformer(true, CardPageTransformer.getBuild()//建造者模式
                .addAnimationType(PageTransformerConfig.ROTATION)//默认动画 default animation rotation  旋转  当然 也可以一次性添加两个  后续会增加更多动画
                .setRotation(-45)//旋转角度
                .addAnimationType(PageTransformerConfig.ALPHA)//默认动画 透明度 暂时还有问题
                .setViewType(mViewType)//view 的类型
                .setOnPageTransformerListener(new OnPageTransformerListener() {
                    @Override
                    public void onPageTransformerListener(View page, float position) {
                        //你也可以在这里对 page 实行自定义动画 cust anim
                    }
                })
                .setTranslationOffset(40)
                .setScaleOffset(80)
                .create());

mViewType

    /**
     * 底部
     */
    public static final int BOTTOM = 1;
    /**
     * 底部 左边
     */
    public static final int BOTTOM_LEFT = 11;
    /**
     * 底部右边
     */
    public static final int BOTTOM_RIGHT = 12;
    /**
     * 上面
     */
    public static final int TOP = 2;
    /**
     * 上左
     */
    public static final int TOP_LEFT = 21;
    /**
     * 上右
     */
    public static final int TOP_RIGHT = 22;
    /**
     * 左边
     */
    public static final int LEFT = 3;
    /**
     * 右边
     */
    public static final int RIGHT = 4;

about

如果我的代码对你有帮助,请给我一个 star

Apps
About Me
GitHub: Trinea
Facebook: Dev Tools