From 16a60dca84516a1338e3cfe7f868c94f3f97c536 Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Fri, 16 Jul 2010 15:10:00 -0700 Subject: [PATCH] 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 --- res/layout-land/message_view.xml | 80 -- res/layout/message_view.xml | 72 +- res/layout/message_view_header.xml | 352 ++--- res/values/strings.xml | 41 +- .../android/email/activity/MediaOpener.java | 86 ++ .../android/email/activity/MessageView.java | 1276 +++-------------- .../email/activity/MessageViewFragment.java | 1166 +++++++++++++++ 7 files changed, 1663 insertions(+), 1410 deletions(-) delete mode 100644 res/layout-land/message_view.xml create mode 100644 src/com/android/email/activity/MediaOpener.java create mode 100644 src/com/android/email/activity/MessageViewFragment.java diff --git a/res/layout-land/message_view.xml b/res/layout-land/message_view.xml deleted file mode 100644 index 18584473c..000000000 --- a/res/layout-land/message_view.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - -