summaryrefslogtreecommitdiff
path: root/src_plugins
diff options
context:
space:
mode:
author James O'Leary <jamesoleary@google.com> 2020-05-04 16:41:58 -0400
committer James O'Leary <jamesoleary@google.com> 2020-05-06 13:40:47 -0400
commitd9c86d4b3b5fe2c5db94f4a801782d83f056e35c (patch)
tree9163f3e9fdd4bdfeb95f5e774ca108d9142143d3 /src_plugins
parente93d6d615cd39873b970e41a7a536030c9233377 (diff)
Compose gesture integrated fully into Launcher
- Support dismissing Compose via the reverse gesture from the appear gesture - Use Tony Wickham's ag/10204761 with some glue code to enable the app below Compose panning in the same direction as the gesture as Compose peeks in - Add feature flag to use Compose hosted in a window (permits underlying app panning) - Use InterpolatingVelocityTracker to fix OtherActivityInputConsumer processing swipes in the wrong direction ~20% of the time due to a bug in VelocityTracker (see go/quirky-bubbles) Change-Id: I65aa07ac112db8bd89cec9acfa0ce2b6ebacd43f
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();
}