-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
# MarqueeRecyclerView | ||
自动无限滚动跑马灯、支持横竖屏滚动、支持开关控制、一键接入,无需更多操作 | ||
|
||
### demo示例 | ||
![](https://github.com/zhuozp/MarqueeRecyclerView/blob/master/images/device-2020-03-18-192611.gif) | ||
|
||
### 接入步骤 | ||
|
||
1. 在根目录root的build.gradle添加 | ||
``` | ||
allprojects { | ||
repositories { | ||
google() | ||
jcenter() | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
``` | ||
|
||
2. 在相关模块添加依赖 | ||
``` | ||
implementation 'com.github.zhuozp:MarqueeRecyclerView:v1.0.0' | ||
``` | ||
|
||
3. 调用,可以使用自定义的MarqueeRecyclerView,也可以直接使用默认的recyclerview,默认的话不会自动滚动,但手动滑动的时候仍然支持循环展示,LooperLayoutManager的实现支持了循环滚动功能 | ||
``` | ||
recyclerView = findViewById(R.id.recyclerview); | ||
recyclerView.setAutoRun(true); | ||
recyclerView.setAdapter(new SimpleAdapter()); | ||
LooperLayoutManager layoutManager = new LooperLayoutManager(); | ||
layoutManager.setLooperEnable(true); | ||
recyclerView.setLayoutManager(layoutManager); | ||
recyclerView.start(); | ||
``` |