Visual updates to the call log.

- New style icons for the different call types.
- Icons for call and playback of voicemail.
- Style definitions for call log.
- Add placeholder assets.

Change-Id: Ia2ec57dc078d1dec9680aea4917aea0490dda1a8
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d99577c..f4c6227 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -64,6 +64,7 @@
         <!-- A list of recent calls -->
         <activity android:name=".activities.CallLogActivity"
             android:label="@string/recentCallsIconLabel"
+            android:theme="@style/DialtactsTheme"
         >
             <intent-filter>
                 <action android:name="com.android.phone.action.RECENT_CALLS" />
diff --git a/res/drawable-hdpi/ic_call_log_list_action_call.png b/res/drawable-hdpi/ic_call_log_list_action_call.png
new file mode 100644
index 0000000..f47ada7
--- /dev/null
+++ b/res/drawable-hdpi/ic_call_log_list_action_call.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_call_log_list_action_play.png b/res/drawable-hdpi/ic_call_log_list_action_play.png
new file mode 100644
index 0000000..db19cdd
--- /dev/null
+++ b/res/drawable-hdpi/ic_call_log_list_action_play.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_call_log_list_incoming_call.png b/res/drawable-hdpi/ic_call_log_list_incoming_call.png
old mode 100755
new mode 100644
index 15b5e44..c98cd39
--- a/res/drawable-hdpi/ic_call_log_list_incoming_call.png
+++ b/res/drawable-hdpi/ic_call_log_list_incoming_call.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_call_log_list_missed_call.png b/res/drawable-hdpi/ic_call_log_list_missed_call.png
old mode 100755
new mode 100644
index 8dcb279..c52efbc
--- a/res/drawable-hdpi/ic_call_log_list_missed_call.png
+++ b/res/drawable-hdpi/ic_call_log_list_missed_call.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_call_log_list_outgoing_call.png b/res/drawable-hdpi/ic_call_log_list_outgoing_call.png
old mode 100755
new mode 100644
index 160c707..4204953
--- a/res/drawable-hdpi/ic_call_log_list_outgoing_call.png
+++ b/res/drawable-hdpi/ic_call_log_list_outgoing_call.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_call_log_list_voicemail.png b/res/drawable-hdpi/ic_call_log_list_voicemail.png
new file mode 100644
index 0000000..d2ee44f
--- /dev/null
+++ b/res/drawable-hdpi/ic_call_log_list_voicemail.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_call_log_list_action_call.png b/res/drawable-mdpi/ic_call_log_list_action_call.png
new file mode 100644
index 0000000..f47ada7
--- /dev/null
+++ b/res/drawable-mdpi/ic_call_log_list_action_call.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_call_log_list_action_play.png b/res/drawable-mdpi/ic_call_log_list_action_play.png
new file mode 100644
index 0000000..db19cdd
--- /dev/null
+++ b/res/drawable-mdpi/ic_call_log_list_action_play.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_call_log_list_incoming_call.png b/res/drawable-mdpi/ic_call_log_list_incoming_call.png
index c7eec52..c98cd39 100644
--- a/res/drawable-mdpi/ic_call_log_list_incoming_call.png
+++ b/res/drawable-mdpi/ic_call_log_list_incoming_call.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_call_log_list_missed_call.png b/res/drawable-mdpi/ic_call_log_list_missed_call.png
index 1907a62..c52efbc 100644
--- a/res/drawable-mdpi/ic_call_log_list_missed_call.png
+++ b/res/drawable-mdpi/ic_call_log_list_missed_call.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_call_log_list_outgoing_call.png b/res/drawable-mdpi/ic_call_log_list_outgoing_call.png
index 041d086..4204953 100644
--- a/res/drawable-mdpi/ic_call_log_list_outgoing_call.png
+++ b/res/drawable-mdpi/ic_call_log_list_outgoing_call.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_call_log_list_voicemail.png b/res/drawable-mdpi/ic_call_log_list_voicemail.png
new file mode 100644
index 0000000..d2ee44f
--- /dev/null
+++ b/res/drawable-mdpi/ic_call_log_list_voicemail.png
Binary files differ
diff --git a/res/layout/call_detail.xml b/res/layout/call_detail.xml
index a47452c..83c8f1b 100644
--- a/res/layout/call_detail.xml
+++ b/res/layout/call_detail.xml
@@ -82,7 +82,7 @@
                 android:layout_height="?attr/call_detail_action_icon_size"
                 android:layout_alignParentRight="true"
                 android:gravity="center_vertical"
-                android:src="@android:drawable/sym_action_call"
+                android:src="@drawable/ic_call_log_list_action_call"
                 android:scaleType="center"
             />
             <View
diff --git a/res/layout/call_log_contact_photo.xml b/res/layout/call_log_contact_photo.xml
index c47c23c..178c45b 100644
--- a/res/layout/call_log_contact_photo.xml
+++ b/res/layout/call_log_contact_photo.xml
@@ -2,9 +2,10 @@
 <merge xmlns:android="http://schemas.android.com/apk/res/android">
     <QuickContactBadge
         android:id="@+id/contact_photo"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentTop="true"
+        android:layout_width="?attr/call_log_contact_photo_size"
+        android:layout_height="?attr/call_log_contact_photo_size"
+        android:layout_margin="?attr/call_log_contact_photo_margin"
         android:layout_alignParentLeft="true"
+        android:layout_gravity="center_vertical"
     />
 </merge>
diff --git a/res/layout/call_log_list_child_item.xml b/res/layout/call_log_list_child_item.xml
index d2c22a9..ba7e4ec 100644
--- a/res/layout/call_log_list_child_item.xml
+++ b/res/layout/call_log_list_child_item.xml
@@ -16,7 +16,7 @@
 
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="?android:attr/listPreferredItemHeight"
+    android:layout_height="?attr/call_log_list_item_height"
 >
 
     <include layout="@layout/call_log_action_call"/>
diff --git a/res/layout/call_log_list_group_item.xml b/res/layout/call_log_list_group_item.xml
index e7ab026..352d7ec 100644
--- a/res/layout/call_log_list_group_item.xml
+++ b/res/layout/call_log_list_group_item.xml
@@ -16,7 +16,7 @@
 
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="?android:attr/listPreferredItemHeight"
+    android:layout_height="?attr/call_log_list_item_height"
 >
 
     <include layout="@layout/call_log_contact_photo"/>
diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml
index e07479d..7e82b40 100644
--- a/res/layout/call_log_list_item.xml
+++ b/res/layout/call_log_list_item.xml
@@ -16,7 +16,7 @@
 
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="?android:attr/listPreferredItemHeight"
+    android:layout_height="?attr/call_log_list_item_height"
 >
 
     <include layout="@layout/call_log_contact_photo"/>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 2abfaa2..e880673 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -36,6 +36,10 @@
         <item name="list_item_header_text_color">?color/section_header_text_color</item>
         <item name="list_item_header_text_size">14sp</item>
         <item name="contact_filter_popup_width">320dip</item>
+        <!-- CallLogActivity -->
+        <item name="call_log_contact_photo_size">50dip</item>
+        <item name="call_log_contact_photo_margin">5dip</item>
+        <item name="call_log_list_item_height">60dip</item>
     </style>
 
     <style name="CallDetailActivityTheme" parent="android:Theme.Holo.Light">
@@ -54,6 +58,7 @@
         <item name="call_detail_action_icon_size">50dip</item>
         <item name="call_detail_secondary_background_color">#FFFFFF</item>
     </style>
+
     <style name="ContactDetailActivityTheme" parent="android:Theme.Holo.Light">
         <item name="android:windowContentOverlay">@null</item>
     </style>
@@ -138,6 +143,12 @@
         <attr name="call_detail_secondary_background_color" format="color" />
     </declare-styleable>
 
+    <declare-styleable name="CallLogActivity">
+        <attr name="call_log_contact_photo_size" format="dimension" />
+        <attr name="call_log_contact_photo_margin" format="dimension" />
+        <attr name="call_log_list_item_height" format="dimension" />
+    </declare-styleable>
+
     <style name="PeopleTheme" parent="android:Theme.Holo.Light">
         <item name="list_item_height">?android:attr/listPreferredItemHeight</item>
         <item name="activated_background">@drawable/list_item_activated_background</item>
diff --git a/src/com/android/contacts/calllog/CallLogFragment.java b/src/com/android/contacts/calllog/CallLogFragment.java
index bfac0f3..8635716 100644
--- a/src/com/android/contacts/calllog/CallLogFragment.java
+++ b/src/com/android/contacts/calllog/CallLogFragment.java
@@ -250,10 +250,17 @@
                     R.drawable.ic_call_log_list_outgoing_call);
             Drawable drawableMissed = getResources().getDrawable(
                     R.drawable.ic_call_log_list_missed_call);
+            Drawable drawableVoicemail = getResources().getDrawable(
+                    R.drawable.ic_call_log_list_voicemail);
+            Drawable drawableCall = getResources().getDrawable(
+                    R.drawable.ic_call_log_list_action_call);
+            Drawable drawablePlay = getResources().getDrawable(
+                    R.drawable.ic_call_log_list_action_play);
 
             mContactPhotoManager = ContactPhotoManager.getInstance(getActivity());
             mCallLogViewsHelper = new CallLogListItemHelper(getResources(), mVoiceMailNumber,
-                    drawableIncoming, drawableOutgoing, drawableMissed);
+                    drawableIncoming, drawableOutgoing, drawableMissed, drawableVoicemail,
+                    drawableCall, drawablePlay);
         }
 
         /**
@@ -629,7 +636,7 @@
             views.numberView = (TextView) view.findViewById(R.id.number);
             views.dateView = (TextView) view.findViewById(R.id.date);
             views.iconView = (ImageView) view.findViewById(R.id.call_type_icon);
-            views.callView = view.findViewById(R.id.call_icon);
+            views.callView = (ImageView) view.findViewById(R.id.call_icon);
             if (views.callView != null) {
                 views.callView.setOnClickListener(this);
             }
diff --git a/src/com/android/contacts/calllog/CallLogListItemHelper.java b/src/com/android/contacts/calllog/CallLogListItemHelper.java
index 7697872..56399c0 100644
--- a/src/com/android/contacts/calllog/CallLogListItemHelper.java
+++ b/src/com/android/contacts/calllog/CallLogListItemHelper.java
@@ -43,6 +43,12 @@
     private final Drawable mDrawableOutgoing;
     /** Icon for missed calls. */
     private final Drawable mDrawableMissed;
+    /** Icon for voicemails. */
+    private final Drawable mDrawableVoicemail;
+    /** Icon for the call action. */
+    private final Drawable mDrawableCall;
+    /** Icon for the play action. */
+    private final Drawable mDrawablePlay;
 
     /**
      * Creates a new helper instance.
@@ -54,12 +60,16 @@
      * @param drawableMissed the icon drawn besides a missed call entry
      */
     public CallLogListItemHelper(Resources resources, String voicemailNumber,
-            Drawable drawableIncoming, Drawable drawableOutgoing, Drawable drawableMissed) {
+            Drawable drawableIncoming, Drawable drawableOutgoing, Drawable drawableMissed,
+            Drawable drawableVoicemail, Drawable drawableCall, Drawable drawablePlay) {
         mResources = resources;
         mVoiceMailNumber = voicemailNumber;
         mDrawableIncoming = drawableIncoming;
         mDrawableOutgoing = drawableOutgoing;
         mDrawableMissed = drawableMissed;
+        mDrawableVoicemail = drawableVoicemail;
+        mDrawableCall = drawableCall;
+        mDrawablePlay = drawablePlay;
     }
 
     /**
@@ -178,20 +188,48 @@
      */
     public void setCallType(final CallLogListItemViews views, int type) {
         if (views.iconView != null) {
-            // Set the icon
+            // Set the call type icon.
+            Drawable drawable = null;
             switch (type) {
                 case Calls.INCOMING_TYPE:
-                    views.iconView.setImageDrawable(mDrawableIncoming);
+                    drawable = mDrawableIncoming;
                     break;
 
                 case Calls.OUTGOING_TYPE:
-                    views.iconView.setImageDrawable(mDrawableOutgoing);
+                    drawable = mDrawableOutgoing;
                     break;
 
                 case Calls.MISSED_TYPE:
-                    views.iconView.setImageDrawable(mDrawableMissed);
+                    drawable = mDrawableMissed;
                     break;
+
+                case Calls.VOICEMAIL_TYPE:
+                    drawable = mDrawableVoicemail;
+                    break;
+
+                default:
+                    throw new IllegalArgumentException("invalid call type: " + type);
             }
+            views.iconView.setImageDrawable(drawable);
+        }
+        if (views.callView != null) {
+            // Set the action icon.
+            Drawable drawable = null;
+            switch (type) {
+                case Calls.INCOMING_TYPE:
+                case Calls.OUTGOING_TYPE:
+                case Calls.MISSED_TYPE:
+                    drawable = mDrawableCall;
+                    break;
+
+                case Calls.VOICEMAIL_TYPE:
+                    drawable = mDrawablePlay;
+                    break;
+
+                default:
+                    throw new IllegalArgumentException("invalid call type: " + type);
+            }
+            views.callView.setImageDrawable(drawable);
         }
     }
 }
diff --git a/src/com/android/contacts/calllog/CallLogListItemViews.java b/src/com/android/contacts/calllog/CallLogListItemViews.java
index dde7cf6..7264c96 100644
--- a/src/com/android/contacts/calllog/CallLogListItemViews.java
+++ b/src/com/android/contacts/calllog/CallLogListItemViews.java
@@ -16,7 +16,6 @@
 
 package com.android.contacts.calllog;
 
-import android.view.View;
 import android.widget.ImageView;
 import android.widget.QuickContactBadge;
 import android.widget.TextView;
@@ -40,7 +39,7 @@
     /** The icon indicating the type of call. */
     public ImageView iconView;
     /** The icon used to place a call to the contact. Only present for non-group entries. */
-    public View callView;
+    public ImageView callView;
     /** The icon used to expand and collapse an entry. Only present for group entries. */
     public ImageView groupIndicator;
     /**
diff --git a/tests/src/com/android/contacts/calllog/CallLogListItemHelperTest.java b/tests/src/com/android/contacts/calllog/CallLogListItemHelperTest.java
index 958ece5..a33b710 100644
--- a/tests/src/com/android/contacts/calllog/CallLogListItemHelperTest.java
+++ b/tests/src/com/android/contacts/calllog/CallLogListItemHelperTest.java
@@ -45,6 +45,12 @@
     private static final Drawable TEST_OUTGOING_DRAWABLE = new ColorDrawable(Color.BLUE);
     /** A drawable to be used for missed calls. */
     private static final Drawable TEST_MISSED_DRAWABLE = new ColorDrawable(Color.RED);
+    /** A drawable to be used for voicemails. */
+    private static final Drawable TEST_VOICEMAIL_DRAWABLE = new ColorDrawable(Color.RED);
+    /** A drawable to be used for the call action. */
+    private static final Drawable TEST_CALL_DRAWABLE = new ColorDrawable(Color.RED);
+    /** A drawable to be used for the play action. */
+    private static final Drawable TEST_PLAY_DRAWABLE = new ColorDrawable(Color.RED);
 
     /** The object under test. */
     private CallLogListItemHelper mHelper;
@@ -57,12 +63,13 @@
         super.setUp();
         Context context = getContext();
         mHelper = new CallLogListItemHelper(context.getResources(), TEST_VOICEMAIL_NUMBER,
-                TEST_INCOMING_DRAWABLE, TEST_OUTGOING_DRAWABLE, TEST_MISSED_DRAWABLE);
+                TEST_INCOMING_DRAWABLE, TEST_OUTGOING_DRAWABLE, TEST_MISSED_DRAWABLE,
+                TEST_VOICEMAIL_DRAWABLE, TEST_CALL_DRAWABLE, TEST_PLAY_DRAWABLE);
         mViews = new CallLogListItemViews();
         // Only set the views that are needed in the tests.
         mViews.iconView = new ImageView(context);
         mViews.dateView = new TextView(context);
-        mViews.callView = new View(context);
+        mViews.callView = new ImageView(context);
         mViews.line1View = new TextView(context);
         mViews.labelView = new TextView(context);
         mViews.numberView = new TextView(context);