Commit Graph

136 Commits

Author SHA1 Message Date
Ben Komalo 28b3fec5c1 Include guava in Email.
- adds a compile time dependency to the guava library
- changes to use @VisibleForTesting in places to ensure it works

Change-Id: I2c5c4f9861234fec3613da011185e5c11f228466
2011-04-14 13:49:01 -07:00
Ben Komalo 0fb68c8f0c Add signature when starting from external intents.
Also update some of the tests.

Bug: 3122070
Change-Id: Ia0e4620f54279dc53ca1c4484fec6508c411b418
2011-04-12 18:10:05 -07:00
Ben Komalo 7dc1e86d91 Less aggressive selection change in msg content.
All focus changes to the message body content was pushing the selection
to the end, which is wrong if state restoration happens, and is just
non-standard behavior if the user explicitly taps on a particular spot
on the text view. Make this slightly less aggressive.

Misc other changes in compose view.

Bug: 3076256
Change-Id: I9edb9c3c4edb5ddec12207f4136f3ca73cabf89d
2011-04-12 09:23:40 -07:00
Makoto Onuki 2d380e4504 Clean up MessageCompose for phone
- +cc/bcc and "add attachment" are now menu options.
- layout clean up
- switch to getView()

Change-Id: I5efb6d0fd7b6d1265fed0173463adce2c6d652ba
2011-04-01 15:37:10 -07:00
Makoto Onuki 2fbb3db5d8 Don't use findViewById (part 1 -- account setup)
Added two new functions:
- UiUtilities.getView()
  is a fail-fast version of findViewById().  Crashes when there's no view
- setVisibilitySafe()
  same as View.setVisibility, but doesn't crash even if a view doesn't exist

Let's try to avoid the use of findViewById(), and instead use getView(), *right
after* the layout is inflated, so that we'll always fail-fast if a layout
doesn't have a required view.  (Rather than getting a NPE only when the view
is really accessed, which can be in a code path which is rarely executed--e.g.
only when there's a protocol error.)

Let's only use findViewById() only when we're sure no all the variants of a
layout have the view in question and leave a comment to make it clear it's on
purpose.

(UiUtilities has been moved from com.android.email to
com.android.email.activity)

Change-Id: I36e0bab65a989f5d34cf636f13e1eaee084547af
2011-03-30 13:47:13 -07:00
Makoto Onuki ae72ec88ce Compose: Set focus to the To field by default
We initialize the focus with setNewMessageFocus(), but it's only called
from processSourceMessage() (for EDIT_DRAFT) initFromIntent() (for other
actions, except for "new draft").  We didn't intialize the focus for new
drafts.  Let's just get the To field to get the focus by default to
cover this case.

Bug 4048238

Change-Id: I50cd69b8813198c96beab2025576d390520dc6a4
2011-03-22 11:43:12 -07:00
Makoto Onuki d72f7bdf11 Improve EmailAsyncTask
Added 6 methods:
- execute{Parallel,Serial}
- cancelPreviousAndExecute{Parallel,Serial}
- runAsyncParallel{Parallel,Serial} (replacement for Utility.runAsync)

Bug 4083415

Change-Id: I5ca33000e52fc5265ccc84a6e5acb0d3359d0eb4
2011-03-21 16:41:08 -07:00
Marc Blank 225a3ea0b6 am 70e99aa9: Merge "Fix download of non-smart-forwarded attachments" into honeycomb-mr1
* commit '70e99aa97f027f9a7dd19e28f978258025f7d9ed':
  Fix download of non-smart-forwarded attachments
2011-03-09 16:17:33 -08:00
Marc Blank 70e99aa97f Merge "Fix download of non-smart-forwarded attachments" into honeycomb-mr1 2011-03-09 16:12:10 -08:00
Marc Blank 308ecfcc7e Fix download of non-smart-forwarded attachments
Bug: 3506114
Change-Id: Id3166402b0922eb1774ff484de249391fcc5e17c
2011-03-09 14:34:24 -08:00
Todd Kennedy 0c149eef41 am ccc0e10b: Merge "Only delete attachments from drafts" into honeycomb-mr1
* commit 'ccc0e10bc7b62e38aa0c329e69941bcda9b338e4':
  Only delete attachments from drafts
2011-03-08 11:04:29 -08:00
Todd Kennedy ccc0e10bc7 Merge "Only delete attachments from drafts" into honeycomb-mr1 2011-03-08 10:59:23 -08:00
Todd Kennedy a94804c49e Only delete attachments from drafts
We should only be deleting attachments from draft messages and not all
messages.

bug 3489176

Change-Id: Ia1bd2894f3aabc1bfbfb36e2f5c486b47d6edf4f
2011-03-08 10:32:32 -08:00
Makoto Onuki 7a15938763 DO NOT MERGE: Make ACTION_SEND_MULTIPLE work with file: URI
To determine mime-types of attachments from the ACTION_SEND and _MULTIPLE intents,
- Use ContentResolver.getType() for content: URIs
- Use inferMimeType() for file: URIs

Tested with Gallary and Downloads.

Bug 3510624

Backport of Ibfa4b383463f157e18fd634e55f5be4b9adf6aa5

Change-Id: Id2815738673f3822a97e92414b84f6a5d46eb96f
2011-03-07 10:46:09 -08:00
Makoto Onuki 92cbc9369b Make ACTION_SEND_MULTIPLE work with file: URI
To determine mime-types of attachments from the ACTION_SEND and _MULTIPLE intents,
- Use ContentResolver.getType() for content: URIs
- Use inferMimeType() for file: URIs

Tested with Gallary and Downloads.

Bug 3510624

Change-Id: Ibfa4b383463f157e18fd634e55f5be4b9adf6aa5
2011-03-07 10:32:16 -08:00
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
Todd Kennedy 9cc51b72c6 Attach original HTML message on 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

Change-Id: I2fc3cb4e1f65bcc28486a62731b44b0ee0a99719
2011-03-03 14:37:03 -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