Commit Graph

149 Commits

Author SHA1 Message Date
Mindy Pereira d6decef1d2 Make search interaction match gmail.
shows results list in portrait on tablet.
shows split in landscape on portrait.

Since email currently has no concept of saving the currently
selected message on orientation changes, there are some issues changing orientation
and restoring to the correct search state.

fixes coming in the next cl.
Change-Id: Ib0b98c4018c2ae0fabc2c78dfce4d3a197837d4f
2012-05-01 11:11:01 -07:00
Mindy Pereira e0e0defb1e Update 2 pane menus for email.
Change-Id: I8733e9679674195d881ee6decb7a3ebab075ad53
2012-04-30 13:05:02 -07:00
Marc Blank 03cd72805d Revert to old Email app
* These are the last sources in the ICS-MR1 tree

Change-Id: Ida4651bddd92a06a518d00f3e1f275ab3a80c8ae
2012-04-25 13:58:23 -07:00
Marc Blank 9a5e2a798e Fix clearing of mailbox notifications
Change-Id: Ieb98a8908ec067229dd449790da55085585ef17b
2012-02-26 12:52:57 -08:00
Marc Blank bf5caf97c5 Notify by mailbox, rather than account
* Update EmailProvider, removing two no-longer-used columns in Account and
  Mailbox

Change-Id: Ie0f10eb0ca315d73e82be968f7760a51a239ba3f
2012-02-24 14:51:59 -08:00
Mindy Pereira 9eeb535f6f Merge "Make message items aware of the various modes." into ics-mr1 2011-11-18 12:05:39 -08:00
Mindy Pereira e4202e782c Make message items aware of the various modes.
On two pane tablet in portrait mode, the message list items may not
be wide enough to be considered "WIDE_MODE", however, when they are shown
in the message list mode, they should ALWAYS use message list mode backgrounds.

Fixes b/5641014 email portrait: missing the vertical divider between folders and messages

Change-Id: Ied05386f1ab62c48b1824647c95a6f72baabc859
2011-11-18 09:26:49 -08:00
Mindy Pereira bed1b4fa7a Highlight the first result for search.
Fixes b/5614128 Email doesn't auto display first search result after result list appears

Change-Id: I1843471bc3fe018151ed2a30ceb3e19eb2af24e9
2011-11-14 13:30:35 -08:00
Ben Komalo a007d79c3f Fix NPE in move messages
Bug: 5452020
Change-Id: Id8fca21692ad1a70a2114eaa7fec6bcecab6cab6
2011-10-16 18:13:38 -07:00
Ben Komalo 513486cfb5 Fix per account starred mailboxes.
We always switched to combined view when we tapped "Starred" in a
mailbox list. This was confusing since tapping to show the mailbox list
will take you to the mailbox list for the combined view, even if there's
only one account on the device! Other confusing things happened like
showing coloured account chips, even if there's only one account.

This fixes it so that we pass the account ID when building the
selection. Lots of wiring to make it happen, but very little change
overall.

Bug: 5388326
Change-Id: I1fe52f211cceca0c1b26581e200f3c7adcd0734a
2011-10-12 19:44:39 -07:00
Marc Blank d9cdd88702 Don't show "mailbox not found" toast on "back"
* We'll only show this on a first load of the
  MessageListFragment

Bug: 5396997
Change-Id: I9a93bfd6e2c31d1ed8f75f1ec486da060712dffd
2011-10-11 12:04:11 -07:00
Ben Komalo f9b566c109 Fix message list pressed state color
Also do some cleanup - we were creating a background task for opening a
message, when in the common case we don't need to hit disk for any
reason. This was also an issue since the async opening of the message
caused the list item to go into an "active" state, changing its colour
(this problem still exists in starred view now, though)

Bug: 5222509
Change-Id: Ie94109df42406fd6eec1e1255bb0827626ba0628
2011-10-06 16:35:04 -07:00
Ben Komalo 5aedd25869 Always update adapter's cursor.
In cases where the account gets removed, we accidentally hold a stale
cursor. This leaves a ticking bomb, which generally explodes when the
list tries to save state.

Bug: 5367199
Change-Id: Ibcd0c281c9668778f7d1d2abba472ffff8b22879
2011-10-03 13:53:24 -07:00
Marc Blank b9b6ce1d36 Don't show -1 as a search result count
* We'll show zero in this case

Bug: 5361745
Change-Id: Id969fa9895520382de11a47a302792d3431e451c
2011-09-23 11:19:47 -07:00
Ben Komalo 075817ff68 Try to avoid cases when we flicker "No messages"
Bug: 5205196
Change-Id: Ide4b9ebc02c294ee3c031cc0b69ecba32877e2eb
2011-09-21 15:03:41 -07:00
Ben Komalo 8466f79a06 Asset drop.
- this syncs up the UX repo with the developer repo so that the assets
now match. We should be able to do wholesale drops/diffs from now on.
- lots of changes to widget so that it is (mostly) up to spec now, and
matches the preview

Bug: 5225385
Bug: 5205578
Bug: 4320895
Change-Id: I8ccbadcfc17cdb406599497edc91165809f55d68
2011-08-30 12:57:38 -07:00
Ben Komalo 3f1a171f0b Prevent NPE when arg cache is not init
Bug: 5146630
Change-Id: I5d90f4c915f1cbb437be88849e179efd29a4b9a9
2011-08-10 10:27:12 -07:00
Ben Komalo 2c4a6855ba Make isInboxList check robust to combined views.
rookie mistake :(

Bug: 5141774
Change-Id: Iafc4907a4717143ccf8251a1fb452e1ff00aa5ff
2011-08-09 10:44:43 -07:00
Ben Komalo e91ff527ed Update backstack model.
This makes "Inbox" the top level with the mailbox list one level under.
All "up"/"back" navigation is now identical and will take you upwards
towards the inbox before falling off to the launcher.

This uses a kludge and the "backstack" of the activity is not actually
represented now by the mPreviousFragment variable; it just uses tricker
in the onBackPressed()/shouldPopFromBackStack() calls to do the right
thing.

Bug: 5111629
Change-Id: Ide88efc78fe4f40d89b5ab83c480318e81902554
2011-08-08 17:38:21 -07:00
Ben Komalo 37a7469716 Hide sync options and search icon when appropriate
- hide sync options for mailboxes that aren't actually syncable
- hide search icon for any mailboxes that don't have any server
counterparts

Bug: 5086134
Change-Id: I60d5e5d1225a946464c5ea273c7d4b9299f433e5
2011-08-07 15:40:12 -07:00
Ben Komalo 5497cae94c Fix issues with state restoration in messagelist
- immediate issue was the the mIsFirstLoad flag was on the Loader
instead of the list - since the Loader is retained on rotation, we
didn't the initial list setup after rotation leaving the list in an
infinite "loading" state
- second issue was that list scroll state was being handled poorly - it
was always saved and restored needlessly. However, if two subsequent
loads happened prior to a layout, saving the list state actually saved
bad values (the restored state only seems to take effect after layout)
- third issue was the footer mode was being handled poorly as well - it
was always updated, which required re-setting the adapter every time,
which reset the scroll position. This was why we were always trying to
save/restore scroll position.

Overall this should speed up the list loading and data updates in the
list by a bunch.

Bug: 5110000
Change-Id: Id2f6db928c095ae10ee55b40e7e9241d70e0bebe
2011-08-03 11:23:15 -07:00
Ben Komalo 391b9d4abd Search delay fixes.
- adds a loading state to search so the user isn't left with a blank
screen for several seconds
- adds a timeout so that a warning message is shown for results that
take over 10 seconds
- use default loading/no message views in ListFragment so we don't have
to manager our own stuff

Bug: 5014107
Bug: 5037618
Change-Id: I8b03fa0967055989156c7777901affc777c4fae7
2011-07-27 11:37:54 -07:00
Ben Komalo 5fb6c5d4de Don't touch the cursor in the background
This prevents accessing a potentially closed cursor when doing batch
operations that will inevitable cause the the list to be reloaded (and
cursor to be invalidated) as the first of the messages are
touched

Bug: 5051730
Change-Id: I90328ee02eafe6ad238d8c57e88a3d96259f6547
2011-07-21 19:41:07 -07:00
Ben Komalo 80b817714f Optimizations to startup.
- don't inflate search views - inflate them on demand
- kill some unneeded containers

Bug: 4996847
Change-Id: I7747e194e7c0939ad6416f351096639b283f4899
2011-07-21 17:38:19 -07:00
Ben Komalo 81a153463b Remove "Move" action on POP.
Bug: 5010614
Change-Id: If0a94840e9dc104566ba39d2e3240883dab5bba0
2011-07-20 13:21:06 -07:00
Ben Komalo 1ef8ec61c9 Misc STOPSHIP cleanups.
Apply the same logic to mailboxnotfound for two pane.
also remove some obsolete callbacks.

Change-Id: I942c2b557fce2601a0e46878cfe4d5ce2cc83850
2011-07-19 17:51:36 -07:00
Marc Blank 1d0609d386 Don't allow actions on empty sets
* Not sure how this could have happened, except possibly for some
  race condition
* Let's make sure it's impossible

Bug: 5032454
Change-Id: Ibd4de22dc5298fbaaf224cf4286f63bdc50aa7b9
2011-07-17 17:25:38 -07:00
Marc Blank b81a31b29b Handle message sets in a single EmailAsyncTask
* This prevents the possibility of RejectedExecutionException when
  selecting large numbers of items

Change-Id: I8f9ba287d69021fdb99b4a8a30cc79755f669b97
2011-07-16 16:11:00 -07:00
Ben Komalo cbfbe1db2d Toggle selection on list item on long press
Bug: 5020642
Change-Id: I31498122a4fe41cc81e5dbad5550a5e6620924c4
2011-07-15 14:49:26 -07:00
Ben Komalo 33d6307d4b Prevent wasteful calls to invalidateOptionsMenu
The app is spending a lot of time in startup inflating XML. I suspect a
lot of it is due to the refreshActionBar() calls.

On a normal startup with NO refresh, the action bar was rebuilt 6 times.
If a refresh happens, the refresh callbacks get called in rapid
succession (20+ successive calls is not uncommon), which seemed really
wasteful.

Change-Id: I05feb56ba7fafb109d820328f591526945ca0a5f
2011-07-06 11:19:40 -04:00
Ben Komalo 659f60f734 Wire through logic for searched mailbox
- update hint based on the mailbox being searched
- ensure that we use the original searched mailbox as the mailbox to
search for subsequent search (i.e. a search while we're viewing search
results) and not the search mailbox

Change-Id: Ic8663272173ce386dcd13fdf0369e918fb895be8
2011-06-29 14:09:14 -07:00
Makoto Onuki 50d934360d Fix the "onPostExecute executed even when cancelled" issue
Renamed onPostExecute to onSuccess and made sure it won't called
if a task is cancelled in time.

Also removed isCancelled().  To implement it right we should make sure
that onPostExecute() isn't finished when setting mCancelled, but it's a bit
of a pain to implement right, and we don't really have to use it.

Change-Id: I3a0baf504506ffc4952a5553f7098a8415842fa3
2011-06-29 10:22:38 -07:00
Makoto Onuki 4a893e60b4 Switch to EmailAsyncTask
Also remove the isCancelled test in onPostExecute, where it should
never return true.

Change-Id: Ica2b07db22d73769c2ead5f232f4890bd3bb87da
2011-06-29 09:50:52 -07:00
Ben Komalo 1f6acaf396 Hide footer when we hit the end of a search
Change-Id: Iec082a9f9560819c034f91706229b1efb7303ba2
2011-06-28 17:24:54 -07:00
Ben Komalo 6b256f1fa1 Wire through results count in search header.
Change-Id: I817236d9c3294acb25b62724cc8c99d47df7f354
2011-06-28 17:11:16 -07:00
Ben Komalo 9b4f11a4ed Show a search results header.
The count will be wired in and shown in here.

Change-Id: I2f496dcd86d748ee1c17c8e819b65c61c098a8ba
2011-06-27 19:59:23 -07:00
Ben Komalo 37c8a70d64 Introduce a SearchCursorLoader
This loader will abstract away the waiting for the controller to cleanup
the existing contents of the search mailbox

After some additional, to-be-done plumbing, I'd like
Controller.searchMessages to return some results info (like # of results
at the least) so that the SearchCursor returned can relay that
information to the client (which can then do a lot more interesting
things at that point).

Change-Id: Ifcba0ddf7170c56dac9f3b44128988a5aa4ca887
2011-06-27 15:43:21 -07:00
Marc Blank bad39b2e00 Clean up search handling in Controller
* Use same code for handling search mailbox for IMAP and EAS
* Allow "Load More" for EAS search mailbox

Change-Id: Id4a009c79a95302d627ff25f85e9c65bc461826f
2011-06-24 17:03:27 -07:00
Ben Komalo bcdcc0458f Pass the entire list context to the listfragment
This allows us to read search properties and other things to determine
rendering state

Change-Id: If73269128a60e9992822774ebdba3d90a44d2d76
2011-06-23 13:32:24 -07:00
Marc Blank f5418f1f93 Move Account into its own top-level class
Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
2011-06-13 15:37:22 -07:00
Makoto Onuki ab2dba417a Message list: Hide CAB when in back stack.
Because isViewCreated() is used by updateSelectionMode() which is called from
onDestroyView(), we can't use getView() to determine if the CAB should be
shown.

Change-Id: I8d868998031115800766000fb0128f1d1d3541cd
2011-06-07 18:23:47 -07:00
Makoto Onuki ab40c98821 More work on fragment install/uninstall.
- Now we "uninstall" a fragment in Fragment.onDestroyView.
  i.e. a fragment transaction is actually executed.
- Maintain our own "about to be removed" fragment list to avoid
  double removal of a fragment.

Change-Id: I61328e0a09a7af00cbb0e6ba10a2d39c11b5c3dc
2011-06-07 11:13:37 -07:00
Makoto Onuki cb530b4e91 Merge "Use the CursorWithExtras pattern for the message list." 2011-06-07 11:12:31 -07:00
Makoto Onuki 41878c2813 Use the CursorWithExtras pattern for the message list.
This will make the message list a lot snappier.

We were using two different loaders for the message list; one is to load
the meta information and the other to load the actual message list.

Unify them using the CursorWithExtras pattern.

Change-Id: I02957bbca1b1fb74ca6eca14ad2535dfdbf03a5a
2011-06-06 16:34:03 -07:00
Makoto Onuki 345a61d0b9 Manually restore list view state.
Bug 4532222

Change-Id: I6f3394b7ffd55b32e1932e3e425cc0d0ae720e27
2011-06-06 16:13:16 -07:00
Makoto Onuki 296d7d3614 Make message list behave nicely when it's in back stack
- Hide CAB when it has no views.
- Stop pending tasks and refresh callbacks when it's paused.

Change-Id: Idaae9061237ce9f923c002d659e8e12407e4bad1
2011-06-06 10:39:05 -07:00
Makoto Onuki 3d9b8e76f0 Implement 1-pane navigation.
- Now that fragment useage is simplified (e.g. no new fragment
creation for nested mailbox navigation), most of the fragment
operation code for 2-pane is reuseable for 1-pane as well,
so moeved it to the base class.

- Temporarily added "Show all folders" as a menu option on 1-pane.

- Added "opener account id/mailbox id" to the message view fragment.
They are not used by the fragment itself, but they're used
by the UI controller for the back navigation.  (And now the UI
controller doesn't maintain the current IDs by itself; rather
it gets them from the currently-active fragment.)

- Use async fragment transaction on 1-pane too, now that it always
gets the current state from the active fragment.

- Changed the timing when we install fragments from onAttachFragment
to fragments' onActivityCreated.  So now all installed fragments are
created.

TODO Now that all installed fragments are guaranteed to be created,
remove all special trealment for the fragment argument accessor.
(They were meant be safe to call before onCreate, but it's not
necessary any more.)

Change-Id: I0ed100c3f0b460835b164c0dc908ea483a4e46ee
2011-06-03 13:59:50 -07:00
Makoto Onuki c7024f73ec Switch to async fragment transaction for two-pane
One-pane will follow too, but not soon.

Change-Id: Ie018f728273e9fa4a7e6cf3116a2a2afebcaecc5
2011-06-01 18:11:12 -07:00
Todd Kennedy 6d4f0d8fa0 Merge "Make it clear that args are immutable" 2011-05-26 16:51:10 -07:00
Todd Kennedy 90e08781ca Make it clear that args are immutable
Change-Id: I54657648fc7fcd145689a51acd8f3c27d3611a97
2011-05-26 16:45:33 -07:00