summaryrefslogtreecommitdiff
path: root/src_plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src_plugins')
-rw-r--r--src_plugins/com/android/systemui/plugins/OverscrollPlugin.java44
1 files changed, 23 insertions, 21 deletions
diff --git a/src_plugins/com/android/systemui/plugins/OverscrollPlugin.java b/src_plugins/com/android/systemui/plugins/OverscrollPlugin.java
index 28a9193bec..a434d078bc 100644
--- a/src_plugins/com/android/systemui/plugins/OverscrollPlugin.java
+++ b/src_plugins/com/android/systemui/plugins/OverscrollPlugin.java
@@ -15,6 +15,8 @@
*/
package com.android.systemui.plugins;
+import android.view.MotionEvent;
+
import com.android.systemui.plugins.annotations.ProvidesInterface;
/**
@@ -28,7 +30,7 @@ import com.android.systemui.plugins.annotations.ProvidesInterface;
public interface OverscrollPlugin extends Plugin {
String ACTION = "com.android.systemui.action.PLUGIN_LAUNCHER_OVERSCROLL";
- int VERSION = 3;
+ int VERSION = 4;
String DEVICE_STATE_LOCKED = "Locked";
String DEVICE_STATE_LAUNCHER = "Launcher";
@@ -41,33 +43,33 @@ public interface OverscrollPlugin extends Plugin {
boolean isActive();
/**
- * Called when a touch is down and has been recognized as an overscroll gesture.
- * A call of this method will always result in `onTouchUp` being called, and possibly
- * `onFling` as well.
- *
+ * Called when a touch has been recognized as an overscroll gesture.
+ * @param horizontalDistancePx Horizontal distance from the last finger location to the finger
+ * location when it first touched the screen.
+ * @param verticalDistancePx Horizontal distance from the last finger location to the finger
+ * location when it first touched the screen.
+ * @param thresholdPx Minimum distance for gesture.
+ * @param flingDistanceThresholdPx Minimum distance for gesture by fling.
+ * @param flingVelocityThresholdPx Minimum velocity for gesture by fling.
* @param deviceState String representing the current device state
* @param underlyingActivity String representing the currently active Activity
*/
- void onTouchStart(String deviceState, String underlyingActivity);
-
- /**
- * Called when a touch that was previously recognized has moved.
- *
- * @param px distance between the position of touch on this update and the position of the
- * touch when it was initially recognized.
- */
- void onTouchTraveled(int px);
+ void onTouchEvent(MotionEvent event,
+ int horizontalDistancePx,
+ int verticalDistancePx,
+ int thresholdPx,
+ int flingDistanceThresholdPx,
+ int flingVelocityThresholdPx,
+ String deviceState,
+ String underlyingActivity);
/**
- * Called when a touch that was previously recognized has ended.
- *
- * @param px distance between the position of touch on this update and the position of the
- * touch when it was initially recognized.
+ * @return `true` if overscroll gesture handling should override all other gestures.
*/
- void onTouchEnd(int px);
+ boolean blockOtherGestures();
/**
- * Called when the user starts Compose with a fling. `onTouchUp` will also be called.
+ * @return `true` if the overscroll gesture can pan the underlying app.
*/
- void onFling(float velocity);
+ boolean allowsUnderlyingActivityOverscroll();
}