mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Prevent double touch inputs in the BaseDragLayer
If you hold a long press and while pressing you start another long press again with another finger, then a new onLongPress event will trigger and in some cases we are not processing that case. By ignoring the evetns with the flag ACTION_OUTSIDE we can prevent such cases. Fix: 247477725 Test: ReorderWidgets Change-Id: I31833bc54db2771809562bd1f92c8523eb2f05ab
This commit is contained in:
@@ -273,6 +273,12 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext>
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
if (ev.getActionIndex() > 0) {
|
||||
// This means there is multiple touch inputs, ignore it, we could also cancel the
|
||||
// previous touch but the user might cancel the drag by accident.
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (ev.getAction()) {
|
||||
case ACTION_DOWN: {
|
||||
if ((mTouchDispatchState & TOUCH_DISPATCHING_TO_VIEW_IN_PROGRESS) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user