Skip to content

Commit 5567322

Browse files
author
Angel M de Miguel
committed
Added an alias of onRefreshComplete called stopRefreshing. This is because when an user wants to stop the refreshing programacally, he can not understand which is the method to do this action
1 parent 7b23312 commit 5567322

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

library/src/main/java/com/handmark/pulltorefresh/library/IPullToRefresh.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ public interface IPullToRefresh<T extends View> {
140140
*/
141141
public boolean isRefreshing();
142142

143+
/**
144+
* Stops the current refreshing view when the user needs to stop.
145+
* This method is only an alias to onRefreshComplete.
146+
*
147+
* */
148+
public void stopRefreshing();
149+
143150
/**
144151
* Returns whether the widget has enabled scrolling on the Refreshable View
145152
* while refreshing.

library/src/main/java/com/handmark/pulltorefresh/library/PullToRefreshBase.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ public final boolean isRefreshing() {
306306
return mState == State.REFRESHING || mState == State.MANUAL_REFRESHING;
307307
}
308308

309+
@Override
310+
public final void stopRefreshing() {
311+
onRefreshComplete();
312+
}
313+
309314
@Override
310315
public final boolean isScrollingWhileRefreshingEnabled() {
311316
return mScrollingWhileRefreshingEnabled;

0 commit comments

Comments
 (0)