1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-02 00:25:10 -04:00

ignore gestures during text selection

Fixes issue 662
This commit is contained in:
Thialfihar 2010-07-14 18:20:10 +00:00
parent 510e9acc83
commit 91599ae963
2 changed files with 10 additions and 2 deletions

View File

@ -19,6 +19,7 @@ import com.fsck.k9.K9;
public class K9Activity extends Activity
{
private GestureDetector gestureDetector;
private boolean mIgnoreGestures = false;
protected ScrollView mTopView;
@ -104,6 +105,11 @@ public class K9Activity extends Activity
{
}
protected void setIgnoreGestures(boolean ignoreGestures)
{
mIgnoreGestures = ignoreGestures;
}
class MyGestureDetector extends SimpleOnGestureListener
{
@ -135,7 +141,7 @@ public class K9Activity extends Activity
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
{
if (K9.gesturesEnabled())
if (K9.gesturesEnabled() && !mIgnoreGestures)
{
// Convert the dips to pixels
final float mGestureScale = getResources().getDisplayMetrics().density;

View File

@ -169,8 +169,9 @@ public class MessageView extends K9Activity implements OnClickListener
}
else
{
// Text selection is finished. Allow scrolling again.
// Text selection is finished. Allow scrolling and gestures again.
mToggleScrollView.setScrolling(true);
setIgnoreGestures(false);
}
}
@ -2254,6 +2255,7 @@ 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)