Commit Graph

24 Commits

Author SHA1 Message Date
Scott Kennedy 7fdde9bb4a Cache column name/indexes so we can use getColumnIndex()
MatrixCursor doesn't do this, so we need to add our own cache.

Depends on Ia5ffd31f54a2a335f495df5e0d1a0886ee08c14b

Change-Id: Ica78e3cec747bf86fcef16508156e359216c64fe
2013-02-06 17:09:42 -08:00
Marc Blank f419287f22 DO NOT MERGE: Move emailcommon2 sources to emailcommon
Change-Id: I06df7e467cd2e0117df8b8db3ddc6ff9da13f1c7
2012-06-28 11:15:06 -07:00
Ben Komalo 3cfb3d5077 Remove dead code
Change-Id: I66bec3975b3f028081071b9bbd26206ec369da26
2011-07-12 20:42:16 -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 844bf74504 MailboxListFragment: In-place nested mailbox navigation
Now we reuse the same instance of the fragment for nested mailbox
navigation.  (Don't use fragment transaction)

"CursorWithExtras" now only has the child count, so I removed the
bundle version and added a concrete class to MailboxFragmentAdapter.

With this CL the nested mailbox navigation on 1-pane should work, but
not back navigation.  (Back press event isn't connected to the
fragment yet.)

Change-Id: I2c23651d9c8edb5fe062c68bbb9b462c8949ded4
2011-06-01 15:06:42 -07:00
Todd Kennedy ca6eca0466 Don't navigate to a shortcut mailbox
All shortcuts now have a mailbox associated with them. When launching
the app via shortcut, we want to show the messages within that mailbox, but,
we do not want to navigate into the mailbox; unless the mailbox has children.
Since we don't want to put too much informatin into the shortcut, we must
perform these checks at runtime. So, if ever we try to load a mailbox that
doesn't contain children, we load it's parent instead.

Change-Id: Idb5dbc7cd740b270a0068811abe685f963ca2c0b
2011-05-26 14:21:42 -07:00
Makoto Onuki 54c91f00d7 Use IllegalArgumentException, not InvalidParameterException
Because IllegalArgumentException is the standard one.

Change-Id: Ib4d0bfa88a3d4218148a7cb248d9baa2124a72ba
2011-05-16 17:48:46 -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
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
Makoto Onuki d0ee1e404d Fix bug where mailbox list won't update in combined view
The problem was that CombinedMailboxesLoader used the cursor returned by
super.loadInBackground() (which contains accounts), to build a matrix
cursor (which contains special mailboxes and accounts and will be returned),
and *it closed the first cursor* after building the matrix cursor.

However, because this first cursor is the one that CursorLoader sets an
observer, it shouldn't be closed until the returned matix cursor closes.
In other words the two cursors should have the same lifecycle.

Fixed it by using ClosingMatrixCursor that used by AccountsLoader, which
is doing a similar thing, but properly.

Bug 3387730

Change-Id: I554ade001dc25afa869eefb4dcf9887495e6753e
2011-01-26 13:40:53 -08:00
Dianne Hackborn 31e2576791 Follow API changes.
Change-Id: I1ca0fe365b953fa98a462912309a1c9647277ba7
2011-01-17 16:24:00 -08:00
Makoto Onuki e447bea49b Attempt to fix StaleDataException
I'm not yet 100% sure what's going on, but the old code, not stopping
the scheduled forceLoad() in onReset() is apparently wrong.
onReset() is a new callback introduced in the recent loader change, so
this can explain why it started after the change.

Also, call super.onContentChanged() instead of directly calling forceLoad(),
as Loader.onContentChanged() now does more than just calling forceLoad.

Bug 3308465

Change-Id: Ica46bf994b571a26dd532734307a5c7ec6df0268
2011-01-04 13:43:07 -08:00
Dianne Hackborn 8b9f2a7284 Update to use new Loader callbacks.
Change-Id: Ib478c2f2314bbae4a380539e22892d85dd9a34b5
2010-12-20 23:14:01 -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
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 085f7eb121 Extract the throttling part from ThrottlingCursorLoader
Extracted into the Throttle class as I'll need this logic elsewhere.

Bonus: Now it has tests.

Change-Id: Ie9a5933f8e5015dda6985ba76814f1f945266178
2010-10-01 17:46:59 -07:00
Makoto Onuki 4209ea36b0 Make ThrottlingCursorLoader smarter
Now the class initially uses smaller timeout, and expand it when detecting
multiple changes in a short period.

This CL makes the UI look more responsive especially on the message list +
message view mode.  e.g. Starring on the message view will quickly be
reflected to the message list.

Bug 3024799
Bug 3027832

Change-Id: Ie2d44c3769d43e3fd0f54ee526556eb3bad5e288
2010-09-22 18:01:01 -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 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 187d033484 Reworking MessageListFragment.
- Now MessageListFragment uses loaders to load data.

- Now that we use Loader's auto-requery with throttling,
  removed the throttling timer from MessagesAdapter.

- Simplified footer mode.  (now only "no footer" or "load more")

- Removed saving/restoring list state code.
  These method don't really look like working, or at least
  not always working.  Now that UI's lifecycle is changing,
  we'd better redo it from scratch.

- Removed MessageListUnitTests.
  It only has tests for onSaveInstanceState/restore of the fragment,
  which I virtually disabled.

And minor clean-ups
- Moved the code to save/restore selected state from the fragment
  to Adapter.

Bug 2911766
Bug 2897500

Change-Id: I16c7aefecc5409c57fc5fc8c59b5c80d9b7fc164
2010-08-12 15:06:37 -07:00
Makoto Onuki 630e31ef78 Introducing ThrottlingCursorLoader.
This is a {@link CursorLoader} variant that takes {@code timeoutSecond}
in the constructor.

When it detects changes in the underlying data, it'll wait until the timeout
before doing a requery.

We use this to throttle # of queries.  We don't want to issue a query every
time something changes in the DB while we're syncing.

Change-Id: I098366bce923c3242c42964bc166493610ee0f6f
2010-08-03 17:45:51 -07:00