Index: third_party/android_swipe_refresh/java/src/org/chromium/third_party/android/swiperefresh/SwipeRefreshLayout.java |
diff --git a/third_party/android_swipe_refresh/java/src/org/chromium/third_party/android/swiperefresh/SwipeRefreshLayout.java b/third_party/android_swipe_refresh/java/src/org/chromium/third_party/android/swiperefresh/SwipeRefreshLayout.java |
index b5b68915fa088448c413496834817034d5bb6ee5..abca452bd4c29df77f752c3612fe1981992cad77 100644 |
--- a/third_party/android_swipe_refresh/java/src/org/chromium/third_party/android/swiperefresh/SwipeRefreshLayout.java |
+++ b/third_party/android_swipe_refresh/java/src/org/chromium/third_party/android/swiperefresh/SwipeRefreshLayout.java |
@@ -88,6 +88,7 @@ public class SwipeRefreshLayout extends ViewGroup { |
private static final int DEFAULT_CIRCLE_TARGET = 64; |
private OnRefreshListener mListener; |
+ private OnResetListener mResetListener; |
private boolean mRefreshing = false; |
private float mTotalDragDistance = -1; |
private int mMediumAnimationDuration; |
@@ -315,6 +316,13 @@ public class SwipeRefreshLayout extends ViewGroup { |
} |
/** |
+ * Set the reset listener to be notified when a reset is triggered. |
+ */ |
+ public void setOnResetListener(OnResetListener listener) { |
+ mResetListener = listener; |
+ } |
+ |
+ /** |
* Pre API 11, alpha is used to make the progress circle appear instead of scale. |
*/ |
private boolean isAlphaUsedForScale() { |
@@ -692,6 +700,9 @@ public class SwipeRefreshLayout extends ViewGroup { |
true /* requires update */); |
} |
mCurrentTargetOffsetTop = mCircleView.getTop(); |
+ if (mResetListener != null) { |
+ mResetListener.onReset(); |
+ } |
} |
private void animateOffsetToCorrectPosition(int from, AnimationListener listener) { |
@@ -796,4 +807,12 @@ public class SwipeRefreshLayout extends ViewGroup { |
public interface OnRefreshListener { |
public void onRefresh(); |
} |
+ |
+ /** |
+ * Classes that wish to be notified when a reset is triggered should |
+ * implement this interface. |
+ */ |
+ public interface OnResetListener { |
+ public void onReset(); |
+ } |
} |