DO NOT MERGE - Disabled swiping in Grid-based Recents.

Bug: 32101881
Change-Id: I45a806a6b1fc387b2c560a8f2228ad83e4068d7c
(cherry picked from commit 7e09146f13)
This commit is contained in:
Jiaquan He
2016-12-19 11:20:31 -08:00
committed by Manu Cornet
parent 5153e46897
commit 620aebabb2

View File

@@ -168,7 +168,7 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback {
/** Touch preprocessing for handling below */
public boolean onInterceptTouchEvent(MotionEvent ev) {
// Pass through to swipe helper if we are swiping
mInterceptedBySwipeHelper = mSwipeHelper.onInterceptTouchEvent(ev);
mInterceptedBySwipeHelper = isSwipingEnabled() && mSwipeHelper.onInterceptTouchEvent(ev);
if (mInterceptedBySwipeHelper) {
return true;
}
@@ -680,4 +680,11 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback {
public float getScaledDismissSize() {
return 1.5f * Math.max(mSv.getWidth(), mSv.getHeight());
}
/**
* Returns whether swiping is enabled.
*/
private boolean isSwipingEnabled() {
return !mSv.useGridLayout();
}
}