1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00
Commit Graph

293 Commits

Author SHA1 Message Date
cketti
ea902ce680 Merge onToggleSortAscending() with changeSort() to avoid code duplication 2012-05-16 20:35:56 +02:00
cketti
c64c14c4a6 Use account sort settings when filtering messages of only one account
This will use the account settings when viewing e.g. only the unread
messages in a folder.
2012-05-16 20:35:55 +02:00
cketti
6d19d9c829 Save sort type and sort order for search views (e.g. Unified Inbox) 2012-05-16 20:35:55 +02:00
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
cketti
5d080b656d Fixed a NullPointerException for the context menu in the Unified Inbox 2012-04-30 16:12:14 +02:00
Andrew Chen
32ae7bad9c Migrate to Account.has(Special)Folder() methods. 2012-04-17 08:23:22 -07:00
ashley willis
93de6cdafe fixed issue with sort not being remembered at all on unified inbox / all messages (still does not save sort to settings). 2012-04-12 21:12:22 -05:00
ashley willis
f0c22510e2 fixed FC when changing sort from unified inbox and all messages.
the new sort saves per account, and there is no active account for these folders.
so also, there is no saving of the sort for the unified inbox nor all messages.
2012-04-11 00:08:49 -05:00
Yaroslav Halchenko
4288789e39 BF: mAccount must not be accessed before verfied to be non-null
otherwise obviously leads to crashes.
IMHO this was a logical location to move, and it resolved my issue when
account was not yet accessible due to not yet accepted key upon importing
old settings from a stored file
2012-04-10 22:26:49 -04:00
ashley willis
539ab93bcb refactored sorting 2012-04-08 21:29:08 -05:00
cketti
d6a1f2e95c Renamed enum SORT_TYPE to SortType 2012-04-08 23:17:06 +02:00
Jesse Vincent
dd0ba7640c Switch the sort order code around so it saves when reversing sort with a keyboard 2012-04-07 17:11:32 -04:00
Jesse Vincent
66528a0ca8 Merge pull request #128 from srinathwarrier/k-9
---

A new option to set default sort setting is added to account settings.

* commit '7a9ba4e0ad483cb275281e8b33d9e6d35d870151':
  Create implicit sort remembering setting2(minor indentation error)
  Create implicit sort remembering setting
  Create default sort setting by preference
2012-04-07 16:53:53 -04:00
Andrew Chen
50b2056454 Always hide the batch archive button in a search view, consistent with the batch ops menu. 2012-04-06 16:46:04 -07:00
Andrew Chen
42d6462946 Hide the batch archive button preference if none of our accounts have an archive folder.
Hide the batch archive button in the MessageList if none of the visible account(s) have an archive folder.
2012-04-06 15:52:56 -07:00
Andrew Chen
e94db81ecb Add Account.hasArchiveFolder() method. 2012-04-06 14:45:44 -07:00
Andrew Chen
3e03120a73 Merge branch 'master' of https://github.com/mnb20/k-9 into pull111
* 'master' of https://github.com/mnb20/k-9:
  High DPI version of archive button icon
  Fixed whitespace
  Remove TODO
  Replaced archive icon. Still a bit crap, but better than my previous attempt.
  Added batch buttons for Archive and Move. Made batch buttons configurable.
2012-04-06 13:47:55 -07:00
Srinath Warrier
7a9ba4e0ad Create implicit sort remembering setting2(minor indentation error) 2012-03-12 22:55:31 +05:30
Srinath Warrier
3ebd3c1fc2 Create implicit sort remembering setting 2012-03-12 22:04:10 +05:30
ashley willis
f9a30d1822 added sort by arrival option. 2012-03-11 17:48:56 -05:00
Srinath Warrier
ff6e1f6c85 Create default sort setting by preference 2012-03-04 16:20:37 +05:30
cketti
1af5476b96 Hide refile batch actions in the message list for POP3 accounts 2012-02-25 04:19:27 +01:00
wilian-cb
02b07f34a1 Issue 3280: Add launcher shortcuts for special accounts/folders ("Unified Inbox" and "All messages") 2012-02-10 00:24:32 -06:00
cketti
898f65e081 Changed the way we set flags to update the original Message object 2012-02-04 21:06:34 +01:00
cketti
0625e13380 Canceling notifications once should be enough 2012-01-20 23:32:55 +01:00
cketti
a8f91b0f70 Minor code cleanup 2012-01-20 23:32:12 +01:00
wcb
457e65010e Issue 3139: notifications of new messages removed when unified inbox is selected 2012-01-20 11:55:04 -08:00
cketti
8e627834c1 Changed font size unit from DIP to SP
"Scale-independent Pixels - this is like the dp unit, but it is also
scaled by the user's font size preference. It is recommend you use this
unit when specifying font sizes, so they will be adjusted for both the
screen density and the user's preference." - Android Developer Docs
2012-01-12 02:18:41 +01:00
cketti
0aa513429a Show/hide ListView footer depending on message list type
Fixes issue 3946
2011-12-31 02:24:54 +01:00
Mark Baker
09c6cfb6e4 Remove TODO 2011-12-29 09:56:54 +00:00
Mark Baker
af1b9f83f2 Added batch buttons for Archive and Move. Made batch buttons configurable. 2011-12-24 18:17:12 +00:00
cketti
50058a92db Fixed "managed" back button behavior in MessageView 2011-12-05 18:16:43 +01:00
cketti
14ff4d006e Removed onBackPressed() magic 2011-11-10 05:38:52 +01:00
cketti
85f556e6c9 Removed helper function to create AbsoluteSizeSpan objects 2011-11-10 05:38:51 +01:00
cketti
e2e9f8b6a3 Fixed startActivityForResult() failing for MessageList
Fixes issue 3638
2011-11-07 00:07:06 +01:00
Andrew Gaul
647ae0a31c Prefer Collection.isEmpty over size 2011-11-02 20:03:07 -07:00
Andrew Chen
30151f1a70 Add parameter to MyGestureDetector to enable gestures for a specific detector, even if system-wide gestures are disabled. 2011-11-01 17:25:49 -07:00
Andrew Chen
edd78ea10c Make the K9Activity GestureDetector more generic so that it can be used by both MessageList and MessageView.
Make the mTopView a ToggleScrollView.  The only consumer is currently the MessageView, which uses a ToggleScrollView anyway.  This should make it easier to reuse the anti-scrolling features in ToggleScrollView for ListView later on.
2011-11-01 16:55:13 -07:00
Andrew Gaul
220e55603d Spelling corrections 2011-10-05 22:04:39 -07:00
Koji Arai
f3795f3df5 Search same sender from searchable folders instead of the unified inbox 2011-09-16 01:33:51 +09:00
Jesse Vincent
7b7601082b the refactoring to combine batch and record logic added an extra check
that broke delete of single messages from message list.
2011-07-23 18:45:43 -04:00
Koji Arai
fda43206a3 Fixed the below issue for GalaxyS and S2.
When scrolling a ListView, all items turn black.
it was reproduced on FolderList, MessageList and Accounts, other views were not.
2011-07-20 22:13:20 +09:00
Jesse Vincent
a558466c36 ant astyle 2011-06-13 19:49:06 -04:00
Fiouz
c416f02d52 Improve BACK button handling for MessageView
Remove memory leak from referencing MessageView context from the
Intent that is created to go back to MessageList. MessageView is no
longer hardcoded to go back to MessageList, it instead uses an Intent
given at creation to get back to the originating Activity.

Try our best to restore the MessageList in its previous state when
"Manage BACK button" option is enabled:
Since MessageList lives in its own task, we look for the previous
active task and check whether its top activity matches it. If it does,
we just finish MessageView and Android will automatically restore the
previous task. If it doesn't, we launch the originating Intent (and
MessageList state will be lost).

If option is off, we get the regular Android behavior: got back to the
previous screen, whenever it's the MessageList or another application
if the user long-pressed HOME.

The consequence of this is the need for a new permission in order to
check the previous active task: android.permission.GET_TASKS
2011-06-08 22:53:23 +02:00
Fiouz
9b0ce3c75a Remove no longer used references on confirmation dialog disapproval 2011-06-07 01:25:38 +02:00
Fiouz
fc4dd077e4 Don't attempt to configure a dismissed dialog during Android activity
reloading

As part of automatic activity reloading following a configuration
change, Android invokes Activity#onPrepareDialog() even for dismissed
dialogs. Consequently, one can't make the assumption that this method
is only invoked by explicit calls to Activity#showDialog() from our
code.

The actual problem here was the mActiveMessages member being null
at such times.
2011-06-07 01:15:04 +02:00
Fiouz
72870174ce Pluralize the "Move to spam" confirmation dialog since code paths were
unified in MessageList and multi-selection is now subject to this
dialog.
2011-06-05 01:35:11 +02:00
Fiouz
de7b75a1df Properly keep selection in case of a
configuration change (orientation, keyboard, etc.) during user
interaction (e.g. a dialog)
2011-06-05 01:16:34 +02:00
Fiouz
5366a07f28 Add @Override compiler check 2011-06-04 23:55:48 +02:00
Fiouz
190d028669 Javadoc fix 2011-06-04 23:17:47 +02:00