Commit Graph

120 Commits

Author SHA1 Message Date
Todd Kennedy d8bce7e731 DO NOT MERGE Add original HTML message to forward/reply
When replying or fowarding an HTML message, we now send both plain text and
HTML bodies as a multi-part mime message. We take special care to ensure the
message bodies are in their own multi-part block and do not interfere with
any additional attachments to the message.

bug 3060920

Backport-Of: I2fc3cb4e1f65bcc28486a62731b44b0ee0a99719

Change-Id: I89ec2795b55ceb7472a8ee3db2dc8f50cf537d9c
2011-03-03 15:27:09 -08:00
Makoto Onuki a54d8bb4ee Compose: Fix bug where attachments can't be removed
If the account supports smart-forward.  The old code assumed
attachments are not removable if the account supports smart-forward,
which is not true.  Locally-added attachments should still be removable.

Bug 3505684

Change-Id: Ie6703551800c617dd224957a098311f0c279b3f1
2011-03-02 15:45:36 -08: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
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
Marc Blank 433d500cb9 Merge "Show smart forward attachments in MessageCompose" 2011-02-07 10:11:36 -08:00
Todd Kennedy 5e39f90e9d Resolve build warnings; part 4
Fix unchecked warnings

Change-Id: I872740fca4e5050e6ed2922eabc7e46e5e97ff3c
2011-02-03 12:44:24 -08:00
Marc Blank fe9db17831 Show smart forward attachments in MessageCompose
Bug: 3367188
Change-Id: I59dae9781be59eebe3a68769138e8253a24455e6
2011-01-27 10:13:25 -08:00
Todd Kennedy 6c5ee59c4f Add "tap to configure" text to widget
If there are no email accounts defined, the widget should show a single string
that allows the user to create a new account. Whenever there are changes to
the defined accounts, the widget(s) will update their headers to ensure they
are only displaying valid information.

bug 3296594

Change-Id: I156c20cfc90692174297a2aededd85775e0ea196
2011-01-26 17:58:51 -08:00
Makoto Onuki 3784b28aa6 Compose: Make sure to unhide CC if not empty for reply-all
Bug 3376821

Change-Id: Ieec04881843717fea55cec8efbf35757042c8d2a
2011-01-21 10:26:07 -08:00
Makoto Onuki 8ac207f298 Compose: Make the EditTexts easy to focus on
- Now tapping these To/Cc/Bcc/Subject labels moves the focus to
  the corresponding edittext.
- Tapping the bottom part of the screen moves the focus to the
  main EditText.
- Also use paddings instead of margins for the main EditText, to
  expand the hitarea.

Bug 3366831
Bug 3367100

Change-Id: I9b5d18dcc9d7802bfcbd0160befcb008c784d9f7
2011-01-19 13:36:21 -08:00
Makoto Onuki f29ce4d37b Don't pass ACCOUNT_ID_COMBINED_VIEW to message compose.
If you do so, MessageCompose won't be able to restore an account, so it'll
use null account...

Bug 3324472

Change-Id: Ic0e615b31e21246e41f6f2c709a8422bef230040
2011-01-07 14:57:05 -08:00
Makoto Onuki 7523930d39 Pixel perfect: message compose
Layout & action bar icons.  Now I think it's close enough.

Bug 3138037

Change-Id: I0802f34ac23980e0faf8a0daffc016a012816d81
2011-01-06 15:01:29 -08:00
Makoto Onuki 8686591aa8 Don't enable "save draft" when a draft is just opened.
The problem was that setIncludeQuotedText() always set mDraftNeedsSaving,
but it shouldn't be done when loading content.
(Do it only when it's toggled by the user.)

Bug 3162882

Change-Id: I6308376020f5be6d1a15b7865f8c7e02cf875eb9
2010-12-01 14:06:01 -08:00
Makoto Onuki d1ee5b8fa5 EML viewer: Set title, and show arrow next to the app icon
- Set "Viewing FILENAME" as title.
- Home icon now has "back" arrow.  Closes the activity when clicked.

Bug 3221312

Change-Id: I689499e10704d3c5d206df4aa12e21db9687c4c5
2010-12-01 11:35:09 -08:00
Makoto Onuki 9f04fdc555 Make home icon on action bar clickable
- Make the home icon on action bar clickable, and show the back arrow with it.
- When clicked, it'll navigate you back to the main screen.

Bug 3138037

Change-Id: Ice783e6b594347bd73b94e71d29a61ad4f5ef972
2010-11-18 16:54:00 -08:00
Makoto Onuki 15f46cc715 XL layout for message compose
The layout is not final, but it's closer to the wireframe.
- All dimensions and colors are not final.  I just made them up.
- The "+cc/bcc" and "add attachment" buttons are in the wrong position.

I'll wait for the pixel perfect before addressing them.

Bug 3138037

Change-Id: I72fc7557c28e72df08a3751c3c93acfb35749d68
2010-11-16 11:28:58 -08:00
Makoto Onuki 4977ce62f0 Small code change on MessageCompose
Change how we show/hide CC/BCC.  The new way will work for the tab UI too,
where we show the labels to these fields as well.

Also hide the "+Cc/Bcc" button when they're visible.

Bug 3138037
Bug 3192841

Change-Id: Ic78b3200c418430c8eade3ca1238b0d0f1ee4731
2010-11-12 16:19:26 -08:00
Makoto Onuki fd8ee7bc50 Show confirmation dialog before discarding drafts.
1. This CL implements the most common case, which is pressing the discard
  button on MessageCompose.

2. This CL doesn't change the discard on message list, which is much trickier.
   (We need to check the message type of all messages in the selection,
   as selection can contain any number of any kind of messges in "All Starred")

Bug 3072556

Change-Id: Ib270cae726f8fd5abf7e0e7dfc34ce97019d5301
2010-11-10 14:13:05 -08:00
Makoto Onuki 0e6254223a Reverse FLAG_INCLUDE_QUOTED_TEXT
To make it compatible with old databases.

(Follow-up to Ie7bcca23)

Bug 3162967

Change-Id: Ie3bbb5089900bb9dbd0834adbdd466fa009245f9
2010-11-04 16:30:03 -07:00
Makoto Onuki bf678771b7 UI change: MassageCompose
Basic changes for the new UI.  At this point we don't know what the new phone
UI will look like, so I didn't bother trying to preserve the old behavior on
the phone UI.  The changes will affect both the phone UI and the tablet UI.

- Send, Save Draft, and Discard are now action bar commands.
- Add CC/BCC and Add Attachment are now regular buttons.
- Activity title changed to "Compose"
- Some string changes per new wireframe

Further changes (actual layout changes for the latest wireframe) should be made
only for the xlarge layout.

Change-Id: I68c9c37dfdca6736b1e35053e7f196800fcfce2e
2010-11-04 15:22:25 -07:00
Andrew Stadler c50f912676 Inhibit "send" when user is a monkey.
While monkey is active, any clicks on "send" will be mapped to "save".
Drafts will pile up, but nothing will get out.

Bug: 2799956
Change-Id: I300d50001b43c8b61062143f9a0ac914aa2deaca
2010-11-02 16:14:19 -07: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 a76c9cdcc7 Fix reply/forward on EAS
When removing the original, need to clear FLAG_TYPE_REPLY and FLAG_TYPE_FORWARD
flags too.

Bug 3125167

Change-Id: I64be98bc10b5e1a0b9242c1c528ed96bb0a24fc1
2010-10-22 14:43:21 -07:00
Makoto Onuki 6a2265eff2 Add checkbox to include original text or not.
Added the "Include text" checkbox according to the latest mock.

Before:
- We removed original message when the user pressed X.

Now:
- We save the original message all the way till the draft is sent.
- The "Include text" check state is saved in the db.  (to Message.mFlags)

Bug 3072414

Change-Id: Ie7bcca23bb6a02d676700027b0b6cb94b6627236
2010-10-20 14:21:17 -07:00
Marc Blank 3bdba62f58 Don't duplicate attachments when saving drafts
Bug: 3070196
Change-Id: Ic9dffe57cdc81615e07b1c593fc71085e1281718
2010-10-20 13:03:33 -07:00
Dmitri Plotnikov 9d74207039 Integration with Directory API for autocomplete
The UI changes a bit - there is no separator
between the local contacts and directories.
Will bring the separator back if asked, but
most likely simply as a thick line.

Change-Id: Idfc990deff41b30d63bd8289731694e3d9a00fb6
2010-08-27 14:02:06 -07:00
Andrew Stadler 9e71be599e am 99df4d53: am b47d1a8a: am 126c9216: Block oversize attachments from being sent
Merge commit '99df4d53b620fae871fd45aaf9b8f110cb4d4288'

* commit '99df4d53b620fae871fd45aaf9b8f110cb4d4288':
  Block oversize attachments from being sent
2010-08-27 12:15:15 -07:00
Makoto Onuki 2f4e87c223 Switch to Light Holo theme, clean up menu options.
- Changed the default theme to Light.Holo
- MessageCompose now has ActionBar.
- Removed unnecessary MessageCompose menu items.

- Also removed "Add Account" menu from MessageListXL.
  (Use the + button on account settings)

- Fixed "calender response section invisible" bug.

Bug 2926517

Change-Id: Id27632ec82dad158f43b0903dbc2cb219188400d
2010-08-25 17:09:59 -07:00
Andrew Stadler 126c9216b1 Block oversize attachments from being sent
* Attachments that come in with a file:// URI do not support the complete
  set of OpenableColumns columns.  To handle this better:
  1. Obtain the openable values in two separate queries, in case one or
      the other is supported (but not both).
  2. If the size is not reported but it is a file:// URI, attempt to
     measure it directly.
  3. If the size cannot be obtained, do not upload the attachment

Bug: 2948965
Change-Id: Ic5160d39efd65eaca40ceba0dd93c3b035d2871e
2010-08-25 16:46:00 -07:00
Marc Blank 5fd986fca0 Fix problem w/ forwarding already loaded attachments
Bug: 2938562
Change-Id: I778623bf5ee56d25eab5a74d86e9f89206e7f348
2010-08-24 16:20:47 -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
Marc Blank 09fd4d0a18 New asynchronous attachment loading code
* Create AttachmentDownloadService to manage all attachment downloads
  1) User requested
  2) Required for email forwarding
  3) Opportunistic downloads to enhance offline use
* New attachment related UI (pending UX approval, of course)
  1) MessageView (attachment actions, progress bar, etc.)
  2) MessageCompose (attachments for forwarded messages)
  3) Associated toasts, notifications, etc.

TODO:
* Unit tests
* Cache Management (separate CL)

Change-Id: I7864a5fb1c3f4f2be68d98341a971edc6cbacfe1
2010-08-19 14:01:08 -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
Marc Blank ec29471c73 Make sure signature is added to reply/forward
* Add this to processSourceMessage in the reply/forward cases
* Add unit tests for reply and forward case

Bug: 2734321
Change-Id: I6be8383fe5f217a4bda8e669cb69f439bc8e96b6
2010-07-14 12:43:37 -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
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 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
Andrew Stadler 26b4b47fb3 GAL UI cleanup work (in progress)
Provider:
  * Move UI (e.g. separator) out of provider, create it entirely in adapter
  * Remove timestamp based disambiguation (TODO throttling some other way)
  * Add cursor "extras" to report total # of results on server
UI:
  * Rewrite background-foreground threading to be more efficient and
    signal changes back to UI by calling notifyDataSetChanged())
  * Separator strings per Rich's UI (not using real strings yet)
  * Remove link back to AutoCompleteTextView

NOTE:  There's a bug in ACTV that is causing the window size not to
change properly on notifyDataSetChanged().  Framework team to investigate.

Bug: 2249514
Change-Id: I183b200dcdaa268f0612d2de6442db28e1491d40
2010-03-15 19:17:03 -07:00
Andrew Stadler e2c56fc88c GAL support
* Provides GAL autocomplete in email address fields in message composition.

General TODO list:
UI: Implement divider in adapter, not in GAL provider
UI: Use listview_separator for divider
UI: Clean up strings, move all to resources
UI: Only have one GAL lookup in flight at any time
UI: Unit tests

GAL: Use side channel for status, not a row
GAL: Shorten timeout for interactive GAL lookup
GAL: Make watchdogs work
GAL: Figure out why some calls never return (conn pool exhaustion?)
GAL: Unit tests

Bug: 2249514
Change-Id: I513e25628bc2f5ed0920e0ee509cd598b1817b3a
2010-03-15 11:12:34 -07:00
Mihai Preda c556b6bfe5 MessageCompose: when loading message, wait for save to finish.
Bug 2465675

Change-Id: I3290c676bbe63db8441a8f6d320d798abc2fcde5
2010-03-07 15:52:28 +01:00
Mihai Preda 1575e7860d MessageCompose: fix delete quoted on reply/forward for EAS.
Also fix display of quoted html text for a draft (Exchange 2007).

Bug 2363249
Bug 2444496
2010-02-17 15:28:25 +01:00
satok 2a41aa538f Add Signature to Email Composer
Bug: 1323618

- Add signature to the message
- Set selection just after the message
- Add tests for signature
2010-02-14 00:41:48 +09:00
Mihai Preda e3e65ed919 MessageCompose: properly remove quoted text from saved draft.
Bug 2363249.
2010-01-26 17:19:49 +01:00
Mihai Preda f9623b9e78 MessageCompose: show account name in title.
Bug 2338152.
2010-01-21 14:47:18 +01:00
Mihai Preda 55f5256761 MessageCompose: fix NPE cased by WebView set to null in onDestroy().
Bug 2329276.
2009-12-16 18:12:34 +01:00
Mihai Preda 3afd66cda8 MessageCompose: disable "save as draft" button logic.
Bug 2184404
Disable "save as draft" button when there are no changes to be saved.
2009-10-15 12:09:38 +02:00