一个适用于 Android 的 RecyclerView 库,支持拖动刷新、自动加载更多内容和添加标题。
一个适用于 Android 的 RecyclerView 库,支持拖动刷新、自动加载更多内容和添加标题。
This is a project based on RecyclerView with pull-to-refresh feature.
It support addding Header, auto-loading more data when scrolling to bottom.
It can help you to implement ListView effect in RecyclerView, and not affect exsiting RecyclerView and Adapter logic.
Latest version:v1.3.1
How to make custom LoadMoreView, see 'DemoLoadMoreView.class' in demo project.
Project site: .
There has a Sample in project:Sample
##Using library in your application
Gradle dependency:
compile 'homhomlin.lib:ptrrv-library:1.3.1'
or
Maven dependency:
homhomlin.lib
ptrrv-library
1.3.1
If you want your application work on Android 2.x, you should add this in your gradle :
compile 'com.nineoldandroids:library:2.4.0'
##Usage
PullToRefreshRecyclerView is easy to use just like ListView and RecyclerView. It is derived from native SwipeRefreshLayout, so all property of SwipeRefreshLayout can be used here.
See Sample for detail.
First: Config in xml
Second: Find it in your Activity
PullToRefreshRecyclerView mPtrrv = (PullToRefreshRecyclerView) this.findViewById(R.id.ptrrv);
Third: Config it in java code
…
Finally: Set the adapter which extends RecyclerView.Adpater
PtrrvAdapter mAdapter = new PtrrvAdapter(this);
mPtrrv.setAdapter(mAdapter);
##License Copyright 2015 LinHongHong
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
暂无开放 Issues,或尚未同步最近议题。