Log gesture velocity to help debug and help direct future gesture nav thresholds.
Bug: 259021562 Test: performed gestures and checked logs Change-Id: If0dec4ef74c2ef2d1617d8c37f10f3ef9d96b2f5
This commit is contained in:
1 parent
a008f510c5
commit
eb4a5c7cbd
2 files changed
+45
-32
No files matched your search
@@ -391,17 +391,18 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
|
||||
} else {
|
||||
mVelocityTracker.computeCurrentVelocity(PX_PER_MS);
|
||||
int activePointerId = mMotionEventsHandler.getActivePointerId();
|
||||
float velocityX = getXVelocity(mVelocityTracker, ev, activePointerId);
|
||||
float velocityY = getYVelocity(mVelocityTracker, ev, activePointerId);
|
||||
float velocity = mNavBarPosition.isRightEdge()
|
||||
? velocityX
|
||||
float velocityXPxPerMs = getXVelocity(mVelocityTracker, ev, activePointerId);
|
||||
float velocityYPxPerMs = getYVelocity(mVelocityTracker, ev, activePointerId);
|
||||
float velocityPxPerMs = mNavBarPosition.isRightEdge()
|
||||
? velocityXPxPerMs
|
||||
: mNavBarPosition.isLeftEdge()
|
||||
? -velocityX
|
||||
: velocityY;
|
||||
? -velocityXPxPerMs
|
||||
: velocityYPxPerMs;
|
||||
mInteractionHandler.updateDisplacement(
|
||||
mMotionEventsHandler.getDisplacement(ev, mNavBarPosition)
|
||||
- mStartDisplacement);
|
||||
mInteractionHandler.onGestureEnded(velocity, new PointF(velocityX, velocityY));
|
||||
mInteractionHandler.onGestureEnded(
|
||||
velocityPxPerMs, new PointF(velocityXPxPerMs, velocityYPxPerMs));
|
||||
}
|
||||
} else {
|
||||
// Since we start touch tracking on DOWN, we may reach this state without actually
|
||||
|
||||
Reference in new issue
Block a user