Code Monkey home page Code Monkey logo

viewpagercardtransformer's Introduction

ViewPagerCardTransformer

各种方向的ViewPager层叠卡片

->>相关介绍

来先看看效果

setp 1

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

step 2

	dependencies {
	        compile 'com.github.aohanyao:ViewPagerCardTransformer:v1.0'
	}

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

viewpagercardtransformer's People

Contributors

aohanyao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.