Commit Graph

43 Commits

Author SHA1 Message Date
Makoto Onuki 1ddc2ca4a7 Per-mailbox settings
- Use PreferenceActivity, in the old style, meaning without PreferenceFragment.
- If setting Inbox, change the account settings instead of mailbox settings.
- Use the DialogWhenLarge theme, meaning it's a full-screen avitity on the
  phone and a dialog on the tablet.
- Also fixed the bug that we the menu items that are made invisible by
  UIControllerBase may be made re-visible by the 1-pane controller.

TODO The menu item shouldn't be shown for non-syncable mailboxes.

Change-Id: I02b2faf6f593e1e2eb370217c27801aa58ca7e6c
2011-07-10 12:09:51 -07:00
Ben Komalo 85cfc9c0bd Fix b/4905749 using workaround
We suspect the underlying bug is b/4981556 but it is a framework issue
which needs time to fix. Some fragment state is not restored properly
when going through orientation change, so navigation shortly after that
will always crash.

Change-Id: Id6b8714c2aeac5f6bf09e82aea5459bb19d0054d
2011-06-30 11:47:39 -07:00
Ben Komalo 698aa92e6f Fix actionbar for message view
- shows the title of the message in the action bar (visuals not final -
need to extend the width and hide the account name)
- ensures that tapping up/back from a message view from a search result
list doesn't exit search
- ensures that tapping "app up" from a collapsible tablet view doesn't
exist the search unless the left pane is uncollapsed

Change-Id: I2b21a430d12148cf72237060c05312c7a23e2b3b
2011-06-29 19:46:58 -07:00
Makoto Onuki 22d1a794cd Newer/older + auto-advance for one-pane
- Moved MessageOrderManager code from 2-pabe to the base class.
- Most of the code is shared between 1-pane and 2-pane.

- Also fixed the bug where we re-created MessageOrderManager every time
the user taps newer/older, which was the reson the newer/older button
temporarily got disabled when you tapped them.
Before this CL we stopped MOM in uninstallMessageViewFragment, but now that
we don't reuse fragments this means we stops MOM when we remove the current
message view, and re-created a new one when a new message view is created.
Now we stop MOM when the right pane gets hidden (2pane) or when showing
the mailbox/message list (1pane).

- Also removed a now unused callback onMessageShown() from MessageViewFragment.
We used to update MOM on this event, but now we do this in
installMessageViweFramgment().

Bug 4575586

Change-Id: Idc4aba184f318e0c086afc29dcbe42364e2b51b3
2011-06-29 17:29:29 -07: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 ecd9c93cfa Fix one-pane navigation/UI bugs
- Back from the starred mailbox now works.
- Combined view now has the "show all folders" in the spinner.
- Null-out the list context when opening the mailbox list.
- Properly restore the list context when popping from the back stack.
- Disable the account spinner dropdown on the mailbox list.
- Hide the little triangle thing at the right bottom corner of the spinner
  when it's not selectable.

Bug 4836064
Bug 4689313

Change-Id: I41d1b6c7024953407b260f5b4b63fbc366e538ca
2011-06-28 16:30:28 -07:00
Makoto Onuki 4689cb7100 New account spinner
- Don't use the action bar spinner.
  Instead use a custom view to show the current account.
  (It's not a spinner; now we show the dropdown list by ourselves,
  which gives us more detailed control.)

- Also show the current mailbox name/unread count with the account name.

- Removed the mailbox info loader in ABC.
  Instead, now the AccountSelectorAdapter loader loads the current
  account/mailbox name, and the unread count as extras.

- Now ABC.Callback.onMailboxSelected passed an account ID as well
  as a mailbox ID.

- There's new code paths that can cause the "fragment transaction in
  onLoadFinished" exception.  We need to fix this properly, but
  for now we just use commitAllowingStateLoss().

Bug 4948352

Change-Id: I73bb8b7530f8328ca1c86382ac0a54086ad061d7
2011-06-27 13:19:27 -07:00
Makoto Onuki d8a2e33998 Add debug log to investigate bug 4905749
Change-Id: I1cfe12b0150490ec08caa02332bcca88521ff5fd
2011-06-24 18:44:31 -07:00
Ben Komalo 78c450ab14 Set list context through a central place.
Bug: 4946658
Change-Id: I3f283088697b282b98a1c4e15ddf1f9641991806
2011-06-24 15:26:04 -07:00
Makoto Onuki 1ce33fd93f Revive the security hold check on the UI side.
Bug 4901767

Change-Id: Id8ccd3346f2d3008543df2107bab97ebe1a20fa6
2011-06-23 16:40:53 -07:00
Ben Komalo 53300963ff Save/restore message list context
This fixes opening messages after rotations. Oops.
Bug: 4905495

Change-Id: Ibb9984245f7a040b65d472ad4103da587c28c83b
2011-06-23 12:38:42 -07:00
Marc Blank deb345aceb Support FLAG_SUPPORTS_SEARCH for IMAP accounts
* Update existing database to add this flag for IMAP accounts
* Set flag when creating IMAP accounts
* Change temporary UI to use the flag exclusively

Change-Id: Idefccd3a74d2222fe8a0ba47116dee981a0ae1f5
2011-06-23 10:36:35 -07:00
Ben Komalo b0b6eb56f7 Search state improvements.
- actually fires off a new instance of our Activity for search, instead
of killing the old one
- exiting search mode from a search result now works and pops the
activity stack
- doing a new search clears the input box as expected
- the search term is actually shown at the top in the results list

Change-Id: Ia6b92042e26a2e44b8cb45fe1d5b3bfb40cfd6da
2011-06-22 18:18:17 -07:00
Ben Komalo 383d6ead22 Use new message list in controllers.
Change-Id: Iaf4bf90add855f556a2e61521618924e13f60347
2011-06-22 17:23:13 -07:00
Ben Komalo a308618509 Pushes some search behavior to base controller
This enables search on one pane with the same caveats as on two pane

Change-Id: I80ab6ada0f718367fe6d584b18bc84d04a27bf7b
2011-06-22 13:55:05 -07:00
Ben Komalo f3d07fb3e6 Consolidate some menu item toggling.
- fixes search button being shown for pop accounts
- cleans up some duplicated code

Change-Id: I498f0140eb2f3ffa7d3ad7f0da0e1d357f80e9b9
2011-06-22 12:38:12 -07:00
Makoto Onuki f46a8f2053 Kill InboxFinder in the UI controller
Instead, in switchAccount, if the account doesn't have Inbox, we'll
redirect to Welcome and close EmailActivity.

(This will easily happen if you add a second account from the system settings,
launch the app and switch to the new account.)

Change-Id: Ia03d8e6697b58f6fcf10fd95fbcb5e310a5b5305
2011-06-21 17:59:55 -07:00
Makoto Onuki c9af8b2dbf Merge "Wait for initial sync in Welcome." 2011-06-21 14:37:12 -07:00
Makoto Onuki 95ad0f0e93 Wait for initial sync in Welcome.
Change-Id: I5052e8a3e3af5565184c391200b9ab63dff4b50b
2011-06-21 13:58:42 -07:00
Ben Komalo f69bcd0123 Some fixes to the action bar.
This hides the main navigation controls when the search view is shown.
It also fixes issues with rotation when in search mode.

Change-Id: I5ffed8eb7549fc603fc4e4d1868d114be65112c3
2011-06-21 12:28:57 -07:00
Ben Komalo 2441dd5cbb Merge "Cleanup and collapse some methods together." 2011-06-20 14:49:47 -07:00
Ben Komalo a355a4abe2 Cleanup and collapse some methods together.
Change-Id: Ida38b63362c50052064d7a5342febfe9e4a9c89e
2011-06-20 11:30:24 -07:00
Ben Komalo 99401ebea7 Remove a layer of callback in inbox finder.
I'm changing it so that inbox finding happens at an earlier stage so
that the UIController.open() methods can be simpler. Specifically: I
want them to just always accept a mailbox, and not have to deal with an
intermediate state where it's still looking for a mailbox.

Change-Id: I1c5be783859a3bee7e46007e778de13eb1685cbe
2011-06-17 19:44:10 -07:00
Ben Komalo 36f89da544 some brain dead typing shortening
Change-Id: I9342e8da52b412fd844b98ff76e61a9e4f9c5af7
2011-06-17 19:20:20 -07:00
Marc Blank 627bc6ed57 First implementation of IMAP search
* Broke up synchronizeMailboxGeneric into three pieces; it's still
  horrible, but this at least stops my eyes from bleeding
* Remove unused method/tests from Folder interface

Change-Id: Ib4d979536be657137cf70ca535cf429d707be41b
2011-06-16 20:26:52 -07:00
Makoto Onuki 0f27632749 Add "search mode" to the action bar
- Instead of the search dialog, show the search widget on the action bar.
- Launches a new activity for search, but still uses the temporary search code
- Search still works only on two-pane.

Change-Id: I1d36ad3416c7dff9579cf37e40e49e31c9d99219
2011-06-14 15:13:32 -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 e06e122441 Back navigation on 1 pane
- Allow going back from the message view to the message list with restoring
  all the state on the message list. (batch selection and scroll position)

- Also make "back" work for the message list <-> mailbox list navigation,
  but only 1 level at most.
  (Only the system back key works for this; the action bar home icon will
   not.)

- As discussed offline, it uses our custum "back stack" (which can hold
  at most 1 fragment) using the new fragment APIs, attach and detach.

- Removed commitFragmentTransaction() from the base class, as now there's
  nothing really in common between the two UI controllers in terms of how
  they use the fragment transaction.

Change-Id: Id626ce99beb1f4dceb999dc04bf7d3e5d57a8198
2011-06-08 14:45:57 -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 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 f015cc00ed Rework on inbox lookup
- Moved MailboxFinder logic to UIControllerBase so it can be reused for 1-pane.
- Make sure MailboxFinder runs only while the activity is resumed.
  (we don't want to get callbacks when it's not, because we can't perform
  fragment transactions.)
- Make sure MailboxFinder is restarted if the activity gets re-created
  while it's still running.

Bug 4522010

Change-Id: I4486ecfa44dd700d28c424bc5eb7104d3043cf7d
2011-06-01 19:25:14 -07:00
Makoto Onuki 47d6f782de Merge "Switch to async fragment transaction for two-pane" 2011-06-01 19:16:15 -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
Makoto Onuki 147e41d00a Remove unused method.
This should have been removed in I2c23651d.

Change-Id: I8dd90a0ba55e701225cdaf2e5b7c5fe92a417525
2011-06-01 17:56:16 -07:00
Makoto Onuki 49de71e3d2 Clean up Two pane
- Remove bunch of outdated TODOs
- Removed the stack for the back navigation for nested folders.
  Instead, Back/Up will always just navigate to the parent mailbox.
- Two-pane UI controller no longer stores IDs by itself.
  Now it always gets these from installed fragments.
- Added UIController.switchAccount(), which is the same as openAccount
  except it's no-op if the account is already selected.
- Other small clean-ups.

Change-Id: Ie14bc4f4b6b2cf6afb69bc97967c25682d4c7c78
2011-05-18 14:55:44 -07:00
Makoto Onuki b36ac01792 Changes for NO_XXX
- Added Message.NO_MESSAGE
- Renamed PSEUDO_ACCOUNT_ID_NONE to NO_ACCOUNT
- Removed PARENT_KEY_NONE and use NO_MAILBOX instead
- For starters, cleaned up the UI controllers to use them.

Change-Id: I6cfd87ece2fced8e9f7c76d034c4d1dbf9e4db10
2011-05-17 14:36:00 -07:00
Makoto Onuki bfac9f2e8a Move some of the log constants from Email to Logging
Change-Id: If9f4e4e3adcdef897a0d6a4e153bb446a8b24fdd
2011-05-13 14:24:38 -07:00
Ben Komalo 8c9167027f Merge "Rename AccountSettingsXL -> AccountSettings" 2011-05-13 13:56:20 -07:00
Makoto Onuki 1fba8254c5 Clean up fragment intallation.
Change-Id: Ia9c9d713dc921783995a8a50cc8b256b8392c1a7
2011-05-13 13:18:35 -07:00
Ben Komalo 2866284a6d Rename AccountSettingsXL -> AccountSettings
This activity already supports phone and tablet mode.
Only renames in this change - no other change.

Change-Id: Ieca17137af45e3860812091f69cd4d9b55ddf3ec
2011-05-13 09:58:15 -07:00
Todd Kennedy 5701e0a555 Suspend notifications for currently shown account
We will suspend notifications whenever we display the message list for an
account (including "combined inbox").  As soon as the message list is paused,
notifications will be resumed.

Change-Id: I481a0f59ce68f89c32210d862d0267f3f334063b
2011-05-12 14:03:14 -07:00
Makoto Onuki 94331c96d9 Remove phone activities and implement one-pane
The primary purpose of this CL is to remove phone activities, so the
one pane implementation is very much temporary and primitive, but it
should offer minimal operations.

Change-Id: If57f81db7c605c95664d49044a5cc082beda59c0
2011-05-11 15:35:27 -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