Color/layout tweaks for Dialer

Add search icon into search box
Change background of recent cards shortcut to whiter one
Whiten the action bar
Darken background color of list items
Reduce size of searchview text

Bug: 11654293
Change-Id: I204b14e752b40563a6f7ebdd1d61f10854b41100
diff --git a/res/drawable-hdpi/dialer_recent_card_bg.9.png b/res/drawable-hdpi/dialer_recent_card_bg.9.png
index e581943..2bfdbcb 100644
--- a/res/drawable-hdpi/dialer_recent_card_bg.9.png
+++ b/res/drawable-hdpi/dialer_recent_card_bg.9.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_ab_search.png b/res/drawable-hdpi/ic_ab_search.png
new file mode 100644
index 0000000..3702846
--- /dev/null
+++ b/res/drawable-hdpi/ic_ab_search.png
Binary files differ
diff --git a/res/drawable-mdpi/dialer_recent_card_bg.9.png b/res/drawable-mdpi/dialer_recent_card_bg.9.png
index cb1d26f..dff6a0b 100644
--- a/res/drawable-mdpi/dialer_recent_card_bg.9.png
+++ b/res/drawable-mdpi/dialer_recent_card_bg.9.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_ab_search.png b/res/drawable-mdpi/ic_ab_search.png
new file mode 100644
index 0000000..cc9f911
--- /dev/null
+++ b/res/drawable-mdpi/ic_ab_search.png
Binary files differ
diff --git a/res/drawable-xhdpi/dialer_recent_card_bg.9.png b/res/drawable-xhdpi/dialer_recent_card_bg.9.png
index e1a4b67..05d254d 100644
--- a/res/drawable-xhdpi/dialer_recent_card_bg.9.png
+++ b/res/drawable-xhdpi/dialer_recent_card_bg.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_ab_search.png b/res/drawable-xhdpi/ic_ab_search.png
new file mode 100644
index 0000000..718ff49
--- /dev/null
+++ b/res/drawable-xhdpi/ic_ab_search.png
Binary files differ
diff --git a/res/drawable-xxhdpi/dialer_recent_card_bg.9.png b/res/drawable-xxhdpi/dialer_recent_card_bg.9.png
index 6142078..87d95f0 100644
--- a/res/drawable-xxhdpi/dialer_recent_card_bg.9.png
+++ b/res/drawable-xxhdpi/dialer_recent_card_bg.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_ab_search.png b/res/drawable-xxhdpi/ic_ab_search.png
new file mode 100644
index 0000000..4bb5165
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_ab_search.png
Binary files differ
diff --git a/res/layout/dialtacts_activity.xml b/res/layout/dialtacts_activity.xml
index 255eb49..e2c3853 100644
--- a/res/layout/dialtacts_activity.xml
+++ b/res/layout/dialtacts_activity.xml
@@ -81,36 +81,41 @@
             android:id="@+id/dialtacts_frame"
             android:clipChildren="false">
         </FrameLayout>
+        <View
+            android:layout_height="2dp"
+            android:layout_width="match_parent"
+            android:background="#33999999"
+        />
         <FrameLayout
-        android:layout_height="@dimen/fake_action_bar_height"
-        android:layout_width="match_parent"
-        android:id="@+id/fake_action_bar"
-        android:background="@color/actionbar_background_color">
-        <ImageButton
-            android:id="@+id/call_history_button"
-            android:layout_width="@dimen/fake_menu_button_min_width"
-            android:layout_height="match_parent"
-            android:layout_gravity="bottom|start"
-            android:background="?android:attr/selectableItemBackground"
-            android:contentDescription="@string/action_menu_call_history_description"
-            android:src="@drawable/ic_menu_history_dk"/>
-        <ImageButton
-            android:id="@+id/dialpad_button"
-            android:layout_width="@dimen/fake_menu_button_min_width"
-            android:layout_height="match_parent"
-            android:layout_gravity="bottom|center"
-            android:background="?android:attr/selectableItemBackground"
-            android:contentDescription="@string/action_menu_dialpad_button"
-            android:src="@drawable/ic_menu_dialpad_dk"/>
-        <ImageButton
-             android:id="@+id/overflow_menu"
-             android:layout_width="@dimen/fake_menu_button_min_width"
-             android:layout_height="match_parent"
-             android:layout_gravity="bottom|end"
-             android:src="@drawable/ic_menu_overflow_dk"
-             android:contentDescription="@string/action_menu_overflow_description"
-             android:background="?android:attr/selectableItemBackground"/>
-    </FrameLayout>
+            android:layout_height="@dimen/fake_action_bar_height"
+            android:layout_width="match_parent"
+            android:id="@+id/fake_action_bar"
+            android:background="@color/actionbar_background_color">
+            <ImageButton
+                android:id="@+id/call_history_button"
+                android:layout_width="@dimen/fake_menu_button_min_width"
+                android:layout_height="match_parent"
+                android:layout_gravity="bottom|start"
+                android:background="?android:attr/selectableItemBackground"
+                android:contentDescription="@string/action_menu_call_history_description"
+                android:src="@drawable/ic_menu_history_dk"/>
+            <ImageButton
+                android:id="@+id/dialpad_button"
+                android:layout_width="@dimen/fake_menu_button_min_width"
+                android:layout_height="match_parent"
+                android:layout_gravity="bottom|center"
+                android:background="?android:attr/selectableItemBackground"
+                android:contentDescription="@string/action_menu_dialpad_button"
+                android:src="@drawable/ic_menu_dialpad_dk"/>
+            <ImageButton
+                 android:id="@+id/overflow_menu"
+                 android:layout_width="@dimen/fake_menu_button_min_width"
+                 android:layout_height="match_parent"
+                 android:layout_gravity="bottom|end"
+                 android:src="@drawable/ic_menu_overflow_dk"
+                 android:contentDescription="@string/action_menu_overflow_description"
+                 android:background="?android:attr/selectableItemBackground"/>
+        </FrameLayout>
         <View
             android:id="@+id/dialtacts_bottom_padding"
             android:layout_width="match_parent"
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 439ccc2..7cbe1f9 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -41,7 +41,7 @@
     <color name="background_dialer_light">#cecece</color>
 
     <!-- Background color of dialer list items (contacts, call log entries) -->
-    <color name="background_dialer_list_items">#f5f5f5</color>
+    <color name="background_dialer_list_items">#eeeeee</color>
 
     <!-- Background color of new dialpad -->
     <color name="background_dialpad">#f2020709</color>
@@ -52,7 +52,7 @@
     <color name="dialpad_secondary_text_color">#aaaaaa</color>
 
     <!-- Background color of action bars -->
-    <color name="actionbar_background_color">#e6e6e6</color>
+    <color name="actionbar_background_color">#ffffff</color>
 
     <!-- Color of the 1dp divider that separates favorites -->
     <color name="favorite_contacts_separator_color">#d0d0d0</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index e4e847c..1743952 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -30,7 +30,7 @@
     <dimen name="call_button_height">74dp</dimen>
 
     <!--  Search View -->
-    <dimen name="search_text_size">16sp</dimen>
+    <dimen name="search_text_size">14sp</dimen>
 
     <!-- Call Log -->
     <dimen name="call_log_call_action_size">32dip</dimen>
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index faf63cd..04934c7 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -27,6 +27,7 @@
 import android.content.ActivityNotFoundException;
 import android.content.Context;
 import android.content.Intent;
+import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.RemoteException;
@@ -38,8 +39,11 @@
 import android.speech.RecognizerIntent;
 import android.telephony.TelephonyManager;
 import android.text.Editable;
+import android.text.Spannable;
+import android.text.SpannableStringBuilder;
 import android.text.TextUtils;
 import android.text.TextWatcher;
+import android.text.style.ImageSpan;
 import android.util.Log;
 import android.view.Menu;
 import android.view.MenuItem;
@@ -507,7 +511,19 @@
         mVoiceSearchButton.setOnClickListener(this);
         mSearchView = (EditText) findViewById(R.id.search_view);
         mSearchView.addTextChangedListener(mPhoneSearchQueryTextListener);
-        mSearchView.setHint(getString(R.string.dialer_hint_find_contact));
+
+        final String hintText = getString(R.string.dialer_hint_find_contact);
+
+        // The following code is used to insert an icon into a CharSequence (copied from
+        // SearchView)
+        final SpannableStringBuilder ssb = new SpannableStringBuilder("   "); // for the icon
+        ssb.append(hintText);
+        final Drawable searchIcon = getResources().getDrawable(R.drawable.ic_ab_search);
+        final int textSize = (int) (mSearchView.getTextSize() * 1.20);
+        searchIcon.setBounds(0, 0, textSize, textSize);
+        ssb.setSpan(new ImageSpan(searchIcon), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+
+        mSearchView.setHint(ssb);
     }
 
     final AnimatorListener mHideListener = new AnimatorListenerAdapter() {