PagerLayout
A PagerGridLayoutManager combine PageView and GridLayoutManager.
- replace "viewPager>recyclerView" with just only a "RecyclerView"
- reduce memory using by cache all items
- grid layout support
- custom indicator drawable support
- add lock, dot and corner for each item
Quick View
Install
Please using latest version:
- pagerlayout:
- lockitem:
How To Use
- add
PagerLayoutManager
asrecyclerView
'slayoutManager
- set a
adapter
torecyclerView
as usual
- set
PagerSnapHelper
to scroll like aPageView
That's all!
We will layout all children automatically using pager grid.
- if you want a indicator , we supply 4 kind indicators as implements of
PageIndicator
. Dot, Line, Square, Drawable.
just need aattachToRecyclerView
.
- if you need your item in
RecyclerView
with lock or dot, you can implementationlockitem
,and control the value with xml define in Demo or java/kotlin code Demo
What's More
PagerLayout
Custom Grid
just like
GridLayoutManager
you can set the grid weights of each item
The default spanCount
is 12
, you can using this to layout children by all (1,2,3,4,6,12). Also you can custom this spanCount
.
Here is a simple example with kotlin code:
Cache Item By Type
Control to cache item just like RecyclerView
for each type of item.
Indicator
You can set width
, height
, normalColor
, selectColor
, padding
, round
to indicator
.
Also you can set a Bitmap
as indicator
For detail config, here is a Demo for you.
Lock && Dot
Each item can be covered with lock and dot, and the number in dot, here is a Demo
Also, you can control this with xml: