Revised new message button design.

b/10264590

Change-Id: I4121baf424eacfc2811087b5700b1a6f72fc801f
diff --git a/res/drawable-hdpi/btn_default_disabled_focused_holo_light.9.png b/res/drawable-hdpi/btn_default_disabled_focused_holo_light.9.png
new file mode 100644
index 0000000..735bcb8
--- /dev/null
+++ b/res/drawable-hdpi/btn_default_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/res/drawable-hdpi/btn_default_disabled_holo_light.9.png b/res/drawable-hdpi/btn_default_disabled_holo_light.9.png
new file mode 100644
index 0000000..b5a25f7
--- /dev/null
+++ b/res/drawable-hdpi/btn_default_disabled_holo_light.9.png
Binary files differ
diff --git a/res/drawable-hdpi/btn_default_focused_holo_light.9.png b/res/drawable-hdpi/btn_default_focused_holo_light.9.png
new file mode 100644
index 0000000..6555635
--- /dev/null
+++ b/res/drawable-hdpi/btn_default_focused_holo_light.9.png
Binary files differ
diff --git a/res/drawable-hdpi/btn_default_normal_holo_light.9.png b/res/drawable-hdpi/btn_default_normal_holo_light.9.png
new file mode 100644
index 0000000..3367a76
--- /dev/null
+++ b/res/drawable-hdpi/btn_default_normal_holo_light.9.png
Binary files differ
diff --git a/res/drawable-hdpi/btn_default_pressed_holo_light.9.png b/res/drawable-hdpi/btn_default_pressed_holo_light.9.png
new file mode 100644
index 0000000..d9ead96
--- /dev/null
+++ b/res/drawable-hdpi/btn_default_pressed_holo_light.9.png
Binary files differ
diff --git a/res/drawable-mdpi/btn_default_disabled_focused_holo_light.9.png b/res/drawable-mdpi/btn_default_disabled_focused_holo_light.9.png
new file mode 100644
index 0000000..d3ea4e5
--- /dev/null
+++ b/res/drawable-mdpi/btn_default_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/res/drawable-mdpi/btn_default_disabled_holo_light.9.png b/res/drawable-mdpi/btn_default_disabled_holo_light.9.png
new file mode 100644
index 0000000..9fdc75e
--- /dev/null
+++ b/res/drawable-mdpi/btn_default_disabled_holo_light.9.png
Binary files differ
diff --git a/res/drawable-mdpi/btn_default_focused_holo_light.9.png b/res/drawable-mdpi/btn_default_focused_holo_light.9.png
new file mode 100644
index 0000000..9596ba9
--- /dev/null
+++ b/res/drawable-mdpi/btn_default_focused_holo_light.9.png
Binary files differ
diff --git a/res/drawable-mdpi/btn_default_normal_holo_light.9.png b/res/drawable-mdpi/btn_default_normal_holo_light.9.png
new file mode 100644
index 0000000..4ccfaac
--- /dev/null
+++ b/res/drawable-mdpi/btn_default_normal_holo_light.9.png
Binary files differ
diff --git a/res/drawable-mdpi/btn_default_pressed_holo_light.9.png b/res/drawable-mdpi/btn_default_pressed_holo_light.9.png
new file mode 100644
index 0000000..e489850
--- /dev/null
+++ b/res/drawable-mdpi/btn_default_pressed_holo_light.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/btn_default_disabled_focused_holo_light.9.png b/res/drawable-xhdpi/btn_default_disabled_focused_holo_light.9.png
new file mode 100644
index 0000000..efb728a
--- /dev/null
+++ b/res/drawable-xhdpi/btn_default_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/btn_default_disabled_holo_light.9.png b/res/drawable-xhdpi/btn_default_disabled_holo_light.9.png
new file mode 100644
index 0000000..2139044
--- /dev/null
+++ b/res/drawable-xhdpi/btn_default_disabled_holo_light.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/btn_default_focused_holo_light.9.png b/res/drawable-xhdpi/btn_default_focused_holo_light.9.png
new file mode 100644
index 0000000..6fd626e
--- /dev/null
+++ b/res/drawable-xhdpi/btn_default_focused_holo_light.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/btn_default_normal_holo_light.9.png b/res/drawable-xhdpi/btn_default_normal_holo_light.9.png
new file mode 100644
index 0000000..cd330ba
--- /dev/null
+++ b/res/drawable-xhdpi/btn_default_normal_holo_light.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/btn_default_pressed_holo_light.9.png b/res/drawable-xhdpi/btn_default_pressed_holo_light.9.png
new file mode 100644
index 0000000..681e561
--- /dev/null
+++ b/res/drawable-xhdpi/btn_default_pressed_holo_light.9.png
Binary files differ
diff --git a/res/drawable/btn_default.xml b/res/drawable/btn_default.xml
new file mode 100644
index 0000000..5ed0301
--- /dev/null
+++ b/res/drawable/btn_default.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_window_focused="false" android:state_enabled="true"
+        android:drawable="@drawable/btn_default_normal_holo_light" />
+    <item android:state_window_focused="false" android:state_enabled="false"
+        android:drawable="@drawable/btn_default_disabled_holo_light" />
+    <item android:state_pressed="true"
+        android:drawable="@drawable/btn_default_pressed_holo_light" />
+    <item android:state_focused="true" android:state_enabled="true"
+        android:drawable="@drawable/btn_default_focused_holo_light" />
+    <item android:state_enabled="true"
+        android:drawable="@drawable/btn_default_normal_holo_light" />
+    <item android:state_focused="true"
+        android:drawable="@drawable/btn_default_disabled_focused_holo_light" />
+    <item android:drawable="@drawable/btn_default_disabled_holo_light" />
+</selector>
diff --git a/res/layout/conversation_view.xml b/res/layout/conversation_view.xml
index 56c36c6..8d6e628 100644
--- a/res/layout/conversation_view.xml
+++ b/res/layout/conversation_view.xml
@@ -56,14 +56,20 @@
                 android:layout_gravity="top"
                 android:visibility="gone" />
 
-            <include layout="@layout/new_message_notification_bar"
+            <Button xmlns:android="http://schemas.android.com/apk/res/android"
+                android:id="@+id/new_message_notification_bar"
+                style="@style/NewMessageButtonStyle"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_gravity="bottom"
                 android:layout_marginStart="@dimen/conversation_view_margin_side"
                 android:layout_marginEnd="@dimen/conversation_view_margin_side"
                 android:layout_marginLeft="@dimen/conversation_view_margin_side"
-                android:layout_marginRight="@dimen/conversation_view_margin_side" />
+                android:layout_marginRight="@dimen/conversation_view_margin_side"
+                android:animateLayoutChanges="true"
+                android:paddingLeft="24dp"
+                android:paddingRight="24dp"
+                android:visibility="gone" />
 
         </FrameLayout>
 
diff --git a/res/layout/new_message_notification_bar.xml b/res/layout/new_message_notification_bar.xml
deleted file mode 100644
index 82dc342..0000000
--- a/res/layout/new_message_notification_bar.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2012 Google Inc.
-     Licensed to The Android Open Source Project.
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_marginBottom="12dp"
-    android:animateLayoutChanges="true"
-    android:background="@android:color/white">
-
-    <!-- ignore UselessParent because the button drawable needs a white background -->
-    <LinearLayout
-        android:id="@+id/new_message_notification_bar"
-        style="?android:attr/buttonStyle"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal"
-        android:paddingLeft="24dp"
-        android:paddingRight="24dp"
-        android:visibility="gone"
-        tools:ignore="UselessParent" >
-
-        <TextView
-            android:id="@+id/new_message_description"
-            style="?android:attr/textAppearanceMedium"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:singleLine="true" />
-
-        <TextView
-            style="?android:attr/textAppearanceMedium"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="8dp"
-            android:text="@string/show" />
-    </LinearLayout>
-
-</FrameLayout>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 7fb8518..4db5d7e 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -104,7 +104,7 @@
     <!-- Teaser colors -->
 
     <!-- The color of the section name text in the teaser -->
-    <color name="teaser_main_text">#58585b</color>
+    <color name="teaser_main_text">@color/dark_gray_text_color</color>
 
     <!-- swipe to refresh text color, this matches the color in
         progressbar_solid_holo.png -->
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 0128e4f..cd09ffe 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -452,13 +452,9 @@
     <string name="conversation_older">Older</string>
 
     <!-- New Message notification text that appears over conversation view on incoming message. [CHAR LIMIT=30] -->
-    <string name="new_incoming_messages_one">New message from <xliff:g id="sender">%s</xliff:g>.</string>
+    <string name="new_incoming_messages_one">New message from <xliff:g id="sender">%s</xliff:g>. Show.</string>
     <!-- New Message notification text that appears over conversation view on incoming messages. [CHAR LIMIT=30] -->
-    <string name="new_incoming_messages_many"><xliff:g id="count">%1$d</xliff:g> new messages</string>
-
-    <!-- Anchor text for a control to show new messages when viewing a
-         conversation. [CHAR LIMIT=20] -->
-    <string name="show">Show</string>
+    <string name="new_incoming_messages_many"><xliff:g id="count">%1$d</xliff:g> new messages. Show.</string>
 
     <!-- Conversation message header strings -->
     <!--  Icon name for expanding recipient details in a message when viewing it. [CHAR LIMIT=40] -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index c354d3a..fbab926 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -473,4 +473,10 @@
         <item name="android:textColor">?android:attr/textColorLink</item>
     </style>
 
+    <style name="NewMessageButtonStyle" parent="@android:style/Widget.Holo.Light.Button">
+        <item name="android:background">@drawable/btn_default</item>
+        <item name="android:singleLine">true</item>
+        <item name="android:textColor">@color/dark_gray_text_color</item>
+        <item name="android:textSize">14sp</item>
+    </style>
 </resources>
diff --git a/src/com/android/mail/ui/ConversationViewFragment.java b/src/com/android/mail/ui/ConversationViewFragment.java
index 2117580..e8cd3c1 100644
--- a/src/com/android/mail/ui/ConversationViewFragment.java
+++ b/src/com/android/mail/ui/ConversationViewFragment.java
@@ -41,7 +41,7 @@
 import android.webkit.WebChromeClient;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
-import android.widget.TextView;
+import android.widget.Button;
 
 import com.android.mail.FormattedDateBuilder;
 import com.android.mail.R;
@@ -127,7 +127,7 @@
 
     private ConversationViewProgressController mProgressController;
 
-    private View mNewMessageBar;
+    private Button mNewMessageBar;
 
     protected HtmlConversationTemplates mTemplates;
 
@@ -338,7 +338,7 @@
                 .findViewById(R.id.conversation_container);
         mConversationContainer.setAccountController(this);
 
-        mNewMessageBar = mConversationContainer.findViewById(R.id.new_message_notification_bar);
+        mNewMessageBar = (Button) mConversationContainer.findViewById(R.id.new_message_notification_bar);
         mNewMessageBar.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -982,9 +982,7 @@
     }
 
     private void showNewMessageNotification(NewMessagesInfo info) {
-        final TextView descriptionView = (TextView) mNewMessageBar.findViewById(
-                R.id.new_message_description);
-        descriptionView.setText(info.getNotificationText());
+        mNewMessageBar.setText(info.getNotificationText());
         mNewMessageBar.setVisibility(View.VISIBLE);
     }