Giter Site home page Giter Site logo

xwcsmile / viewpagerlayoutmanager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leochuan/viewpagerlayoutmanager

0.0 1.0 0.0 45.55 MB

ViewPager like LayoutManager which supports some awesome animations and infinite scroll.

License: Apache License 2.0

Java 100.00%

viewpagerlayoutmanager's Introduction

ViewPager-LayoutManager Download build

English | δΈ­ζ–‡

logo

VPLM is a ViewPager like LayoutManager which implements some common animations. If you need some other effects feel free to raise an issue or PR.

circle circle_scale carousel gallery rotate scale

Customzie

customize

Each layoutmanager has bunch of different properties to customize.

Such as:

  • radius
  • scroll speed
  • space
  • orientation

Run the demo to see more details.

Infinite Scroll

infinite

Auto Center

You can make the target view stop right at center every time you swipe or drag by:

// work exactly same as LinearSnapHelper.
new CenterSnapHelper().attachToRecyclerView(recyclerView);

Set Max Visible Item Count

layoutmanager.setMaxVisibleItemCount(count);

Get Position Of Center Item

layoutmanager.getCurrentPosition()

Smooth Scroll To Position

Normally you can just use RecyclerView's SmoothScrollToPosition method, but when infinite scroll enabled, using method below to avoid some unexpected errors.

ScrollHelper.smoothScrollToTargetView(recyclerView, itemViewYouWantScrollTo);

Auto Play

You can make it auto play by using AutoPlayRecyclerView

<com.leochuan.AutoPlayRecyclerView
    android:id="@+id/recycler"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:direction="right"
    app:timeInterval="1500"/>

Download

Gradle:

repositories {
  jcenter()
}

dependencies {
  compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager:2.x.y'
}

Maven:

<dependency>
  <groupId>rouchuan.viewpagerlayoutmanager</groupId>
  <artifactId>viewpagerlayoutmanager</artifactId>
  <version>2.x.y</version>
  <type>pom</type>
</dependency>

Quick Start

Make sure that each item has the same size, or something unpredictable may happen.

You can warm up your layoutmanager by Builder.

new CircleLayoutManager.Builder(context)
                .setAngleInterval(mAngle)
                .setMaxRemoveAngle(mMaxRemoveAngle)
                .setMinRemoveAngle(mMinRemoveAngle)
                .setMoveSpeed(mSpeed)
                .setRadius(mRadius)
                .setReverseLayout(true)
                .build();

Or just simply call the construct.

new CircleLayoutManager(context);

License

Apache-2.0. See LICENSE file for detail

viewpagerlayoutmanager's People

Contributors

leochuan avatar qinxiandiqi avatar

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.