Added 'new' badge to navigation drawer.

Added 'new' badge to navigation drawer for
assistant. The badge will show until the
welcome assistant card is dismissed.

Test: Manual, verified badge is displayed until user dismisses the
welcome card.

Bug: 32542932
Change-Id: I5145ebaefc88444773a1d25ff2bfb11e6e6b0678
diff --git a/res/drawable/new_badge_background.xml b/res/drawable/new_badge_background.xml
new file mode 100644
index 0000000..be18ade
--- /dev/null
+++ b/res/drawable/new_badge_background.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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.
+-->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/dialtacts_secondary_text_color"/>
+    <corners android:radius="@dimen/nav_new_badge_corners"/>
+</shape>
\ No newline at end of file
diff --git a/res/layout/assistant_new_badge.xml b/res/layout/assistant_new_badge.xml
new file mode 100644
index 0000000..6ca8cc5
--- /dev/null
+++ b/res/layout/assistant_new_badge.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2016 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.
+-->
+
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/assistant_new_badge"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_gravity="center_vertical"
+    android:paddingLeft="@dimen/nav_new_badge_horizontal_pad"
+    android:paddingTop="@dimen/nav_new_badge_vertical_pad"
+    android:paddingRight="@dimen/nav_new_badge_horizontal_pad"
+    android:paddingBottom="@dimen/nav_new_badge_vertical_pad"
+    android:background="@drawable/new_badge_background"
+    android:textSize="@dimen/nav_new_badge_font_size"
+    android:textAllCaps="true"
+    android:textColor="#FFFFFF"
+    android:text="@string/menu_assistant_new_badge"/>
\ No newline at end of file
diff --git a/res/menu/activity_main_drawer.xml b/res/menu/activity_main_drawer.xml
index 75deb8b..877c726 100644
--- a/res/menu/activity_main_drawer.xml
+++ b/res/menu/activity_main_drawer.xml
@@ -16,7 +16,8 @@
   limitations under the License.
   -->
 
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <group android:id="@+id/nav_utilities">
         <item
@@ -25,6 +26,7 @@
             android:title="@string/contactsList" />
         <item
             android:id="@+id/nav_assistant"
+            app:actionViewClass="android.widget.LinearLayout"
             android:icon="@drawable/ic_assistant"
             android:title="@string/menu_assistant"/>
         <item
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 896d4e6..d3431fb 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -248,6 +248,11 @@
     <dimen name="nav_activity_horizontal_margin">16dp</dimen>
     <dimen name="nav_activity_vertical_margin">16dp</dimen>
 
+    <dimen name="nav_new_badge_corners">3dp</dimen>
+    <dimen name="nav_new_badge_vertical_pad">2dp</dimen>
+    <dimen name="nav_new_badge_horizontal_pad">5dp</dimen>
+    <dimen name="nav_new_badge_font_size">11sp</dimen>
+
     <!-- Top padding for the image for empty group view -->
     <dimen name="empty_group_view_image_padding_top">8dp</dimen>
 
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d8f3362..29c92c2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -926,6 +926,9 @@
     <!-- The menu item to open the link/merge duplicates activity. [CHAR LIMIT=20]-->
     <string name="menu_duplicates">Duplicates</string>
 
+    <!-- Assistant 'NEW' badge text. Badge shown next to Assistant in left drawer menu when user has not visited it yet. [CHAR LIMIT=10] -->
+    <string name="menu_assistant_new_badge">New</string>
+
     <!-- Open drawer content descriptions [CHAR LIMIT=40] -->
     <string name="navigation_drawer_open">Open navigation drawer</string>