GithubHelp home page GithubHelp logo

git45016683 / gravitysnaprecycleview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whosea/gravitysnaprecycleview

0.0 1.0 0.0 11.52 MB

Android Recycleview 翻页效果(类似ViewPager)

Java 100.00%

gravitysnaprecycleview's Introduction

GravitySnapRecycleView

Android Recycleview 翻页效果(类似ViewPager)

原文链接:https://www.zybuluo.com/whosea/note/1006457

添加依赖

compile 'com.github.whosea:GravitySnapRecycleView:1.0.0'

效果

项目应用效果:

demo效果:

用法

创建处理翻页效果类(另外总共支持start end top bottom 和 center 五种行为):

GravitySnapHelper snapHelper = new GravitySnapHelper(Gravity.CENTER);
snapHelper.setColumn(3);//如果一页里面有超过1列的都需要设置
snapHelper.attachToRecyclerView(recyclerview);
snapHelper.setCanPageScroll(true);//是否启用一页一页的滚动,默认不启用

翻页监听

PageIndicatorHelper pageIndicatorHelper = new PageIndicatorHelper();
pageIndicatorHelper.setPageColumn(column);
pageIndicatorHelper.setRecyclerView(rvCenter);
pageIndicatorHelper.setOnPageChangeListener(new GravityPageChangeListener() {
    @Override
    public void onPageSelected(int position,int currentPage,int totalPage) {
		Log.e("MainActivity",currentPage+ "/"+totalPage);
    }

    @Override
    public void onPageScrollStateChanged(int state) {

    }
});

gravitysnaprecycleview's People

Watchers

James Cloos 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.