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.
This commit is contained in:
Thialfihar 2010-07-15 21:35:57 +00:00
parent 0a38d9242c
commit 19ca87a2d5
2 changed files with 3 additions and 37 deletions

View file

@ -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();
}
}
}

View file

@ -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)