Commit Graph

40 Commits

Author SHA1 Message Date
Ben Komalo 53ea83ebf9 Move Mailbox to top level class.
No other changes made.

Change-Id: I3d8f3c521dc0d902be313b25252b4b6a4a96e7ee
2011-05-13 17:42:02 -07:00
Makoto Onuki 8a894f1ca0 Remove MailboxListFragment.DEFAULT_MAILBOX_ID
Now that we supports nested folders on IMAP too, it's not needed.

Change-Id: I80a6d6b59444132762d56ae6e03a5de69863ab8d
2011-05-10 10:06:54 -07:00
Todd Kennedy 075feb4556 Implement new nested folder mocks
Change-Id: I7c0c1d41b7a40d83e1237ba31d5f7949945c7e1e
2011-05-05 10:26:54 -07:00
Todd Kennedy 6c3cd4e247 Implement drag-n-drop with nested folders
We can now drill down into nested folders during drag-n-drop. Simply hover over
a collapsed folder for 750ms and it will auto-expand.

Change-Id: Ia9b42dd87e19c2ebdf8675c761cb1453bb26d158
2011-04-14 16:23:20 -07:00
Todd Kennedy f7036b7379 only allow navigating to mailboxes w/ children
If a mailbox doesn't have any sub-mailboxes, only allow selecting them to view
any contained messages. Do not update the mailbox list.

Change-Id: I6f469bf20a57dc440885402084c21ff184f13dff
2011-04-13 14:35:03 -07:00
Todd Kennedy ce99dd8cd1 Add comment to package-private members & methods
Change-Id: I9bb641d44253635f8dacc5dfecde55eac8d72c59
2011-04-13 09:52:42 -07:00
Todd Kennedy 2b82c3f0a3 Add columns to cursor to allow for proper layout
The layout requires different indentation. Although the exact layout may
change, we will likely always need to differentiate between the different
mailbox types.

Change-Id: Ia2ff84b552873f92fa45563b2dc0868c29bec3e3
2011-04-12 15:09:51 -07:00
Todd Kennedy 7f139f14b9 Add current nested folder to list
When selecting a nested folder, the currently selected folder should be listed
along with "All Folders" and sub-folders

Change-Id: I7c6f726a0355a13d3e7b59aa4707bd92473283b4
2011-04-12 09:47:56 -07:00
Todd Kennedy 007d0be4ed First pass at nested folder support
currently only really works for exchange accounts. legacy accounts (imap
or pop) do not build a folder heirarchy.

Change-Id: Idb7c622b64a599a0776233a076359869f4ab4a4f
2011-04-07 14:23:21 -07:00
Todd Kennedy ad7dc464db update mailbox adapter callback
the callback method name was not appropriate in all situations. This has been
renamed to just "onBind()" and will still be invoked whenever data is bound to
the adapter. also, create an empty callback that can be used if the adapter
doesn't need to be informed when a bind occurs.

Change-Id: Ifaa4aea3a59734557651270330ca9439e3ea4ab4
2011-04-01 11:47:35 -07:00
Todd Kennedy 74bf57cfaf Create separate adapters for mailbox lists
There are currently two places where we use a mailbox list -- in the main
view and in the "move to" dialog. We've replaced the single, modally
configured adapter with two specialized subclasses.

Change-Id: I5dfd5ccd435fefbab4b7647c2bd7a14818f73bf3
2011-03-31 15:27:12 -07:00
Marc Blank 31d9acbf06 Email split, part huit: Refactor constants, clean emailcommon
* There are three pieces to this CL (sorry):
  1) Move and/or rename some constants into emailcommon
  2) Move Utility to emailcommon, moving the few UI
     related utilities back into Email (FolderProperties
     and UiUtilities)
  3) Remove all references to resources from emailcommon
* The three pieces relate in that, between them, they allow
  the emailcommon static library to compile cleanly

Bug: 3442973

Change-Id: Ic5e3abaa2a1b36999e0b6653c6c2134ea1bd544f
2011-02-14 12:18:10 -08:00
Marc Blank a7bc0319a7 Email split, part six: EmailContent
* Moved EmailContent to emailcommon

Change-Id: Ib3db1bfcfe74554c0e5afd3cfce6d72f26e9aeb9
2011-02-10 19:44:29 -08:00
Makoto Onuki d0ee1e404d Fix bug where mailbox list won't update in combined view
The problem was that CombinedMailboxesLoader used the cursor returned by
super.loadInBackground() (which contains accounts), to build a matrix
cursor (which contains special mailboxes and accounts and will be returned),
and *it closed the first cursor* after building the matrix cursor.

However, because this first cursor is the one that CursorLoader sets an
observer, it shouldn't be closed until the returned matix cursor closes.
In other words the two cursors should have the same lifecycle.

Fixed it by using ClosingMatrixCursor that used by AccountsLoader, which
is doing a similar thing, but properly.

Bug 3387730

Change-Id: I554ade001dc25afa869eefb4dcf9887495e6753e
2011-01-26 13:40:53 -08:00
Makoto Onuki 80a2e9109d Remove STOPSHIPs regarding CloseTraceCursorWrapper
The loader crash seems to have been gone.

Bug 3335072
Bug 3335067

Change-Id: Iefc5367e6e394840687b0c2c4f6b75f8e9661d26
2011-01-18 10:04:14 -08:00
Makoto Onuki d072f9905d Don't show trashed messages in Starred mailbox
Also show the *total* starred message count (excluding trashed starred)
in the mailbox list, not *per-account* starred count.

Bug 3346872
Bug 2149412

Change-Id: I2274f215f994b62280ac6138982b927cec22c677
2011-01-13 15:41:22 -08:00
Makoto Onuki 9c0da8b84f Don't show starred mailbox, if account has no starred
Bug 3334963

Change-Id: I751e56731b990a6e94b8547a577a84c1a848cbc7
2011-01-11 16:45:05 -08:00
Makoto Onuki adbb6f8bc4 Log cursor/adapter class name and such when detecting a crash
Also log where the cursor was closed, if it is.

To investigate bug 3308465 and bug 3305706

Change-Id: I2b0fd9ea14757b6cf7597cd7162686d050d43fe9
2010-12-23 16:15:44 -08:00
Makoto Onuki 5b81690de1 Show color chips for combined view.
Show color chips for account rows and message items on the combined view.

Moved hard-coded color values to resource.

Bug 3138001

Change-Id: Ib93fb9d6e9592ebd0c297f83c3dee2358a80508f
2010-11-23 13:03:06 -08:00
Makoto Onuki f108837c1d Show current mailbox name and unread count on action bar.
- Show them when the mailbox list is hidden
- Data flow:
  MailboxListFragment ->(Callback)-> MessageListXL ->
  MessageListXLFragmentManager, which controls the action bar.
  (I'm not too happy with this flow, but we can at least avoid
  issuing yet another query to get these data.)

Also related:
- On the combined view, show the unread count for account rows

Bug 3137891

Change-Id: I37fa1258d946329905bbbc0da905928bcf2f4cb1
2010-11-19 13:55:49 -08:00
Makoto Onuki 6f3d167cfa Don't show non-incoming message in notification.
Filter out non-incoming messages using a subquery.
(because the message table doen't have the mailbox type.)

I was initially thinking of adding a new content URL for
the message table joined with the mailbox table, but it turned out
to be a bit of pain, so ended up using a subquery.
(one of the problems was that both tables had the "_id" field.)

Bug 3177220

Change-Id: I276efb70db1589835f3ddb8c7da4773e72d8691b
2010-11-10 10:22:41 -08:00
Makoto Onuki d12e56d321 Fix auto-refresh of mailbox list
sEnableUpdate should default to true.

Bug 3180421

Change-Id: I1145846d96bba9e962f598e785daf7ce7ad2404b
2010-11-09 15:27:55 -08:00
Makoto Onuki 9c39deef4e Code change for new mailbox list layout
- Don't show a folder icon for regular mailboxes
- Change the count look
- Don't show counts for Sent/Trash.

Bug 3137965
Bug 3073147

Change-Id: I8fc0af8fc2d51968605fe4b570e5704453092ac7
2010-11-08 18:16:23 -08:00
Marc Blank c81bef6720 Drag & Drop "move to folder"
* Drag & Drop "move to folder" preliminary implementation
* Use "drag handle" button to initiate drag
* Use the message list item itself as the drag thumbnail for
  one item; "Move N messages" for multiple (not implemented)
* Disable MailboxList update during drag
* Use ListView itself as drag/drop target

Bug: 3138004
Change-Id: I9243e4f583cf91caa1b9dd04fd64d52e8b28fa30
2010-11-04 08:45:24 -07:00
Makoto Onuki 730cc6724a Add "Combined view".
- Don't show combined mailboxes with regular mailboxes in the mailbox list.
- Add "Combined view" to the account selector instead.
- "Combined view" has all the combined mailboxes and accounts.
- Renambed these combined boxes.  (e.g. "Combined inbox" -> "Inbox")
- Regular account view still has "Starred" mailbox, but it's actually
  "combined" and not per-account.
- Re-order special mailboxes per latest wireframe.

Bug 3138004

Change-Id: I4c5860c6774b10c55ba0ca599373e51105432cf8
2010-11-01 11:51:51 -07:00
Makoto Onuki 9b5001a34c Don't use negative IDs with ListView
ListView uses the _id column for some operations, including
onSave/RestoreInstanceState, and if the column contains negative values
they don't work as expected.  The same assumption seems to be in other places
as well, so let's just avoid using negative IDs.

With this CL we now use two different IDs, one for ListView, which will
never be negative, and the other for us, the actual mailbox ID.

Bug 3049315

Change-Id: I263b4895212b5f8bb80c98acaf5c4eccd0bfef55
2010-10-14 14:42:46 -07:00
Makoto Onuki 56034cab20 Fix "move to" dialog style
- Pass the correct context to the adapter to make the text visible.
- MailboxesAdapter itself now has two modes (normal mode for MailboxList,
  and "move to" mode), and use different views for them.

Change-Id: I2bd8a7d3a99d7fa3a047e653a77ec958e37e563b
2010-10-01 11:40:09 -07:00
Makoto Onuki 4209ea36b0 Make ThrottlingCursorLoader smarter
Now the class initially uses smaller timeout, and expand it when detecting
multiple changes in a short period.

This CL makes the UI look more responsive especially on the message list +
message view mode.  e.g. Starring on the message view will quickly be
reflected to the message list.

Bug 3024799
Bug 3027832

Change-Id: Ie2d44c3769d43e3fd0f54ee526556eb3bad5e288
2010-09-22 18:01:01 -07:00
Makoto Onuki b4dacf2acf Don't show only special mailboxes on mailbox list
When a new account has just been set up and the app is still loading
mailboxes, keep the mailbox list empty and let ListFragment show
the progress icon, rather than showing "Combined Inbox" "All Starred" etc
without acutal inboxes, which looks like it's broken.

Change-Id: Ia3de4377b701f0033c5dc92f8b6b14651d4d8e1e
2010-09-22 14:03:06 -07:00
Makoto Onuki d4aac1e847 Always show Combined Inbox
Even if unread count == 0.

Bug 2992923

Change-Id: I2c2bd9781630e7664a7bd4b6fcb5012e9ebe2dc6
2010-09-13 10:59:35 -07:00
Makoto Onuki a262f908ae Show total message count for Outbox/Sent
Instead of unread count.

Change-Id: I90fe96093bc31f26e4cacacf6adfb0a3cf009d04
2010-09-08 16:09:11 -07:00
Makoto Onuki 27c6547968 Remove obsolete TODOs
They're all obsolete.
(Fix is already in, change in a different place made it obsolete, etc.)

Change-Id: I04452a973c86d39aca8e89f8883dcf1d7e480dee
2010-09-08 12:14:24 -07:00
Marc Blank 62f9c4d280 Temporary UI for "move to folder"
* Many TODOs left in code.
* Only supports moving 1 message. (from message view)

Change-Id: Ibdec3163382345a7096c2cba51f448d69a9720af
2010-09-01 11:40:44 -07:00
Makoto Onuki 0f67e7af9c Brush up mailbox list.
- Don't show combined boxes when there's only one account.
- Show special mailboxes (e.g. drafts) right after inbox
  and before regular mailboxes.

Bug 2941270

Change-Id: I03ba356f5f2367f0478133acc1f2e35d182d359c
2010-08-26 10:54:52 -07:00
Makoto Onuki 94506fdaf6 Small fixes/clean-ups.
- Fixed account selector default account look-up
- Renamed MessageListFragment.onRestoreInstanceState
  to loadState.
  (Activity.onRestoreInstanceState is called after onStart,
  but this one is called in onCreate, so it wasn't a good
  idea to use the same name.)
- Changed mailbox cursur requery timeout to 3 seconds
- Added some TODOs.

Change-Id: Ia2242cd9f74936d24756b800eacd126958eed330
2010-08-06 10:11:36 -07:00
Makoto Onuki 630e31ef78 Introducing ThrottlingCursorLoader.
This is a {@link CursorLoader} variant that takes {@code timeoutSecond}
in the constructor.

When it detects changes in the underlying data, it'll wait until the timeout
before doing a requery.

We use this to throttle # of queries.  We don't want to issue a query every
time something changes in the DB while we're syncing.

Change-Id: I098366bce923c3242c42964bc166493610ee0f6f
2010-08-03 17:45:51 -07:00
Makoto Onuki 833fe73b99 Aadd special boxes to mailbox list.
Change-Id: I36616f53555346ca7fbb6f3426a0c3196d7bacbc
2010-08-03 17:06:04 -07:00
Makoto Onuki 7ef278202e Clean up MailboxListFragment.
- Remove AsyncTasks, and use CursorLoader to load data.
- Get message counts for the drafts/trash mailboxes directly from
  the db column.
- Remove obsolete code from MailboxesAdapter.

Change-Id: I93c72977c19b60581e1169ba9bd429912ba3e68f
2010-08-02 16:33:23 -07:00
Andrew Stadler 80091c8ef7 Refactor MailboxList to use Fragment API
* Moves all list-related implementation to new MailboxListFragment
* One item that remains to be done is to remove the dependency on the
  activity for handling context menu (longpress) in the list.

Change-Id: I7b5769d9d81fb685cf480de3d3e18b4e1c078f2d
2010-06-07 16:02:52 -07:00
Andrew Stadler ca59313085 Extract MailboxesAdapter from MailboxList
* Create MailboxesAdapter
* No unit tests (nothing to test here outside of view binding)

Change-Id: Id3ca06eeffbfe46a6aa683eb212a096496a3129f
2010-06-01 16:45:29 -07:00