Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kHRYSTAL/CircleRecyclerView
the library is a loop RecyclerView(expression), can show some effects when display
https://github.com/kHRYSTAL/CircleRecyclerView
Last synced: about 1 month ago
JSON representation
the library is a loop RecyclerView(expression), can show some effects when display
- Host: GitHub
- URL: https://github.com/kHRYSTAL/CircleRecyclerView
- Owner: kHRYSTAL
- Created: 2016-09-14T15:34:53.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-06-08T12:02:12.000Z (over 1 year ago)
- Last Synced: 2024-08-02T01:17:10.663Z (4 months ago)
- Language: Java
- Homepage:
- Size: 1.72 MB
- Stars: 712
- Watchers: 17
- Forks: 100
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-android-ui - CircleRecyclerView - 一个循环RecyclerView (RecyclerView)
README
### CircleRecyclerView
the library is a loop RecyclerView, can show some effects when display
### screenshot
CircularViewMode
![CircularViewMode](https://github.com/kHRYSTAL/CircleRecyclerView/blob/master/screenshot/screenshot1.gif)
ScaleXViewMode & ScaleYViewMode
![ScaleXYViewMode](https://github.com/kHRYSTAL/CircleRecyclerView/blob/master/screenshot/screenshot2.gif)
RotateXScaleYViewMode & RotateYScaleXViewMode
![RotateXYScaleXYViewMode](https://github.com/kHRYSTAL/CircleRecyclerView/blob/master/screenshot/screenshot3.gif)
NoLoop but CenterForce (setClipPadding(l,t,r,b); setClipChildren(false);)
![](http://ww2.sinaimg.cn/large/72f96cbajw1f7yqcwf0cyg20cz0l9n54.gif)
CircularHorizontalMode
![CircularHorizontalMode](https://github.com/kHRYSTAL/CircleRecyclerView/blob/master/screenshot/screenshot4.gif)
### usage
```
mCircleRecyclerView = (CircleRecyclerView) view.findViewById(R.id.circle_rv);
mCircleRecyclerView.setLayoutManager(mLayoutManager);
mCircleRecyclerView.setViewMode(mItemViewMode); // T implements ItemViewMode, after setLayoutManager(manager)
mCircleRecyclerView.setNeedCenterForce(true); // when SCROLL_STATE_IDLE == state, nearly center itemview scroll to centermCircleRecyclerView.setNeedLoop(true); // default is true
// if setCenterForce(true), can set this callback
mCircleRecyclerView.setOnCenterItemClickListener(new CircleRecyclerView.OnCenterItemClickListener() {
@Override
public void onCenterItemClick(View v) {
Toast.makeText(getContext(), "Center Clicked", Toast.LENGTH_SHORT).show();
}
});```
and if loop is true, the RecyclerView.Adapter need like this:
```
@Override
public void onBindViewHolder(VH holder, int position) {
positionData = mDataList.get(position % mDataList.size());
}@Override
public int getItemCount() {
return Integer.MAX_VALUE;
}
```