Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Unified Diff: third_party/android_swipe_refresh/java/src/org/chromium/third_party/android/swiperefresh/SwipeRefreshLayout.java

Issue 1638303002: Detach SwipeRefreshLayout when it's animation ends (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/android_swipe_refresh/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+ }
}
« no previous file with comments | « third_party/android_swipe_refresh/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698