Commit Graph

52 Commits

Author SHA1 Message Date
Marc Blank 2193962ca2 Email split, part quatre: Move along, nothing to see here
* No code was harmed, er, changed in the making of this CL
* All that's happened is that code that is needed by both Email and
  Exchange have been moved into emailcommon
* This required import changes to many files, which explains the
  length of the CL

Change-Id: I4e12455ba057a4a8054fdbd0b578c73afa411c8a
2011-02-10 16:28:37 -08:00
Andy Stadler 7271bbef13 Remove a couple of STOPSHIP notes
* Restore ActionBar based progress in phone UX
* Removed unused debugging method

Change-Id: Ia36847d27fe9c9fa121a29f1e6a65bd3da0c3ffc
2011-01-09 14:19:35 -08:00
Dianne Hackborn 6c7075fb86 Remove use of old methods.
Change-Id: Ibc686a39cb2c481e6cd57b1d6029979cfd9f5b71
2011-01-08 13:08:04 -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
Andrew Stadler cd09545b87 Provide runtime switch for GL acceleration
* new checkbox in debug fragment
* saved value in prefs so it's sticky
* each Activity calls a helper to enable/disable per that flag

Change-Id: I1af1ae9f401bc746cc97da00dfb0e06407b79d46
2010-11-01 16:16:27 -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
Adam Powell 940c45df8e Updated for upcoming ActionBar API changes.
The extra overloads for setStandardNavigationMode are going away to
simplify the API. setTitle/setSubtitle should be used to change title
content in standard nav mode.

Change-Id: I29baa1ea5572a01ed9bc1d99f5c8a6e35dd02a1a
2010-09-07 18:15:13 -07:00
Marc Blank c184f36c2d Revert "Convert Controller to a full service"
This reverts commit 0e6d972641.

Change-Id: I005fc34152396806468edef919a3620961ddb4fe
2010-08-24 10:27:58 -07:00
Marc Blank 0e6d972641 Convert Controller to a full service
Change-Id: I2078fd047ff46f85936c8bf798a5edd3678bb5b4
2010-08-20 13:34:09 -07:00
Andrew Stadler 5122417625 Make AccountSettingsXL the main settings UI
* Connect to it from all call sites
* Remove 1-pane and 2-pane icons
* Leave a few more breadcrumbs for launching into specific account
* Update the long TODO list in AccountSettingsXL

Change-Id: I502eda9a622518e8d4a23d46989340ad400cdd34
2010-08-18 16:47:42 -07:00
Makoto Onuki 21efedb67f Rework/cleanup of "refresh".
Added RefreshManager, which is responsible for getting refresh requests
from UI and keeping track of what is being refreshed.

Conceptually it's a part of Controller, but extracted for easier testing.

- Now sendPendingMessagesForAllAccounts() is owned by RefreshManager
  rather than Controller.
- Also updateMailboxRefreshTime/mailboxRequiresRefresh have been moved
  in from the Email class.
- Now MessagingException implements a method to return an error message
  for the UI.

The refresh button on 2-pane doesn't work as intended yet, because the
spec is a bit too complicated (as described in the TODO in
MessageListXLFragmentManager.onRefhres()).

This change touches many file mostly because it cleans up a lot
of code duplication.

Change-Id: I058ab745ccff10f6e574f6ec4569c84ac4a3e10e
2010-08-18 11:06:45 -07:00
Makoto Onuki f513fbd8cb Implement UI event handlers.
Implemented
- The bottom buttons for MessageViwe
  Delete, Mark unread, Reply, Reply all, Forward.

- Buttons for exchange invitation
  View in Calender, "Yes", "No", "Maybe"

- Other MessageView events
  onUrlInMessageClicked()
  (Most other methods will probably be deprecated)

- Removed obsolete MailboxListFragment.Callback.onRefresh()

Fixes bug 2926517 minus "the background color of respond buttons
being black" part.

Change-Id: Ie58cbc9fde95a3e67d96846450f77ab58b175a55
2010-08-18 10:57:45 -07:00
Makoto Onuki a51097c1b8 Fix STOPSHIP: Show account name as subtitle.
Change-Id: Ie617ade795526c349f7a401115e6e04831096587
2010-07-22 17:22:42 -07:00
Makoto Onuki 8167070158 Refactoring MailboxListFragment
- Broke down bindActivityInfo into setCallback and openMailboxes()
- openMailboxes() can be called multiple times against the same instance.
  (We won't have to re-create the left pane on XL screen)
- Added EmptyCallback to avoid null checks
- Renamed a callback method

Change-Id: I3848a6f6da7f1782dcc9566967f8618ed79a878e
2010-07-22 11:22:37 -07:00
Makoto Onuki 7daacf83a4 Switch to ListFragment, and use its default layout.
Change-Id: If8dead170a3662cbde87e6ead244363b11db01f6
2010-07-09 13:22:53 -07:00
Andrew Stadler d5b2da3716 Add ActionBar to MailboxList
Note: This does not appear in UX wireframes, this activity is going
away eventually, but it's a good testbed for ActionBar to be tried out.

Open issues:
1.  Waiting for progress indicator support, using unattractive hack
2.  Subtitle doesn't seem to work so putting account name in title
    (which is the wrong font size for phone portrait mode).

Change-Id: Iee3cac7d4f30ea210bd8f3838b69ed12cd498375
2010-06-29 16:49:47 -07:00
Makoto Onuki 2aa8ea4399 Use Fragment's context menu API.
Change-Id: I1be6b17ff5bc7fd5258366bc064251c6f79c0cc8
2010-06-14 14:49:02 -07:00
Makoto Onuki 3f545a4060 Controller rework.
- Controller.Result is now a class rather than an interface,
  so subclasses don't have to implement empty methods.

- Replaced Threads with AsyncTasks, which is more light weighted
  because it uses pooled threads.

- Removed the Result argument from Controller's methods.
  These argumetns weren't used, except in serviceCheckMail.

  Regarding serviceCheckMail, the new code behave differenly from the old code.
  If there's already listeners registered when it's colled, they wouldn't get
  called in the old code, but they will in the new code.
  But I think this difference is okay because that's how it works for
  POP/IMAP accounts.

Change-Id: I37a857ce7c089c1a411cb7f1fcfcb72c9f5fd2a6
2010-06-07 16:33:44 -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
Makoto Onuki 4a2615e2a5 Remove Handlers from Activities.
AccountFolderList, MessageCompose and MailboxList.

Also,
- ControllerResultUiThreadWrapper now takes a Handler instead of an Activity.
  So that it can be used from a Service as well.

- ControllerResultUiThreadWrapper.getWrappee() to get the wrapped object.
  We'll eventually need this.

- I'll work on MessageList too, but the might be relatively
  large, so I'll do that in a separate CL

Change-Id: I281d88d5af1834248ec3f7463f0df3f5635149be
2010-06-02 16:47:18 -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
Andrew Stadler 5e354cd1db Exit most activities when accounts are deleted
This resolves cases like this:  You are in the inbox of an Exchange
account.  You click home, settings, accounts & sync, and you delete
the account.  Now re-enter the Email app.  You'll be left in a strangely
empty inbox, for an account that no longer exists.

* Set a flag any time the reconciler deletes an account
* Check that flag in onResume of any activity that depends on the account
    list and could be left in an "empty" state if account(s) are deleted.
* The Activities in which we check it are:
  * AccountFolderList
  * AccountSettings
  * MailboxList
  * MessageCompose
  * MessageList
  * MessageView
* Clear the flag any time we come in through Welcome, which will dispatch
    to other activities properly based on the number of accounts found.

Bug: 2563998
Change-Id: I00fc542581c2bed92d744a4c2e48a88f83737f11
2010-04-14 09:28:04 -07:00
Makoto Onuki 78e06eb894 Fix NPE caused by I34451000
It's unfortunate but some of the fields we cleared in I34451000 are accessed
in BG threads or after the activity is destroyed.  We could add != null checks
everywhere, but it'll be a mess.  I also think it's safer to simply remove
the "= null" lines.

On the other hand, clearing AsyncTasks are relatively safer because they are
kept only so that we can cancel them afterwards, so I kept them.  But let me
know if you want to revert the original CL.

Bug 2570603

Change-Id: I04a10dd7382bfcceb686c3e9af92f8949caf619e
2010-04-08 11:57:26 -07:00
Makoto Onuki 59cf1d05c1 Clear references to inner classes in onDestroy().
Also
- Made inner classes private if possible.
- Made some members final.

Bug 2570603

Change-Id: I34451000f2540c67e1039ea9dc4839dbec5ffab7
2010-04-07 11:54:57 -07:00
satok abed4c04c9 Close Cursor onDestroy
Bug:2557401
- set Cursor of ListAdapter null

Change-Id: I7d762c4ccdf6165d748136f5cf0e15b4a36b24a7
2010-04-02 20:08:17 +09:00
Mihai Preda b052885ea3 Email: husky title for MessageList & MailboxList.
Bug: 2419716
2010-02-11 17:59:00 +01:00
Marc Blank 37658316f9 Use a single account color resource table; add convenience methods
* The color chip resource table was duplicated in three files
* Move these into a common location in Email.java and add
  convenience method for retrieving color chip resource id based
  on accountId
* Simplifies future changes to account color selection
* Add RGB color information on these resources (provided by
  rfulcher) and add a convenience method for retrieving these

Change-Id: If1c2d22fba91cfce46a2618cd2b73cf7a534ce51
2010-02-08 09:21:54 -08:00
satok 0f4efcd483 Fix bugs rerated to updateMailboxRefreshTime
BUG: 2131243

- change the parameter updateMailboxRefreshTime in MailboxList
- add updateMailboxRefreshTime to MailboxList
2010-01-16 04:36:11 +09:00
satok fa368b50d6 Clean up appearance of unread counters
BUG: 2161746
2009-10-20 03:18:27 +09:00
satok 347a44af56 Fix the bug that the count of draft and trash icons are wrong.
BUG: 2159565

* Currently only the number of unread messages is shown.
* Fixed to show the number of all messages
2009-10-15 10:01:13 +09:00
Andrew Stadler d5e7afa1eb Remove obsolete resources & code
* FolderMessageList
* Fat title bar (remnants)
* Drawables

Bug # http://b/2071133
2009-10-11 22:09:39 -07:00
Mihai Preda 73032f4657 Email: exit AsyncTask.onPostExecute() if the result is null or isCancelled().
Bug: 2167479
2009-10-08 11:58:45 +02:00
Andrew Stadler 62b5a51b8f Use FLAG_ACTIVITY_CLEAR_TOP for list activities
This prevents these activities from ever repeating on the task stack.

Helps http://b/issue?id=2149204 (and may even fix it)

Change-Id: Idf8255b703094a78a2df3e9f535b67fd65faef32
2009-09-30 01:08:06 -07:00
Andrew Stadler 9312faea43 Restore lost connection error UI
We lost the reporting of connection errors in the UI.  These were
originally displayed in FolderMessageList, under the name of each folder.

In the new implementation, we borrow the "undo" banner from Gmail and
display it whenever there is a connection error in a mailbox.

* Add banner, and code to animate it on/off the top of the list.
* Toggle banner whenever a connection state change occurs in MessageList
* Toggle banner whenever a connection state change occurs in MailboxList
* Slight change to callback semantics for sendMailCallback
2009-09-18 15:31:37 -07:00
satok 3449b3184c Fix sort order of MailboxList
BUG: 2083746
2009-09-17 17:33:19 +09:00
Andrew Stadler 6c21942ec4 Implement move-to-trash for IMAP and POP3.
* Define new message-loaded state "FLAG_LOADED_DELETED" (used only for
   POP3, which needs to write sentinel messages that are not displayed.)
* Also renamed the other flags to make the naming more consistent.
* Tweak MessageList query generation to inhibit display of deleted
    message sentinels, and MessagingController won't try to resync them.
* Clean up implementation of Controller.deleteMessage()
* Add support for move to trash to MessagingController.  This operates
    in three primary modes:
  * POP3 local delete (no server-side interaction)
  * POP3 server delete
  * IMAP server delete (and copy to IMAP trash mailbox)
* Add missing implementation in provider to delete all of the attachments
    for a given message
* Fix progress reporting in activities (the test for error vs. progress
    was inverted, which caused progress indicators to keep spinning
    after errors.)
* Fix broken account settings UI (POP3 delete policy was not persisting)

Addresses bug 2097409

TODO delete from trash / empty trash

Change-Id: I00188e6dc2093823106e009f35b68c760227c9e6
2009-09-10 12:44:05 -07:00
satok 64814b3928 Update the design of Unread Count
BUG: 2065601

* Show Unread Count of Accounts in AccountFolderList
* Change the background according to the folder's type
* Change the style of unread counts

TODO: Change background images of Unread Count
2009-09-03 02:54:22 +09:00
Mihai Preda 285efb4aff Email: check for closed cursor in onPostExecute for AsyncTasks.
BUG 2081965
2009-08-28 02:05:31 +02:00
Andrew Stadler df86adf873 Finish the code to demand-load partially loaded messages.
This happens in two primary cases:
1.  When a very large POP message was skipped during initial sync
2.  When any message was interrupted during initial sync, e.g. by
    a dropped connection.

Changes:
* Added loadMessageForView and callbacks to Controller (and touched all
    files with Controller listeners)
* Rewrote loadMessageForView in legacy MessagingController to work with
    provider.
* Update flow in MessageView to use loadMessageForView when needed.
* Restored the use of "loading.html" and "empty.html" assets (although
    I think we should replace them with simple layouts & views.)
* Some random cleanup in MessageView

Satisfies bug # 2065563
2009-08-25 10:13:35 -07:00
satok 60a04912e0 Change all context menus
BUG: 2051086

* Add titles to all context menus
* Fix bug that prevented display of context menus in MessageList

TODO: localize special folder names
2009-08-25 22:14:28 +09:00
satok dadba99498 Localize special folder names
* make utility for looking up icon id for mailbox
* make utility for looking up localized name for mailbox

BUG: 2065586
2009-08-25 16:20:32 +09:00
satok 95993a4b84 Update Title bar to use custom titles
BUG: 2050630

* remove fat title bar
* show new titles by using custom title bar
2009-08-21 15:47:01 +09:00
Andrew Stadler 4b41bae270 Enable IMAP/POP sending and EAS resend
* Finish IMAP/POP sections of Controller.sendMessage
* Rewrite MessagingController.sendPendingMessagesSynchronous
* Add deleteAllAttachmentFiles to AttachmentProvider, and unit test
* Rework sendMessage callbacks and integrate into MessageList UI
* Send pending from UI

TODO:
* Find other places from which to call deleteAllAttachmentFiles
2009-08-20 11:09:39 -07:00
Andrew Stadler e346193f06 Add status item to bottom of message list.
* Add code to (optionally) add footer, update text & progress dynamically
* Add hook to dispatch various actions (refresh, load more, etc.)
* Some cleanup of the launch helpers for MessageList

TODO:
* controller handler for the "send messages" case (subsequent CL)
* controller handler for the "more messages" case (subsequent CL)
* reporting of send results etc. into the status line
2009-08-19 20:05:10 -07:00
Andrew Stadler 46d7d7f1b6 Rework service to use provider accounts and controller.
* Rewrite service logic to select and update one account at a time
* Add checkmail API to Controller, and much rework/cleanup of existing
   callback API's
* Rewrite notification posting code
* Rewire connection to MessageList to be opened by notifications, to
   cancel notifications, and to reset the "new message" count whenever
   an account is viewed.
* Boilerplate cleanup to a lot of activities because they share the
   callbacks that have had minor changes.
* Remove old push controls from Store API

In progress:
* To provide notification mechanism for EAS pushed mail
2009-08-18 00:54:34 -07:00
satok f827277419 Fix to show icon trash. 2009-08-18 11:20:59 +09:00
satok 55c390fe93 Use custom icons for special mailboxes
BUG: 2051100

TODO: Add trash icons
2009-08-17 19:56:25 +09:00
satok 73fa3562f2 do not merge: Merged CL 21093 from goog/master to goog/eclair 2009-08-17 15:08:38 +09:00
satok bbcb150dee Don't show mailboxes with flagVisible=0 See bug 1938449 for details. 2009-08-06 11:21:26 +09:00
Andrew Stadler 8f7f93a7b3 Enable account & mailbox sync for exchange
* Now attempts folder list sync for exchange
    (goto folder list and click sync)
* Folder sync never seems to call our callback - bug in EAS side?

* Now attempts mailbox sync
    (go to an EAS mailbox and click sync)

Also:
* Cleanup start/stop/error path for IMAP/POP as well
* Small bugfix in SyncManager.java (was calling wrong callback)
* No longer trying to set mailbox read/unread count in IMAP/POP
2009-07-30 18:48:12 -07:00