Merge "Tweak the margin on top of the senders/subject in wide view" into jb-ub-mail
diff --git a/res/layout-sw600dp/account_switch_spinner_item.xml b/res/layout-sw600dp/account_switch_spinner_item.xml
index 4e398f0..6247095 100644
--- a/res/layout-sw600dp/account_switch_spinner_item.xml
+++ b/res/layout-sw600dp/account_switch_spinner_item.xml
@@ -55,6 +55,5 @@
     <TextView
         android:id="@+id/account_unread"
         android:layout_toRightOf="@id/account_spinner_container"
-        android:layout_marginLeft="4dp"
-        style="@style/UnreadCountActionBar"/>
+        style="@style/unreadCountActionBarTablet"/>
 </RelativeLayout>
diff --git a/res/values-sw600dp/styles.xml b/res/values-sw600dp/styles.xml
index 696ac3a..38001e9 100644
--- a/res/values-sw600dp/styles.xml
+++ b/res/values-sw600dp/styles.xml
@@ -17,7 +17,7 @@
 -->
 <resources>
     <style name="AccountSwitchSpinnerItem" parent="@style/PlainSpinnerDropdown">
-        <item name="android:layout_width">308dp</item>
+        <item name="android:layout_width">312dp</item>
     </style>
     <style name="PersonalIndicatorStyle">
         <item name="android:layout_width">wrap_content</item>
@@ -74,4 +74,9 @@
 
     <style name="ConversationListStyle">
     </style>
+
+    <style name="unreadCountActionBarTablet" parent="@style/UnreadCountActionBar">
+        <item name="android:layout_marginLeft">26dp</item>
+        <item name="android:layout_width">wrap_content</item>
+    </style>
 </resources>
diff --git a/res/values-sw720dp-port/dimen.xml b/res/values-sw720dp-port/dimen.xml
index 43e0055..30b0bc2 100644
--- a/res/values-sw720dp-port/dimen.xml
+++ b/res/values-sw720dp-port/dimen.xml
@@ -17,4 +17,5 @@
 -->
 <resources>
     <dimen name="spinner_frame_width">172dip</dimen>
+    <dimen name="compose_scrollview_width">700dip</dimen>
 </resources>
\ No newline at end of file
diff --git a/res/values-sw720dp-port/styles.xml b/res/values-sw720dp-port/styles.xml
index b99a018..ad49432 100644
--- a/res/values-sw720dp-port/styles.xml
+++ b/res/values-sw720dp-port/styles.xml
@@ -17,6 +17,10 @@
 -->
 <resources>
     <style name="AccountSwitchSpinnerItem" parent="@style/PlainSpinnerDropdown">
-        <item name="android:layout_width">268dp</item>
+        <item name="android:layout_width">276dp</item>
+    </style>
+    <style name="unreadCountActionBarTablet" parent="@style/UnreadCountActionBar">
+        <item name="android:layout_marginLeft">12dp</item>
+        <item name="android:layout_width">wrap_content</item>
     </style>
 </resources>
diff --git a/res/values-sw720dp/dimen.xml b/res/values-sw720dp/dimen.xml
index e549d9e..cf37b91 100644
--- a/res/values-sw720dp/dimen.xml
+++ b/res/values-sw720dp/dimen.xml
@@ -16,7 +16,7 @@
      limitations under the License.
 -->
 <resources>
-    <dimen name="compose_scrollview_width">700dip</dimen>
+    <dimen name="compose_scrollview_width">900dip</dimen>
     <dimen name="compose_area_left_padding">100dip</dimen>
     <dimen name="compose_area_right_padding">100dip</dimen>
     <dimen name="spinner_frame_width">260dip</dimen>
diff --git a/res/values-sw720dp/styles.xml b/res/values-sw720dp/styles.xml
index 6fad5d5..f39db51 100644
--- a/res/values-sw720dp/styles.xml
+++ b/res/values-sw720dp/styles.xml
@@ -21,7 +21,7 @@
         <item name="android:layout_width">wrap_content</item>
     </style>
     <style name="AccountSwitchSpinnerItem" parent="@style/PlainSpinnerDropdown">
-        <item name="android:layout_width">364dp</item>
+        <item name="android:layout_width">368dp</item>
     </style>
 
     <style name="MessageHeaderUpperDateStyle" parent="MessageHeaderExtraSmallStyle">
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index 8abba37..230408c 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -42,6 +42,7 @@
 import android.provider.BaseColumns;
 import android.text.Editable;
 import android.text.Html;
+import android.text.SpannableString;
 import android.text.Spanned;
 import android.text.TextUtils;
 import android.text.TextWatcher;
@@ -687,7 +688,7 @@
         message.bcc = formatSenders(mBcc.getText().toString());
         message.replyTo = null;
         message.dateReceivedMs = 0;
-        String htmlBody = Html.toHtml(mBodyView.getText());
+        String htmlBody = Html.toHtml(new SpannableString(mBodyView.getText().toString()));
         StringBuilder fullBody = new StringBuilder(htmlBody);
         message.bodyHtml = fullBody.toString();
         message.bodyText = mBodyView.getText().toString();
@@ -1752,23 +1753,13 @@
     }
 
     private void doSend() {
-        clearImeText();
         sendOrSaveWithSanityChecks(false, true, false);
     }
 
     private void doSave(boolean showToast) {
-        // Clear the IME composing suggestions from the body and subject before saving.
-        clearImeText();
         sendOrSaveWithSanityChecks(true, showToast, false);
     }
 
-    private void clearImeText() {
-        mBodyView.clearComposingText();
-        BaseInputConnection.removeComposingSpans(mBodyView.getEditableText());
-        mSubject.clearComposingText();
-        BaseInputConnection.removeComposingSpans(mSubject.getEditableText());
-    }
-
     @VisibleForTesting
     public interface SendOrSaveCallback {
         public void initializeSendOrSave(SendOrSaveTask sendOrSaveTask);
@@ -2193,7 +2184,7 @@
         MessageModification.putCustomFromAddress(values, message.from);
 
         MessageModification.putSubject(values, message.subject);
-        String htmlBody = Html.toHtml(body);
+        String htmlBody = Html.toHtml(new SpannableString(body.toString()));
 
         boolean includeQuotedText = !TextUtils.isEmpty(quotedText);
         StringBuilder fullBody = new StringBuilder(htmlBody);