/ViewPagerLayoutManager

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

Primary LanguageJavaApache License 2.0Apache-2.0

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

auto_center

You can make the current position move to center automaticlly by:

recyclerView.addOnScrollListener(new CenterScrollListener());

Download

Gradle:

repositories {
  jcenter()
}

dependencies {
  compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager:2.0.1'
}

Maven:

<dependency>
  <groupId>rouchuan.viewpagerlayoutmanager</groupId>
  <artifactId>viewpagerlayoutmanager</artifactId>
  <version>2.0.1</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