mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Intercept touch events from anywhere while all apps is closing
Previously we did this only from a settled state, but now we also do it during the transition to NORMAL. Test: open all apps. Then, swipe down to home and back up to all apps (from above the top of all apps). Fixes: 159856104 Change-Id: Ib78c6a41d5fa17dd26a7df4e9069e0ada1f46dd0
This commit is contained in:
@@ -89,13 +89,16 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
|
||||
@Override
|
||||
protected boolean canInterceptTouch(MotionEvent ev) {
|
||||
// If we are swiping to all apps instead of overview, allow it from anywhere.
|
||||
boolean interceptAnywhere = mLauncher.isInState(NORMAL) && !mAllowDragToOverview;
|
||||
if (mCurrentAnimation != null) {
|
||||
if (mFinishFastOnSecondTouch) {
|
||||
mCurrentAnimation.getAnimationPlayer().end();
|
||||
}
|
||||
|
||||
AllAppsTransitionController allAppsController = mLauncher.getAllAppsController();
|
||||
if (ev.getY() >= allAppsController.getShiftRange() * allAppsController.getProgress()) {
|
||||
if (ev.getY() >= allAppsController.getShiftRange() * allAppsController.getProgress()
|
||||
|| interceptAnywhere) {
|
||||
// If we are already animating from a previous state, we can intercept as long as
|
||||
// the touch is below the current all apps progress (to allow for double swipe).
|
||||
return true;
|
||||
@@ -117,9 +120,7 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// If we are swiping to all apps instead of overview, allow it from anywhere.
|
||||
boolean interceptAnywhere = mLauncher.isInState(NORMAL) && !mAllowDragToOverview;
|
||||
// For all other states, only listen if the event originated below the hotseat height
|
||||
// For non-normal states, only listen if the event originated below the hotseat height
|
||||
if (!interceptAnywhere && !isTouchOverHotseat(mLauncher, ev)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user