From 19ca87a2d54257715887999e09e5d782dea55c5f Mon Sep 17 00:00:00 2001 From: Thialfihar Date: Thu, 15 Jul 2010 21:35:57 +0000 Subject: [PATCH] removed the initiation of "select text" via long press again Update issue 662 We tried out the long press for a bit and deemed it too sensitive for general usage. It can cause problems with gestures and such, so I removed it again. I hope using the option menu is not too much overhead. If you want to include it in your custom build or anything, then r 1976 and r1977 should be enough. --- src/com/fsck/k9/activity/K9Activity.java | 17 +---------------- src/com/fsck/k9/activity/MessageView.java | 23 ++--------------------- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/com/fsck/k9/activity/K9Activity.java b/src/com/fsck/k9/activity/K9Activity.java index 07c5c9a30..548881d05 100644 --- a/src/com/fsck/k9/activity/K9Activity.java +++ b/src/com/fsck/k9/activity/K9Activity.java @@ -19,7 +19,6 @@ import com.fsck.k9.K9; public class K9Activity extends Activity { private GestureDetector gestureDetector; - private boolean mIgnoreGestures = false; protected ScrollView mTopView; @@ -101,14 +100,6 @@ public class K9Activity extends Activity protected void onPrevious(boolean animate) { } - protected void onLongPressGesture() - { - } - - protected void setIgnoreGestures(boolean ignoreGestures) - { - mIgnoreGestures = ignoreGestures; - } class MyGestureDetector extends SimpleOnGestureListener { @@ -141,7 +132,7 @@ public class K9Activity extends Activity @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { - if (K9.gesturesEnabled() && !mIgnoreGestures) + if (K9.gesturesEnabled()) { // Convert the dips to pixels final float mGestureScale = getResources().getDisplayMetrics().density; @@ -171,12 +162,6 @@ public class K9Activity extends Activity } return false; } - - @Override - public void onLongPress(MotionEvent e) - { - onLongPressGesture(); - } } } diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index faf01dd22..4663e7431 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -140,8 +140,6 @@ public class MessageView extends K9Activity implements OnClickListener private FontSizes mFontSizes = K9.getFontSizes(); - private boolean mIgnoreNextUpEvent = false; - /** * Pair class is only available since API Level 5, so we need * this helper class unfortunately @@ -163,16 +161,8 @@ public class MessageView extends K9Activity implements OnClickListener { if (ev.getAction() == MotionEvent.ACTION_UP) { - if (mIgnoreNextUpEvent) - { - mIgnoreNextUpEvent = false; - } - else - { - // Text selection is finished. Allow scrolling and gestures again. - mToggleScrollView.setScrolling(true); - setIgnoreGestures(false); - } + // Text selection is finished. Allow scrolling again. + mToggleScrollView.setScrolling(true); } return super.dispatchTouchEvent(ev); @@ -2234,14 +2224,6 @@ public class MessageView extends K9Activity implements OnClickListener return slide; } - @Override - protected void onLongPressGesture() - { - mMessageContentView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); - mIgnoreNextUpEvent = true; - emulateShiftHeld(mMessageContentView); - } - /** * Emulate the shift key being pressed to trigger the text selection mode * of a WebView. @@ -2255,7 +2237,6 @@ public class MessageView extends K9Activity implements OnClickListener KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0); shiftPressEvent.dispatch(view); - setIgnoreGestures(true); Toast.makeText(this, R.string.select_text_now, Toast.LENGTH_SHORT).show(); } catch (Exception e)