Skip to content

Commit 9708172

Browse files
committed
update readme
1 parent 3fff1ca commit 9708172

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,19 @@ It can help you to implement ListView effect in RecyclerView, and not affect exs
1010
![Screenshot](https://github.com/HomHomLin/Android-PullToRefreshRecyclerView/blob/master/screenshot.gif)
1111

1212

13-
**Latest version:v1.0.1**
13+
**Latest version:v1.1.0**
14+
15+
## Update Log
16+
**1.1.0 What's New**
17+
Two new methods:
18+
19+
1: void removeHeader();
20+
To remove the header of PTRRV.
21+
22+
2: void setLoadMoreFooter(BaseLoadMoreView loadMoreFooter);
23+
To add a custom LoadMoreView.
24+
Now you can define a LoadMoreView by inheriting BaseLoadMoreView and using onDrawLoadMore(Canvas c, RecyclerView parent), and replace the default LoadMoreView by using setLoadMoreFooter(BaseLoadMoreView loadMoreFooter).
25+
How to make custom LoadMoreView, see 'DemoLoadMoreView.class' in demo project.
1426

1527
## Feature
1628
* Encapsulation based on native RecyclerView
@@ -32,7 +44,7 @@ There has a Sample in project:[Sample](https://github.com/HomHomLin/Android-Pull
3244

3345
**Gradle dependency:**
3446
``` groovy
35-
compile 'homhomlin.lib:ptrrv-library:1.0.1'
47+
compile 'homhomlin.lib:ptrrv-library:1.1.0'
3648
```
3749

3850
or
@@ -42,13 +54,14 @@ or
4254
<dependency>
4355
<groupId>homhomlin.lib</groupId>
4456
<artifactId>ptrrv-library</artifactId>
45-
<version>1.0.1</version>
57+
<version>1.1.0</version>
4658
</dependency>
4759
```
4860

4961
##Usage
5062

5163
PullToRefreshRecyclerView is easy to use just like ListView and RecyclerView.
64+
It is derived from native SwipeRefreshLayout, so all property of SwipeRefreshLayout can be used here.
5265

5366
See Sample for detail.
5467

@@ -74,6 +87,16 @@ PullToRefreshRecyclerView mPtrrv = (PullToRefreshRecyclerView) this.findViewById
7487

7588
**Third: Config it in java code**
7689
``` java
90+
// custom own load-more-view and add it into ptrrv
91+
DemoLoadMoreView loadMoreView = new DemoLoadMoreView(this, mPtrrv.getRecyclerView());
92+
loadMoreView.setLoadmoreString(getString(R.string.demo_loadmore));
93+
loadMoreView.setLoadMorePadding(100);
94+
95+
mPtrrv.setLoadMoreFooter(loadMoreView);
96+
97+
//remove header
98+
mPtrrv.removeHeader();
99+
77100
// set true to open swipe(pull to refresh, default is true)
78101
mPtrrv.setSwipeEnable(true);
79102

app/src/main/java/com/linhh/ptrrv/android_pulltorefreshrecyclerview/PtrrvListViewMode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void onRefresh() {
5959
mPtrrv.getRecyclerView().addItemDecoration(new DividerItemDecoration(this,
6060
DividerItemDecoration.VERTICAL_LIST));
6161
mPtrrv.addHeaderView(View.inflate(this, R.layout.header, null));
62-
mPtrrv.removeHeader();
62+
// mPtrrv.removeHeader();
6363
mPtrrv.setLoadMoreFooter(loadMoreView);
6464
mAdapter = new PtrrvAdapter(this);
6565
mAdapter.setCount(DEFAULT_ITEM_SIZE);

0 commit comments

Comments
 (0)