Do not recognize gestures while selecting text

This commit is contained in:
Fredrik Fornwall
2016-01-13 03:42:46 +01:00
parent fe4365c94b
commit 54bc1ed791

View File

@@ -190,7 +190,7 @@ public final class TerminalView extends View {
@Override @Override
public void onLongPress(MotionEvent e) { public void onLongPress(MotionEvent e) {
if (!mGestureRecognizer.isInProgress()) { if (!mGestureRecognizer.isInProgress() && !mIsSelectingText) {
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
toggleSelectingText(e); toggleSelectingText(e);
} }
@@ -485,7 +485,8 @@ public final class TerminalView extends View {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) mActionMode.invalidateContentRect(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) mActionMode.invalidateContentRect();
invalidate(); invalidate();
break; // Return to prevent gestures when moving while selecting text.
return true;
default: default:
break; break;
} }