Restyle the Call Log Details. Make the whole contact picture a push target

Reduced by 21 views on Nexus S

Bug:5099652

Change-Id: I49ec28e7d6e560c7622e4e983347bd95ebbd8a97
diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml
index a86d839..3b5601f 100644
--- a/res/layout/call_log_list_item.xml
+++ b/res/layout/call_log_list_item.xml
@@ -14,60 +14,41 @@
      limitations under the License.
 -->
 
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:padding="@dimen/call_log_inner_margin"
 >
     <!--
-        We have a nested FrameLayout because the margin attributes out the outer
-        layout are not used when this layout is inflated within a list.
+        This layout may represent either a call log item or one of the
+        headers in the call log.
 
-        TODO: Can we find a way to avoid the extra layer?
-     -->
-    <FrameLayout
+        The former will make the @id/call_log_item visible and the
+        @id/call_log_header gone.
+
+        The latter will make the @id/call_log_header visible and the
+        @id/call_log_item gone
+    -->
+
+    <RelativeLayout
+        android:id="@+id/call_log_item"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_vertical"
+    >
+        <include layout="@layout/call_log_contact_photo"/>
+        <include layout="@layout/call_log_action_call"/>
+        <include layout="@layout/call_log_list_item_layout"/>
+    </RelativeLayout>
+
+    <TextView
+        android:id="@+id/call_log_header_text"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginLeft="@dimen/call_log_inner_margin"
-        android:layout_marginRight="@dimen/call_log_inner_margin"
-        android:layout_marginTop="@dimen/call_log_inner_margin"
-        android:layout_marginBottom="@dimen/call_log_inner_margin"
-    >
-        <!--
-            This layout may represent either a call log item or one of the
-            headers in the call log.
-
-            The former will make the @id/call_log_item visible and the
-            @id/call_log_header gone.
-
-            The latter will make the @id/call_log_header visible and the
-            @id/call_log_item gone
-        -->
-
-        <RelativeLayout
-            android:id="@+id/call_log_item"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:gravity="center_vertical"
-        >
-            <include layout="@layout/call_log_contact_photo"/>
-            <include layout="@layout/call_log_action_call"/>
-            <include layout="@layout/call_log_list_item_layout"/>
-        </RelativeLayout>
-
-        <LinearLayout
-            android:id="@+id/call_log_header"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-        >
-            <TextView
-                android:id="@+id/call_log_header_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="@dimen/call_log_inner_margin"
-                android:textSize="14sp"
-                android:textStyle="bold"
-                android:textColor="?attr/call_log_header_color"
-            />
-        </LinearLayout>
-    </FrameLayout>
-</LinearLayout>
+        android:textSize="14sp"
+        android:textStyle="bold"
+        android:textColor="?attr/call_log_header_color"
+    />
+</FrameLayout>
diff --git a/src/com/android/contacts/calllog/CallLogFragment.java b/src/com/android/contacts/calllog/CallLogFragment.java
index abc9adf..ae22489 100644
--- a/src/com/android/contacts/calllog/CallLogFragment.java
+++ b/src/com/android/contacts/calllog/CallLogFragment.java
@@ -678,7 +678,7 @@
             if (section == CallLogQuery.SECTION_NEW_HEADER
                     || section == CallLogQuery.SECTION_OLD_HEADER) {
                 views.listItemView.setVisibility(View.GONE);
-                views.listHeaderView.setVisibility(View.VISIBLE);
+                views.listHeaderTextView.setVisibility(View.VISIBLE);
                 views.listHeaderTextView.setText(
                         section == CallLogQuery.SECTION_NEW_HEADER
                                 ? R.string.call_log_new_header
@@ -688,7 +688,7 @@
             }
             // Default case: an item in the call log.
             views.listItemView.setVisibility(View.VISIBLE);
-            views.listHeaderView.setVisibility(View.GONE);
+            views.listHeaderTextView.setVisibility(View.GONE);
 
             final String number = c.getString(CallLogQuery.NUMBER);
             final long date = c.getLong(CallLogQuery.DATE);
diff --git a/src/com/android/contacts/calllog/CallLogListItemViews.java b/src/com/android/contacts/calllog/CallLogListItemViews.java
index 90f78f7..368a868 100644
--- a/src/com/android/contacts/calllog/CallLogListItemViews.java
+++ b/src/com/android/contacts/calllog/CallLogListItemViews.java
@@ -45,14 +45,12 @@
     public final PhoneCallDetailsViews phoneCallDetailsViews;
     /** The item view for a stand-alone row, or null for other types of rows. */
     public final View listItemView;
-    /** The header view for a stand-alone row, or null for other types of rows. */
-    public final View listHeaderView;
     /** The text of the header in a stand-alone row, or null for other types of rows. */
     public final TextView listHeaderTextView;
 
     private CallLogListItemViews(QuickContactBadge quickContactView, ImageView photoView,
             View callView, View playView, View unheardView, View dividerView,
-            PhoneCallDetailsViews phoneCallDetailsViews, View listItemView, View listHeaderView,
+            PhoneCallDetailsViews phoneCallDetailsViews, View listItemView,
             TextView listHeaderTextView) {
         this.quickContactView = quickContactView;
         this.plainPhotoView = photoView;
@@ -62,7 +60,6 @@
         this.dividerView = dividerView;
         this.phoneCallDetailsViews = phoneCallDetailsViews;
         this.listItemView = listItemView;
-        this.listHeaderView = listHeaderView;
         this.listHeaderTextView = listHeaderTextView;
     }
 
@@ -76,7 +73,6 @@
                 view.findViewById(R.id.divider),
                 PhoneCallDetailsViews.fromView(view),
                 view.findViewById(R.id.call_log_item),
-                view.findViewById(R.id.call_log_header),
                 (TextView) view.findViewById(R.id.call_log_header_text));
     }
 
@@ -90,7 +86,6 @@
                 new View(context),
                 PhoneCallDetailsViews.createForTest(context),
                 new View(context),
-                new View(context),
                 new TextView(context));
     }
 }