Change search list background to grey.

- Change the layout parent background programatically in the activity,
when the dialpad is shown or hidden.
- Change the gradient above the dialpad fragment in Dialer too.
- Add directory header attrs color.

Change-Id: I97be52f07480ee5b4db55555ef4e4de0feb7d55a
diff --git a/res/drawable/shadow_fade_up.xml b/res/drawable/shadow_fade_up.xml
index e2d9934..e961c86 100644
--- a/res/drawable/shadow_fade_up.xml
+++ b/res/drawable/shadow_fade_up.xml
@@ -18,7 +18,7 @@
     android:shape="rectangle" >
     <gradient
         android:type="linear"
-        android:startColor="#66999999"
-        android:endColor="#00ffffff"
+        android:startColor="#1a000000"
+        android:endColor="@null"
         android:angle="90"/>
 </shape>
\ No newline at end of file
diff --git a/res/layout/dialpad_fragment.xml b/res/layout/dialpad_fragment.xml
index 33324d1..b2312ad 100644
--- a/res/layout/dialpad_fragment.xml
+++ b/res/layout/dialpad_fragment.xml
@@ -28,7 +28,7 @@
     <!-- Dialpad shadow -->
     <View
         android:layout_width="match_parent"
-        android:layout_height="3dp"
+        android:layout_height="10dp"
         android:background="@drawable/shadow_fade_up" />
     <include layout="@layout/dialpad_view" />
     <!-- "Dialpad chooser" UI, shown only when the user brings up the
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 8dc051a..27965d2 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -21,6 +21,7 @@
     <color name="dialtacts_secondary_text_color">#888888</color>
     <color name="dialer_accent_color">#eeff41</color>
 
+    <color name="contact_list_background_color">#f2f2f2</color>
 
     <!-- Color of the text describing an unconsumed missed call. -->
     <color name="call_log_missed_call_highlight_color">#FF0000</color>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index a45d1e7..e541b0b 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -57,7 +57,7 @@
         <item name="list_item_label_width_weight">3</item>
         <item name="contact_browser_list_padding_left">8dip</item>
         <item name="contact_browser_list_padding_right">0dip</item>
-        <item name="contact_browser_background">@android:color/transparent</item>
+        <item name="contact_browser_background">@color/contact_list_background_color</item>
         <item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
         <!-- CallLog -->
         <item name="call_log_primary_text_color">#000000</item>
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 7aaa897..7f9200e 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -16,10 +16,7 @@
 
 package com.android.dialer;
 
-import android.animation.Animator;
 import android.animation.LayoutTransition;
-import android.animation.Animator.AnimatorListener;
-import android.animation.AnimatorListenerAdapter;
 import android.app.ActionBar;
 import android.app.Activity;
 import android.app.Fragment;
@@ -133,6 +130,8 @@
 
     private static final int ANIMATION_DURATION = 250;
 
+    private RelativeLayout parentLayout;
+
     /**
      * Fragment containing the dialpad that slides into view
      */
@@ -154,7 +153,6 @@
     private ListsFragment mListsFragment;
 
     private View mFloatingActionButton;
-    private View mMenuButton;
     private View mDialpadButton;
     private View mDialButton;
 
@@ -203,6 +201,9 @@
     private DialerDatabaseHelper mDialerDatabaseHelper;
     private DragDropController mDragDropController;
 
+    private int mDialerBackgroundColor;
+    private int mContactListBackgroundColor;
+
     private class OverflowPopupMenu extends PopupMenu {
         public OverflowPopupMenu(Context context, View anchor) {
             super(context, anchor);
@@ -364,8 +365,13 @@
             mFirstLaunch = savedInstanceState.getBoolean(KEY_FIRST_LAUNCH);
         }
 
-        RelativeLayout parent = (RelativeLayout) findViewById(R.id.dialtacts_mainlayout);
-        parent.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
+        parentLayout = (RelativeLayout) findViewById(R.id.dialtacts_mainlayout);
+        parentLayout.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
+        parentLayout.setOnDragListener(new LayoutOnDragListener());
+
+        mDialerBackgroundColor = getResources().getColor(R.color.background_dialer_light);
+        mContactListBackgroundColor =
+                getResources().getColor(R.color.contact_list_background_color);
 
         mFragmentsFrame = findViewById(R.id.dialtacts_frame);
 
@@ -381,8 +387,6 @@
 
         mDialerDatabaseHelper = DatabaseHelperManager.getDatabaseHelper(this);
         SmartDialPrefix.initializeNanpSettings(this);
-
-        findViewById(R.id.dialtacts_mainlayout).setOnDragListener(new LayoutOnDragListener());
     }
 
     @Override
@@ -625,6 +629,7 @@
         if (mListsFragment != null && mListsFragment.isResumed() && mListsFragment.isVisible()) {
             // If the favorites fragment is showing, fade to blank.
             mFragmentsFrame.animate().alpha(0.0f);
+            parentLayout.setBackgroundColor(mContactListBackgroundColor);
         }
         getActionBar().hide();
         alignFloatingActionButtonMiddle();
@@ -650,6 +655,8 @@
 
         if (mListsFragment != null && mListsFragment.isVisible()) {
             mFragmentsFrame.animate().alpha(1.0f);
+            parentLayout.setBackgroundColor(mDialerBackgroundColor);
+
         }
         getActionBar().show();
         alignFloatingActionButtonByTab(mCurrentTabPosition);