Fix some taskbar stashing issues

- Don't allow long press to stash between taskbar icons
- Ensure taskbar_icon_touch_size is respected; previously it wasn't, because BubbleTextView@shouldIgnoreTouchDown() was returning true in the padding region. For taskbar, we want the whole icon size to be touchable.
- Cancel long press when passing touch slop to avoid swipe down being detected as long press

Test: long press on taskbar background, both between icons and not; swipe down on taskbar
Fixes: 198305464
Change-Id: I36f1d792e91da9a3bf57a2bef1e974b299c4e25c
This commit is contained in:
Tony Wickham
2021-08-31 10:41:36 -07:00
parent e55c0feb43
commit 42b0395fee
3 changed files with 24 additions and 2 deletions

View File

@@ -223,7 +223,11 @@ public class TaskbarViewController {
return view -> mControllers.taskbarStashController.updateAndAnimateIsStashedInApp(true);
}
public void onTouchEvent(MotionEvent motionEvent) {
/**
* Get the first chance to handle TaskbarView#onTouchEvent, and return whether we want to
* consume the touch so TaskbarView treats it as an ACTION_CANCEL.
*/
public boolean onTouchEvent(MotionEvent motionEvent) {
final float x = motionEvent.getRawX();
final float y = motionEvent.getRawY();
switch (motionEvent.getAction()) {
@@ -239,6 +243,7 @@ public class TaskbarViewController {
mControllers.taskbarStashController.startStashHint(
/* animateForward= */ false);
mCanceledStashHint = true;
return true;
}
break;
case MotionEvent.ACTION_UP:
@@ -249,6 +254,7 @@ public class TaskbarViewController {
}
break;
}
return false;
}
}
}