Merge "Increase bubble bar tap timeout" into main

This commit is contained in:
Ats Jenk
2025-01-03 09:31:02 -08:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 4 deletions
@@ -299,7 +299,7 @@ public class BubbleDragController {
private final PointF mTouchDownLocation = new PointF();
private final PointF mViewInitialPosition = new PointF();
private final VelocityTracker mVelocityTracker = VelocityTracker.obtain();
private final long mPressToDragTimeout = ViewConfiguration.getLongPressTimeout() / 2;
private final long mPressToDragTimeout = ViewConfiguration.getLongPressTimeout();
private State mState = State.IDLE;
private int mTouchSlop = -1;
private BubbleDragAnimator mAnimator;
@@ -53,7 +53,7 @@ public class BubbleBarInputConsumer implements InputConsumer {
private final int mTouchSlop;
private final PointF mDownPos = new PointF();
private final PointF mLastPos = new PointF();
private final long mTimeForTap;
private final long mTimeForLongPress;
private int mActivePointerId = INVALID_POINTER_ID;
public BubbleBarInputConsumer(Context context, BubbleControllers bubbleControllers,
@@ -64,7 +64,7 @@ public class BubbleBarInputConsumer implements InputConsumer {
mInputMonitorCompat = inputMonitorCompat;
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
mTimeForTap = ViewConfiguration.getTapTimeout();
mTimeForLongPress = ViewConfiguration.getLongPressTimeout();
}
@Override
@@ -110,7 +110,8 @@ public class BubbleBarInputConsumer implements InputConsumer {
case MotionEvent.ACTION_UP:
boolean swipeUpOnBubbleHandle = mBubbleBarSwipeController != null
&& mBubbleBarSwipeController.isSwipeGesture();
boolean isWithinTapTime = ev.getEventTime() - ev.getDownTime() <= mTimeForTap;
// Anything less than a long-press is a tap
boolean isWithinTapTime = ev.getEventTime() - ev.getDownTime() <= mTimeForLongPress;
if (isWithinTapTime && !swipeUpOnBubbleHandle && !mPassedTouchSlop
&& mStashedOrCollapsedOnDown) {
// Taps on the handle / collapsed state should open the bar