Commit Graph

155 Commits

Author SHA1 Message Date
Mindy Pereira 87763f0ae8 Integrate chips into Email.
Change-Id: Ice037a55a169037f725a667fad7714c7e9580b86
2011-06-16 17:41:04 -07:00
Daisuke Miyakawa 3975a28918 Send email usage feedback to ContactsProvider
This enables the provider to count the number of contacted
per email address basis, which should improve auto-complete
quality.

Bug: 4371572
Change-Id: I4f0e586d3edff5a460e33dc7d9f9680119a8d568
2011-06-14 19:06:47 -07:00
Marc Blank f5418f1f93 Move Account into its own top-level class
Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
2011-06-13 15:37:22 -07:00
Jorge Lugo 15842c522e Fixed reply-all bug
Upon hitting reply all, all email addresses except that of the source message sender
go in the CC: field. Previously they all went in the TO: field. Updated 3 tests
in MessageComposeTests.java (testReplyAllAddresses1(), testReplyAllAddresses2(), and
testReplyAllAddresses3()) to reflect this new behavior.

Bug: 4534058
Change-Id: I852daebdd8843a45f685eecc67f757c87925bb6c
2011-06-03 10:16:05 -07:00
Makoto Onuki e50a6fb48b Workaround bug 4520517
To test bug 4490341

Change-Id: I93127a8ed1579184b0ae9c1fc0ce51bae7927f76
2011-06-01 13:18:36 -07:00
Ben Komalo fdfeb8d3c3 Prevent NPE in MessageCompose.
New actionBar code makes removeAllTabs() not safe when there are no
tabs.

Change-Id: I9ac09c71872c5f2aaad7b8e3cf5dbe0caac6f8ef
2011-05-26 11:14:05 -07:00
Makoto Onuki 3096b4ae18 Add Controller.deleteMessages(long[]) for batch delete
- Also removed the accoundId parameter, which wasn't used.
- Also cleaned up MailboxListFragment.onDrop.
  (the restored Message was only used to get the account id, but
   it's no longer needed.)

Bug 4384642

Change-Id: I8f6635011dae0529a82972617101e1c130090b76
2011-05-25 13:49:40 -07:00
Ben Komalo 53ea83ebf9 Move Mailbox to top level class.
No other changes made.

Change-Id: I3d8f3c521dc0d902be313b25252b4b6a4a96e7ee
2011-05-13 17:42:02 -07:00
Ben Komalo 626ad1929d Support switching compose modes for the phone.
Not styled according to the UI quite yet, but functional

Bug: 3117253
Change-Id: I707e0254d142a54cd6e396fce63ebb00ba66048e
2011-05-10 15:31:51 -07:00
Makoto Onuki 1d0bf81893 Merge "Add 1-pane UI controller" 2011-05-10 11:29:57 -07:00
Makoto Onuki f5492ea991 Add 1-pane UI controller
Added the base class for the UI controllers and the 1-pane implementaion,
which is almost empty at this point.

The old phone activities still exist and will be used on the phone by default.
To use the new activity (1-pane EmailActivity) on the phone, use the following
comamnd.

adb shell am start -a android.intent.action.MAIN \
    -d '"content://ui.email.android.com/view/mailbox"' \
    -e DEBUG_PANE_MODE 1

Change-Id: Id1fe85d4517778afc967d7d5e17e1299dd1bfefd
2011-05-10 11:28:00 -07:00
Ben Komalo 5b7e434917 Support switching between reply/replyall/forward
This introduces tab navigation on large screens with action bar (a
dropdown for the phone view is yet to be implemented, though the
internals are ready for it).

This requires the side effect that restoring a draft
reply/replyall/forward will attempt to also load the source message in
full for additional information. If that load fails for whatever reason,
the draft just remains a "compose" as it used to before.

Bug: 3117253
Change-Id: I9cff5ed4a5e9abd1338b6dbde28ceb3e4dc2b761
2011-05-10 10:36:22 -07:00
Ben Komalo 8d042850fb Re-work the way MessageCompose handles attachments
Now attachments are actually stored in an explicit list, instead of
being inferred from the state of the UI. This makes it possible to
switch states and restore attachments, and test.

Change-Id: I8c5f80f17f8c9e78d880ac4a1ac6ae22c2ec0579
2011-05-06 11:53:53 -07:00
Ben Komalo c6beaaea59 Update MessageComposetests with latest refactors
Change-Id: I7ab1275f4f4a803588619952f55fd81520036526
2011-05-04 16:34:32 -07:00
Ben Komalo c7c0b6791c Refactor MessageCompose.
This is a lot of code moves to make the asynchronous loading process
more explicit in nature:

- separate out code path for state restoration and intent resolving (no
  need to over-write mAction now)
- separate out code path for draft loading and source message
loading
- fixes an issue where loading a message accidentally set the draft
message instead of the source message
- makes it possible to switch reply/replyall/forward since now
processing a source message doesn't do crazy things

Bug: 4375775
Change-Id: I5b3a7ac9ed031abe88f9358df9cd46408dd1e9f9
2011-05-04 16:08:58 -07:00
Ben Komalo 2f9cbdb37d Cleanups to how "save draft" state is handled.
- the options menu was being needlessly invalidated way too often (on
every text change)

Change-Id: I36e6363fdecb7f587dc322a1413d074070ed8a36
2011-05-03 11:41:56 -07:00
Ben Komalo 0bb7f1c37c Fixes to MessageCompose saving.
- "save draft" no longer closes the message
- ensure consistent state if there are successive saves
- misc changes to the way a message is loaded if there is a pending save

Bug: 3072398
Change-Id: I9cd01319772293e4d410020ab27603821a95ec9f
2011-05-03 10:35:11 -07:00
Ben Komalo 256652050c Genericize UiUtilities.getView
Change-Id: I7142d4a57170e3074dc896149bf95ed6d2677bdd
2011-04-28 16:54:26 -07:00
Ben Komalo 6d75ae39f0 Expose cc/attachment actions on UI directly
This is a simple change to move +cc/bcc and +attachment action buttons
from the options menu to the visible UI (like honeycomb).

No attempt was made at styling the actual fields yet.

Change-Id: Ia1de8dbcf5e9ec9f7d3be3787cab657a2df72d70
2011-04-28 16:38:05 -07:00
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