Commit Graph

70 Commits

Author SHA1 Message Date
Marc Blank 78684ccc79 Temporary search UI
Change-Id: Ia138ca93f0b28fd0915aa79c965f752f7c08ee90
2011-04-06 08:51:14 -07:00
Todd Kennedy ef844d86f1 Update method parameters
Only pass along the things we need. For the message dialog, we were passing
in an Activity that was not needed. In the ActivityHelper, we were passing
in an Activity when all we needed was a Context.

Change-Id: I9a93ae07ff2bbdce9466c7e991410c87fb610673
2011-04-01 11:57:52 -07:00
Makoto Onuki 26cfb38042 MessageList rework for phone.
Change-Id: I1cc86c0282f0f3cbe9b78ed97ab3fb8f8d1e7c0f
2011-03-31 14:28:46 -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
Makoto Onuki 4d4bb9a849 Fix auto-refresh of mailboxes.
Removed the ugly doAutoRefresh() and byExplicitUserAction.

The intention for these was to supress auto-refresh when the message list
opens without any explicit user action, e.g. due to screen rotation.

However, now that we have the RefreshManager.isMailboxStale check with 5
minutes duration, this check is not really necessary.  Let's just always
refresh mailbox if it's stale.

Bug 3493134

Change-Id: I6d0365ed7f8092304117d5f619d570b828edf76f
2011-02-28 15:08:08 -08:00
Makoto Onuki dd123f927a Reset fragment state when opening a new account/mailbox
Without this, there's a small window where a fragment is in a valid
state after openXxx() before the list is loaded.

Bug 3420361

Change-Id: I7f84a94dec1419762aa6b24188c023abe974d2bf
2011-02-22 15:24:53 -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
Todd Kennedy 6bbc689efc Implement final drag & drop spec
Current specification calls for the following:
* Droppable targets: do nothing
* Not droppable targets: grey text (hex #999999)
* Hover over droppable: use label/folder list pressed state
* Hover over not droppable: do nothing
* Destructive targets: background (hex #f10000)

We need to copy the resource from the framework as there is no supported way to
fetch the pressed state drawable during runtime. Adam filed bug 3370043 so we
can specify a drag target state directly in the selector.

bug 3154986

Change-Id: Ifd5c24a3dc46b5a1c64a149904657dda297ed047
2011-01-20 08:41:24 -08:00
Dianne Hackborn 31e2576791 Follow API changes.
Change-Id: I1ca0fe365b953fa98a462912309a1c9647277ba7
2011-01-17 16:24:00 -08:00
Christopher Tate ae7119524b API CHANGE: startDrag() now takes "int flags" instead of "boolean localOnly"
startDrag() that crosses application boundaries will remain @hide until we get
more of the surrounding behaviors nailed down.

Change-Id: I2db8206b26d606d5592f185702380b889c029b19
2011-01-11 17:53:57 -08:00
Todd Kennedy 07f5f60b8f Implement proper drag-n-drop
Still some tweaks to be done, but, we're real close to what it should
look like.

Bug 3322756
Change-Id: I8549ab59677a344e8f259c88bed950169d7381a8
2011-01-10 15:23:40 -08:00
Christopher Tate b50872abd0 Rename drag "thumbnail" to the drag "shadow"
No functional changes; just a rename of the relevant class/method/parameters.

Change-Id: I80c0297d0ccbf1bb30196fb919ae68194e18d732
2011-01-07 16:31:05 -08:00
Marc Blank cbdd9f78b2 Distinguish mailbox requests that are user requested
Bug: 3251757
Change-Id: Ie417ebf44c8b740db88e5854077782930359a958
2010-12-31 11:02:03 -08:00
Makoto Onuki e0f28d7853 Use swapCursor(null) instead of changeCursor(null)
The later closes the old cursor while the former doesn't.
LoaderManager takes care of closing cursors, so no need to close
cursors by ourselves.

Change-Id: Ib652e6877dcfc1fea51ffc862254eaeed451cdfa
2010-12-22 17:35:44 -08:00
Dianne Hackborn 0698f4027f Update to new Loader APIs.
Change-Id: Ic228f7b785f0d902a0188cfe995006b73b8a3c8b
2010-12-20 12:23:13 -08:00
Makoto Onuki 28d6e09575 Follow-up to the loader API change
This should fix the "attempt to re-open an already-closed object" exception
from SQLite.

(destroy()s don't have @Override becuase the base method is now depricated
and will be removed someday.)

Bug 3288666

Change-Id: I4780f6c8d89c7204b266608462c0833ad5af4e5f
2010-12-17 13:36:51 -08:00
Dianne Hackborn 80769cefb3 Prepare for some changes to LoaderManager/Loader.
Sorry it is a bit ugly, it is to allow this change to be
checked in prior to the first stage of the framework change
without breaking the build.

Change-Id: I1828579019ac0325d19c070a4c62cd79549e7d51
2010-12-16 13:20:39 -08:00
Christopher Tate 2219bd0043 Track drag/drop API change; no behavioral change
Change-Id: Id5a2e1aad453663f7b8baae7e5a1aab8209e0e74
2010-12-01 13:06:32 -08:00
Makoto Onuki 17d07ecdf7 Hide selection mode when message list is not visible.
...without clearing the selection.

Message list can be hidden on portrait.

Bug 3228718

Change-Id: Idc9eb3416e151ac0c2b851824fcee10b346d51c5
2010-11-30 14:54:04 -08:00
Makoto Onuki e2201949ba Don't show color chips when there's only one account
Bug 3225322

Change-Id: Idb299f54dc6f746e7d451a7a04fb971a432a869a
2010-11-24 10:47:04 -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
Marc Blank e857ff50ec Don't allow d&d move from boxes that don't support it
Bug: 3177021
Change-Id: Ib5cfcef05794d6f83884d97f2096f3d4f6b3295c
2010-11-09 12:21:34 -08:00
Marc Blank bad09c18d9 Correct drag & drop mechanics; implement multiple selection
* This CL brings drag&drop move in line with the current document
  describing its functionality in the Email app

Bug: 3135124

TODO: Assets and proper creation of the drag thumbnail based on
  those assets
TODO: Review long-press behavior re: press on subject vs sender

Change-Id: I6e1ee1a1f055feb041a0338f2f5c775a88620595
2010-11-04 17:13:55 -07:00
Makoto Onuki 138abe82e6 Make "Send all messages" a menu option
- Now it's a menu command rather than a button.
- Also string changed from "Send outgoing messages".

Bug 3166218

Change-Id: I82f6188365f9f6bc5a6d40fb23d774eebe181445
2010-11-04 16:53:18 -07:00
Makoto Onuki bbe25adfc8 Fix crashes related to readParcelable
We need to pass the actual class loader.  Passing null makes it use
the boot class loader, which can't find our classes.

Bug 3073304

Change-Id: I1c72c1d352cfc0a730aba1d83eb048a8cfa95b67
2010-11-01 13:47:53 -07:00
Makoto Onuki 9c293eb65a Show "No messages" when there's no items on message list
Show this when there's no messages, and no "Load more messages" footer.
i.e. Only Outbox, Drafts, and exchange mailboxes can show "No messages".

Also removed an obsolete comment.

Bug 2363624

Change-Id: If483d33cfacb186d0fe54b4f4382333a332be84c
2010-10-12 10:36:17 -07:00
Makoto Onuki 61eec98d39 Switch to static fragments
- Now we declare all fragments in the layouts.
- Added clearContent() to MessageList/MessageView to keep them calm when not
  used.  (e.g. MessageView.clearContent() will be called when closing message
  view and going back to the mailbox list+message list screen.)

- Some of the processes have moved from onStop to onPause.
- Now that we don't use the fragment transaction, the "restored fragments"
  has been removed, and the separation between selectXxx() methods and
  updateXxx() methods are gone.

Bug 3045555
Bug 3041502

Change-Id: I958897a8a38bccea1dfed7cfcd900e6dd52d2eed
2010-09-30 11:03:33 -07:00
Makoto Onuki 62c9df806e Two bug fixes related to preserving list scroll position
* When changing account/mailbox, reset scroll position.
Applied same change as I4b368f51 to MailboxListFragment.

Also fixed a bug introduced in the same CL.
When CursorLoader detects content changed events and reloads itself,
only onLoadFinished() gets called, and in this case we should keep the scroll
position.  This means mMailboxChanging should be cleared once data is loaded
for the next content changed reload.

Bug 3015916

* Don't try to make the selection visible when reloading the list for content
changed events.

We should make the selection visible only when account/mailbox is explicitly
selected.  We can use the same mXxxChanging flags for this.

Bug 3036317

Change-Id: I93e3653da6816f491c1e99c9ef6d6b947be4de37
2010-09-29 18:28:34 -07:00
Makoto Onuki dc33d50a24 Don't restore list view state when changing mailbox.
Bug 3015916

Change-Id: I4b368f511a94ec83723b571d1cfca1b3d39e4d04
2010-09-28 15:23:39 -07:00
Makoto Onuki 0824439785 Workaround for ListView bug related to smoothScrollToPosition
Hopefully it'll soon be fixed in the framework, but it's blocking what
I want to do now.

Bug 3028455

Change-Id: I43ed059b7766a3bfc29166464bd449d905b207e4
2010-09-24 13:05:55 -07:00
Makoto Onuki 2dbb510657 Hide bottom buttons when message list enters selection mode
Hide the command buttons at the bottom of the message view when the message
list enters the selection mode.

Change-Id: Id825bb5183673e9def055b6480fa180beab51178
2010-09-22 18:00:21 -07:00
Makoto Onuki c8fb75035f Implement latest selection mode behavior
On the message list,
- Longpress toggles selection.
- Tap opens message

Now it should be in line with gmail.

Change-Id: I1ce441a13fd9b41e3d7d10c2f2e4d43e580db708
2010-09-22 16:51:30 -07:00
Makoto Onuki 58843f0dc3 Highlight selected message on message list
Also make sure the highlighted mailbox is always visible on the mailbox list.

MessageListFragment now just uses the default background color, which means
it no longer changes background color for unread messages or checked messages.
This should be re-implemented if necessary with the newer wireframe.

Change-Id: I9bfbe9f0711ea4ab56be27778b00298d3033123b
2010-09-22 14:44:23 -07:00
Makoto Onuki 130c7bdec1 Fix "Sent outgoing messages"
sendPendingMessages() takes account IDs.  Don't pass mailbox IDs.

Bug 2985577

Change-Id: Id4abce6de67f55809aad9d4bd2aa6419b4530e3a
2010-09-15 16:49:36 -07:00
Makoto Onuki 261d6c3f0c Notify only account cursors when resetting new msg count
- Resetting the new message count is now correctly done on a BG thread.
- Added special content provider URI to reset the count.
  (/resetNewMessageCount)
- This URI only supports update, which will notify only account
  cursors.
- Fixed a problem that an insert with MAILBOX_ID/MESSAGE_ID/ACCOUNT_ID
  triggers two notifications.

- This CL changes how we use notification URIs, but unfortunately
  no tests for this part.  It turned out MockContentResolver doesn't
  support the notification mechanism, which made it very hard
  to write tests.

Bug 2911646

Change-Id: I35b30a7e6bf2d57510486c7ed19b9f263d8c9b58
2010-09-15 10:53:17 -07:00
Makoto Onuki fe7dd2df56 Enable "auto-refresh" for EAS accounts as well.
bug 2990997

Change-Id: Ia8481c806ee6f2e8d9308dacee67c982e1caaa69
2010-09-13 16:16:28 -07:00
Makoto Onuki 767f9fe2eb Implement batch move.
* UI is still temporary
* In this version, we check if the selected messages can be moved *after*
  you click "Move", rather than disabling the button beforehand.

Change-Id: Ief2864d2a513001847844963b2b0cb6b714e8667
2010-09-03 15:39:04 -07:00
Makoto Onuki a25aa613f7 Open MessageComponse when draft in All Starred is selected
Also removed a silly unnecessary code in Mailbox.isRefreshable.

Bug 2968445

Change-Id: I75187e5abf1c3e67c8b9ead38c7f749fc8b6cfb0
2010-09-01 18:27:12 -07:00
Makoto Onuki 3d78423281 Fix NPE in autoRefreshStaleMailbox
There was a silly logic error...

Bug 2967814

Change-Id: Ie92799be5a3d685cd9eb6a454457868ad0bbfffd
2010-09-01 10:59:41 -07:00
Makoto Onuki cadd46e3fb Preserve scroll position of message/mailbox list
* Preserve the scroll position in the following transitions
  MessageList -> MessageView -> [back] -> MessageList
  MessageList -> MessageView -> [screen rotation] -> [back] -> MessageList
  two-pane -> compose -> [discard, etc] -> two-pane
  two-pane -> switch to other app, and switch back -> two-pane

* Don't always refresh on onResume.  Do it only when requested.
  This supresses unnecessary refresh when coming back from other full-screen
  activities, e.g. MessageCompose.

* Also updated the comments on the back handling.

Bug 2769052

Change-Id: Id83dc3e778c35860d634c68ecac0c7a07cc4057e
2010-08-31 17:21:24 -07:00
Makoto Onuki e357f58791 Fully implement "refresh" action bar button
* Now it'll refresh mailbox list (left pane) as well.
(With the minimal interval of 30 seconds)

* Always refresh inbox.
(also with the minimal interval of 10 seconds)

* Also make sure the "auto-refresh" won't refresh
non-refreshable mailboxes. (drafts, etc)

Bug 2929889
Bug 2930018

Change-Id: I09452d40aad6008a721cfbc3f491617224d7048f
2010-08-31 16:49:12 -07:00
Makoto Onuki 01a5da7208 Update the list immediately after batch edit.
Batch edit (toggle star, toggle un/read) used to work like this:
- Update DB
- Cursors get content change event
- But the list won't update immediately, because ThrottlingCursorLoader
  postpones refresh.
- The list will update a few seconds later.

It wasn't really a good UX, so refresh the list right after the db change.

Change-Id: If483b305cf448ec4c73e65498044fd52cc144773
2010-08-30 15:02:04 -07:00
Makoto Onuki bdf84d57e6 Revive checkboxes to select messages on MessageList
It's basically a partial revert of I3cb6c45c, with some clean-ups.

Also removed mHandler, which was unused.

Bug 2949762

Change-Id: Ib4e673c5829b99ba45fec449bffb62df84555a01
2010-08-27 13:39:06 -07:00
Makoto Onuki 5247ab8cae Make isEasAccount always work.
isEasAccount now uses getProtocol(), so it works even if the hostauth
hasn't been restored yet.

Bug 2929896

Change-Id: Iee902c18ef59680d8a7d4622230489ec7946f38c
2010-08-24 14:27:10 -07:00
Makoto Onuki 7fd307212f Restore list scroll position when necessary.
Bug 2769052.

Change-Id: I09b04311ad2a5bd0d41d37f78dddc500414323c1
2010-08-24 11:20:00 -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
Makoto Onuki f52afae942 Make sure RefreshManager's callbacks are called on UI thread.
Fixed the bug where callbacks for sendPendingMessagesForAllAccounts
are called on a worker threaed.

Change-Id: I28f1424cf67e15abf37c09b68050d1385f9ac3ee
2010-08-18 14:49:46 -07:00
Makoto Onuki 715a19be28 Show "Send outgoing mesasges" button in outbox.
It works for regular outboxes.  Unfortunately it doesn't for
Combined Outbox, due to a bug in RefreshManager, which I'll fix
in a separate CL.  (The fix might be rather large.)

Change-Id: Ib904e2c672801debe3dd64e4bb0a464564d098da
2010-08-18 14:23:09 -07:00