1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 01:28:50 -05:00
Go to file
m0viefreak 022940d4f5 Fix gesture detection
This commit addresses 2 issues:

1) Before, a general GestureDetector was registered on the highest level in K9Activity
   This resulted in EVERY inherited activity to have a useless, unused gesture detector.
   But more than that, in MessageList, a second GestureDetector was assigned to the ListView.
   On every fling gesture, both detectors called the onSwipe() methods,
   which technically did the following:
   - The one directly assigned to the ListView would work corectly by mapping the
     (local) event coordinates to the right entry in the ListView
   - The global one worked on screen coordinates, so the onSwipe() method would
     likely select the wrong ListView entry (system menu bar offset).
   - For some reason this "worked" fine, and only the correct entry was selected,
     despite two detectors used.

2) The gesture detection for the MessageView caused problems when the message
   itself was scrollable, i.e. wide HTML mails. A fling gesture inside the WebView
   would scroll the message, but also switch the message.

This commit fixes all those by doing the following:
- Don't register the GestureDetector in K9Activity, instead make the member variable
  accessible by subclasses.
- In the subclasses that need a detector register it
- In K9Activity.dispatchTouchEvent() check for mGestureDetector being null
- For MessageList:
  * Remove the duplicate gesture detector assigned to the ListView
  * in the handleSwipe() methods: calclulate pixel offset of the ListView to make
    it work using the global screen coordinates
- For MessageView: Limit sensitive area to the message header, to prevent interference
  with the WebView scrolling
- Respect current behavior:
  * Force-enable gestures for the MessageList
  * Respect user setting in MessageView
- Make sure that after a successful swipe gesture, any pending action is cancelled, to
  prevent unwanted things to happen (such as expanding the header after changing
  the message, or a context menu popping up in the MessageList).
  See http://code.google.com/p/android/issues/detail?id=8497
2012-05-01 03:00:15 +02:00
assets SingleMessageView cleanup 2012-04-04 10:04:57 +02:00
compile-only-libs Add mockito jar for testing. 2011-07-21 17:41:19 -07:00
docs Added diagram that visualizes activity interactions 2011-10-27 19:13:13 +02:00
images Reply receipt menu icons, take 2 (or 3?) 2012-04-09 10:32:20 -07:00
libs Merge ashleywillis' changes in https://github.com/k9mail/k-9/pull/97. 2011-11-14 14:00:15 -08:00
res Capitalize "Hotmail" 2012-04-25 11:04:48 -07:00
src/com/fsck/k9 Fix gesture detection 2012-05-01 03:00:15 +02:00
tests Fixed code style 2012-04-25 16:46:05 +00:00
tools Don't force Eclipse settings on users 2011-06-10 20:25:40 +02:00
.classpath ADT 17 changes 2012-03-25 00:28:40 +01:00
.gitignore Add vi archive files to default ignore list. 2011-08-29 12:07:19 -07:00
.project fix the eclipse project name 2010-11-26 03:53:18 +00:00
Android.mk Merge ashleywillis' changes in https://github.com/k9mail/k-9/pull/97. 2011-11-14 14:00:15 -08:00
AndroidManifest.xml Bumped manifest to 4.116 2012-04-26 09:09:28 -04:00
ant.properties Upgrade to SDK 15 2012-03-11 14:31:35 -05:00
build.xml Updated astyle rules 2012-04-25 17:02:24 +00:00
HTMLCLEANER_LICENSE Merge ashleywillis' changes in https://github.com/k9mail/k-9/pull/97. 2011-11-14 14:00:15 -08:00
k9mail.iml Move android-sdk to the end of the dependency list so that our newer junit will take precendence over the built-in junit. Also fixes in-IDE tests. 2012-04-17 10:33:35 -07:00
MODULE_LICENSE_APACHE2 Initial commit - This source code should be EXACTLY what the current version of the 'Email' application in the android repo looks like as of this date. 2008-10-28 01:04:44 +00:00
NOTICE Initial commit - This source code should be EXACTLY what the current version of the 'Email' application in the android repo looks like as of this date. 2008-10-28 01:04:44 +00:00
proguard.cfg Upgrade us to android-14 infrastructure 2011-10-27 12:41:24 -04:00
project.properties Upgrade to SDK 15 2012-03-07 21:52:47 +01:00