# ViewPagerLayoutManager **Repository Path**: xuyfcodecloud/ViewPagerLayoutManager ## Basic Information - **Project Name**: ViewPagerLayoutManager - **Description**: ViewPager like LayoutManager which supports some awesome animations and infinite scroll. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-05-11 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ViewPager-LayoutManager [![Download](https://api.bintray.com/packages/leochuan/maven/viewpager-layout-manager/images/download.svg) ](https://bintray.com/leochuan/maven/viewpager-layout-manager/_latestVersion) ![build](https://travis-ci.org/leochuan/ViewPagerLayoutManager.svg?branch=master) **English** | [中文](README_ZH.md) ![logo](static/logo.png) 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](static/circle.jpg) ![circle_scale](static/circle_scale.jpg) ![carousel](static/carousel.jpg) ![gallery](static/gallery.jpg) ![rotate](static/rotate.jpg) ![scale](static/scale.jpg) ## Customzie ![customize](static/customize.gif) 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](static/infinite.gif) ## Auto Center You can make the target view stop right at center every time you swipe or drag by: ```java // work exactly same as LinearSnapHelper. new CenterSnapHelper().attachToRecyclerView(recyclerView); ``` ## Set Max Visible Item Count ```java layoutmanager.setMaxVisibleItemCount(count); ``` ## Get Position Of Center Item ```java 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. ```java ScrollHelper.smoothScrollToTargetView(recyclerView, itemViewYouWantScrollTo); ``` ## Auto Play You can make it auto play by using `AutoPlayRecyclerView` ```xml ``` ## Download Gradle: ```groovy repositories { jcenter() } dependencies { compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager:2.x.y' } ``` Maven: ```xml rouchuan.viewpagerlayoutmanager viewpagerlayoutmanager 2.x.y pom ``` ## Quick Start Make sure that each item has the same size, or something unpredictable may happen. You can warm up your layoutmanager by `Builder`. ```java new CircleLayoutManager.Builder(context) .setAngleInterval(mAngle) .setMaxRemoveAngle(mMaxRemoveAngle) .setMinRemoveAngle(mMinRemoveAngle) .setMoveSpeed(mSpeed) .setRadius(mRadius) .setReverseLayout(true) .build(); ``` Or just simply call the construct. ```java new CircleLayoutManager(context); ``` ## License Apache-2.0. See [LICENSE](LICENSE) file for detail