Commit Graph

27 Commits

Author SHA1 Message Date
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 0d4fc55861 Email split, part one: EmailService
* Create emailcommon package
* Move EmailService classes to emailcommon package
* Change references to aidl's to emailcommon package
* Add getApiLevel() command to EmailService

Bug: 3442973

Change-Id: Ic7d2115363cdff6ebb86c46650b0a5b2109b1c72
2011-02-10 13:10:38 -08:00
Todd Kennedy a7f49a7c0b Update icons with latest drop from UI
Change-Id: Ic23f1bee28c8aef1974225f9c03edc92c845f8c7
2011-01-26 17:43:03 -08:00
Makoto Onuki f7b8bc1ed7 Show newer/older in landscape as well, below message list
Now the button area is owned by the 3-pane layout, rather than the message view
fragment.

Bug 3327153

Change-Id: I9c262086c5a001cfe6e81b788c27d05d490c9830
2011-01-11 16:02:19 -08:00
Makoto Onuki a826d3fb03 Pixel perfect: Message view
Still waiting for a few missing assets, but it's done other than that.

The divider change is already merged; new layouts all use the framework style.

It's basically all layout changes, except for:
- Now the recepient address line has "Show details", which shows a dialog with
  all to/cc/bcc addresses with the timestamp.
- Now invite response buttons are checkboxes.
  (But the basic behavior doesn't change -- once you check a response,
  the message will be gone, so you can't change the response later.)

Copied message_header_bg from gmail manuall.  It'll look silly without it.

Bug 3138021
Bug 3307021

Change-Id: I6f7eb91d6104c3143a5c58b0c4c6c19929cea477
2011-01-10 15:51:32 -08:00
Todd Kennedy 64ac7a6cc8 Use new holo light icons
Use the new icons where appropriate. This is not a complete change as there are
still some icons missing.

Change-Id: I51d1458749343ddfc6456dc2a9853b8bc2540e26
2011-01-06 13:42:20 -08:00
Makoto Onuki f3d43641c9 Make "mark unread" close current message
- XLFragmentManager.selectMailbox() used to hide the message view
  when it's visible, but not anymore.  Made goBackToMailbox() itself
  hide it instead.

- Also made onMarkAsUnread() not call the unread callback, which was
  already done in onMarkMessageAsRead().

Bug 3214538

Change-Id: I52fb8bb745cdaa517624a9aeec074122f10aac4a
2010-11-29 14:46:27 -08:00
Makoto Onuki b715ea1d76 Fix & cleanup on EML viewer (MessageFileView)
- Fix the XL layout: Don't refer to "GONE" views in RelativeLayout.
- Don't always (re-)load message on onResume().
  This will make it lose all state (e.g. webview's zoom level) when coming
  back from other activities.
- Change the default visibility of some views so that it'll look okay
  while loading the message.
- Remove the use of obsolete fragment APIs.
- And some other minor cleanups...

Bug 3221066

Change-Id: I475bc229f4ea9e0e480f528389f5180e1d63fcd6
2010-11-22 17:02:48 -08:00
Makoto Onuki deda053f7c Fix NPE in MessageViewFragment
Call clearContent() in onDestroy(), instead of cancelAllTasks().
(This is what I thought I was doing.)

Calling clearContent() tells the BG thread that the activity has already
been destroyed, and prevents them from loading a message.

Also as a precaution, don't load a message if getActivity() returns null,
which means the activity has already been destroyed.

Bug 3134403

Change-Id: I0d591e0dd147f73e70b0c027dc8037482197f7b4
2010-11-22 14:29:29 -08:00
Makoto Onuki 4c9e1a3fde Don't reset message view when becoming active again.
- We used to (re-)load the content on every onStart(),
  which is called too when coming back from other actibities.
  So if you go home and come back with the task switcher,
  all state get reset, including webview zoom/pan and the current tab.

- Introduce a new flag, mLoadWhenResumed, to tell if we really need to
  load a message.

Also:
- Start loading a message in onResume() rather than onStart()
  to keep it consistent with other fragments.

Bug 3215269

Change-Id: I1cc6e12c3cc3c08065da3696603a3247f341469a
2010-11-19 15:12:54 -08:00
Makoto Onuki 931ca67a1f New message view command layout
UI Changes:
- "Move", "Delete" and "Mark as unread" became action bar commands.
- The message view bottom panel now only has "newer" and "older" buttons,
  with  the current position in the message list.  (shown as POS of TOTAL)
- The buttom panel is now shown only on portrait

Non UI changes
- MessageOrderManager now keeps track of the current cursor position
  as well as the total message count.

- Fixed the "move_action" string, which was wrongly marked as non-translatable.

Bug 3169454

Change-Id: I599543f9e11000a4ee283d31fbd407b2ab53ac44
2010-11-10 11:08:14 -08:00
Makoto Onuki 09eb977c06 Fix potential crash in MessageViewFragment.openMessageSync
The problem is that ths method is called in a worker thread, so
there's nothing to prevent it from running just after/at the same
time as clearContent() (which sets -1 to mMessageIdToOpen).
If it does, it passes -1 to restoreMessageWithId() and crashes.

Also removed a half-obsolete comment which is a bit too obvious for its length.

Bug 3077387

Change-Id: I736d696046e6d8964a16c80515544c582aca3943
2010-10-12 16:38:40 -07:00
Makoto Onuki f54e08eaee Introduce tabs to view message, attachment and invite separately
Added "tabs" to the message view according to the latset mock.
This removes the necessity of putting a WebView inside a ScrollView,
which caused the infinitely-growing email bug (issue 6882).

Right now the tabs are actually just Buttons.  Complete visual refresh
should follow it.

http://code.google.com/p/android/issues/detail?id=6882
Bug 2349275

Change-Id: I897a3a32e0dd7a90d637ac5ea1d47e5e65a1eabe
2010-10-05 16:53:59 -07:00
Makoto Onuki d058f8abcd Auto-refresh message view
Now MessageViewFragment detects changes made to the current message,
and update the UI.
(Although it doesn't really know if the message is really changed, or just
something else was changed in the DB.  It updates the header regardless.)

Change-Id: I35627c7aff129723b83605fc84521da907078571
2010-10-05 11:11:31 -07:00
Makoto Onuki 01b7e67f78 Move reply/forward buttons to header
Moved the buttons to the header.  All other buttons below the message view
go away, so I just hid the old buttons.

Also now we stop trying to hide these buttons when entering contextual mode,
which fixes bug 3044284: Message view buttons get disabled when closing
quick contact

Assets were temporarily copied from gmail.

Change-Id: Ib178c6221dfab02832a10d0c0441044e4969fb70
2010-10-05 11:04:10 -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 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 0435a0775e Let MessageViewFragment own bottom buttons.
Create a custom view containing the bottons below MVF
(delete, move, reply, etc) and let MVF own this.

These buttons used to be owned by the XL activity itself, because
the UI for these commands will most likely be totally different
from the tablet UI, so the fragment having them looked wrong.

However, this made it harder to make changes suggested by the latest
mock, such as "put reply/forward in the message header".
I think the buttons are semantically part of the message view anyway,
so the fragment owning UI for these commands is probably the way to go.
(And let's worry about the phone UI later.)

Reason for the use of a custom view is that it will make it easier
to make non-trivial UI changes, e.g. "combine reply, reply-all and
forward and make it dropdown."

Also removed obsolete TODOs from MessageListXL.

Change-Id: Ibf93f4c70fe07bdbbe33d2adb6bbd2b96812830d
2010-09-17 14:23:56 -07:00
Makoto Onuki b6c1ad0f01 Rename MessageViewFragment2
Change-Id: I28e23c0ff18211db999396c5ba1ad9ef898d4515
2010-07-30 15:41:40 -07:00
Makoto Onuki 206d4e842d Split up MessageViewFragment like we did to MessageView.
Break MessageViewFragment up into two fragments, MessageViewFragment, which
is used to show regular messages, and MessageFileViewFragment, which shows
EML messages.  (And their base class, MessageViewFragmentBase.)

MessageViewFragmentBase's javadoc has a class diagram.

MessageViewFragment is actually named MessageViewFragment2 at this point
so that GIT correctly finds out the rename from MessageViewFragment to
MessageViewFragmentBase.  I'll rename it back in a following CL.

Also added very basic unit tests for MessageView and MessageFileView.
At this point, they just make sure the activities really open and show
messages without exceptions.

I feel like the current naming schema for the activities/fragments is
kinda confusing.  Let me know if you come up with better names.

Change-Id: Iff948f4b68cfdb7c1e68f225927b0ce58d34766b
2010-07-30 15:38:53 -07:00
Makoto Onuki 02fa70aa18 Refactoring MessageListXL
I always thought our Activities are way too fat, meaning we've put too many
things into activities without any structure.

The major problems with this are:
- They have too many fields, which are not final and not even orthogonal.
  This makes them very hard to understand/maintain.  Changing one tiny bit
  can always cause unanticipated side-effects.
- Very hard, or almost impossible to test.

I really think we should break them into independent and self-contained
subcomponents which can be tested separately.

Introducing MessageListXLStateManager, which manages the current account,
mailbox and message, and show/hide/update fragments accordingly
for MessageListXL.

With this class, MessageListXL will be able to switch accounts/mailboxes/
messages by just calling the methods such as selectAccount(), without
worrying about when to show/hide what fragment and how to initialize them.
(In other words, MessageListXLStateManager encapsulates the two-pane screen
transition.  It's not intended to be reused for the phone UI.)

I didn't make it a nested class in MessageListXL, because nested classes can't
have real private members (private member are accessible from outer classes and
even brother classes!!), and I wanted it to be really self-contained anyway.

Change-Id: I1c121e99e30f12cc118e1c35abc9b30f49939a4a
2010-07-27 15:10:54 -07:00
Makoto Onuki 833eae6ac8 Adding lifecycle log to fragments.
Change-Id: If83486b50c924fdb99a422814ede66da710bfc2d
2010-07-26 11:33:06 -07:00
Makoto Onuki 411314990d Renaming message_view_header.xml to message_view_fragment.xml
Change-Id: Id0ccc13bfd8dfa63b450d46989938295ba8e78e0
2010-07-21 17:23:39 -07:00
Makoto Onuki d6a2978857 First cut of two pane activity.
How to launch:
- Kick "Email 2 Pane" in the app drawer.

Major known issues:
- When you launches "Email 2 Pane", it starts directly; the logic in Welcom
  won't be executed.
- There's no UI to add accounts.  Use the old UI.
- There's no way to select non-default accounts.
- The on-screen buttons except for older/newer don't work.
- No contex menus work.

Change-Id: I38374acafafbae62e46f84294a7677e54686cfc2
2010-07-21 16:30:52 -07:00
Makoto Onuki 16a60dca84 Fragmentize MessageView.
This version is hybrid of the old design and what Andy's suggested.
- MessageViewFragment is responsible to show a single message at a time.
- Call MVF.openMessage() to tell it to open another message.
  No need to re-create a new MVF to do this.
- MessageView manages the message list, and handles "move-to-newer/older"
  buttons.

Reason for not re-creating a fragment when opening another message is:
- Re-using the same fragment doesn't make it as complecated/ugly as I
  was initially afraid.
  It's basically cancelling all running tasks, re-initializee some views,
  and load a message.
- We don't have to run MVF.onCreate() over and over again when moving through
  messages.
We may change the strategy later, but I think it's suffice for now.
(Changing this might affect how the back key works, so let's revisit it
when the fragment manager supports back.)

Basically this CL is all about internal changes.
No UI should have changed except for:
- Moved "Move to newer/older" buttons to the bottom.

Also fixes:
Bug: 2849129

Change-Id: I00c05069231afded9d98d3d52dd9a7925ebdee9d
2010-07-19 18:34:40 -07:00