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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/OverscrollRefreshHandler.java

Issue 894193005: [Android] Use the platform SwipeRefreshLayout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 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
Index: content/public/android/java/src/org/chromium/content/browser/OverscrollRefreshHandler.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/OverscrollRefreshHandler.java b/content/public/android/java/src/org/chromium/content/browser/OverscrollRefreshHandler.java
new file mode 100644
index 0000000000000000000000000000000000000000..8717b8384fe5ee05835cea8ff01d438a89c7dc8c
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/OverscrollRefreshHandler.java
@@ -0,0 +1,40 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser;
+
+/**
+ * Simple interface allowing customized response to an overscrolling pull input.
+ */
+public interface OverscrollRefreshHandler {
+ /**
+ * Signals the start of an overscrolling pull.
+ * @return Whether the handler will consume the overscroll sequence.
+ */
+ public boolean start();
+
+ /**
+ * Signals a pull update.
+ * @param delta The change in pull distance (positive if pulling down, negative if up).
+ */
+ public void pull(float delta);
+
+ /**
+ * Signals the release of the pull.
+ * @param allowRefresh Whether the release signal should be allowed to trigger a refresh.
+ */
+ public void release(boolean allowRefresh);
+
+ /**
+ * Reset the active pull state.
+ */
+ public void reset();
+
+ /**
+ * Toggle whether the effect is active.
+ * @param enabled Whether to enable the effect.
+ * If disabled, the effect should deactive itself apropriately.
+ */
+ public void setEnabled(boolean enabled);
+}

Powered by Google App Engine
This is Rietveld 408576698