summaryrefslogtreecommitdiffstats
path: root/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2019-01-28 16:46:31 -0800
committerSunny Goyal <sunnygoyal@google.com>2019-01-28 16:46:48 -0800
commit703ee9f6752bf5c6641eadfa513e057fca4838b7 (patch)
tree8ac3546f646ea94e37cd4b350e90c9f3ba4647c0 /quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
parent0428616762b191deb4143a5bd93524a8440da639 (diff)
downloadpackages_apps_Trebuchet-703ee9f6752bf5c6641eadfa513e057fca4838b7.tar.gz
packages_apps_Trebuchet-703ee9f6752bf5c6641eadfa513e057fca4838b7.tar.bz2
packages_apps_Trebuchet-703ee9f6752bf5c6641eadfa513e057fca4838b7.zip
Passing proper velocity information when simulating touch events on recents view
Change-Id: I488b8d61c47e49dbdc65b16e2470b171912efc3f
Diffstat (limited to 'quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java')
-rw-r--r--quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
index b152bb92b..5755205ea 100644
--- a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
+++ b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
@@ -67,6 +67,8 @@ import com.android.systemui.shared.system.WindowManagerWrapper;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
+import androidx.annotation.Nullable;
+
/**
* Touch consumer for handling events originating from an activity other than Launcher
*/
@@ -196,7 +198,7 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC
if (mPassedInitialSlop && mInteractionHandler != null) {
// Move
- dispatchMotion(ev, displacement - mStartDisplacement);
+ dispatchMotion(ev, displacement - mStartDisplacement, null);
if (FeatureFlags.SWIPE_HOME.get()) {
mMotionPauseDetector.addPosition(displacement);
@@ -217,11 +219,11 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC
}
}
- private void dispatchMotion(MotionEvent ev, float displacement) {
+ private void dispatchMotion(MotionEvent ev, float displacement, @Nullable Float velocityX) {
mInteractionHandler.updateDisplacement(displacement);
boolean isLandscape = isNavBarOnLeft() || isNavBarOnRight();
if (!isLandscape) {
- mInteractionHandler.dispatchMotionEventToRecentsView(ev);
+ mInteractionHandler.dispatchMotionEventToRecentsView(ev, velocityX);
}
}
@@ -316,15 +318,16 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC
*/
private void finishTouchTracking(MotionEvent ev) {
if (mPassedInitialSlop && mInteractionHandler != null) {
- dispatchMotion(ev, getDisplacement(ev) - mStartDisplacement);
mVelocityTracker.computeCurrentVelocity(1000,
ViewConfiguration.get(this).getScaledMaximumFlingVelocity());
-
float velocityX = mVelocityTracker.getXVelocity(mActivePointerId);
float velocity = isNavBarOnRight() ? velocityX
: isNavBarOnLeft() ? -velocityX
: mVelocityTracker.getYVelocity(mActivePointerId);
+
+ dispatchMotion(ev, getDisplacement(ev) - mStartDisplacement, velocityX);
+
mInteractionHandler.onGestureEnded(velocity, velocityX);
} else {
// Since we start touch tracking on DOWN, we may reach this state without actually