New view contact layout

- Larger picture, add 25% black transparent layer on top of
picture, large white font for header text
- Less labels, add section separators
- Remove primary action icon
- TODO: scrolling header + list, gray items non-actionable

Bug: 4371084
Change-Id: Ia4c29efcffc3acfc910ffe2b62ec205e937917da
diff --git a/res/layout-xlarge-land/contact_detail_list_item.xml b/res/layout-xlarge-land/contact_detail_list_item.xml
index 529059a..47af40a 100644
--- a/res/layout-xlarge-land/contact_detail_list_item.xml
+++ b/res/layout-xlarge-land/contact_detail_list_item.xml
@@ -23,20 +23,10 @@
     android:layout_height="wrap_content"
     android:orientation="vertical">
 
-    <!-- Longer separating line (between kinds) -->
-    <View
+    <!-- Separating line (between kinds) -->
+    <include
         android:id="@+id/kind_divider"
-        android:layout_width="match_parent"
-        android:layout_height="1px"
-        android:background="@drawable/list_item_divider_holo" />
-
-    <!-- Shorter separating line if there was no kind-separator -->
-    <View
-        android:id="@+id/in_kind_divider"
-        android:layout_width="match_parent"
-        android:layout_height="1px"
-        android:layout_marginLeft="164dip"
-        android:background="@drawable/list_item_divider_holo" />
+        layout="@layout/contact_detail_divider" />
 
     <LinearLayout
         android:layout_width="match_parent"
@@ -44,21 +34,27 @@
         android:gravity="center_vertical"
         android:orientation="vertical"
         android:minHeight="@dimen/detail_min_line_item_height">
+
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="horizontal"
             android:layout_gravity="center_vertical">
-            <TextView
-                android:id="@+id/kind"
-                android:layout_width="164dip"
+
+            <FrameLayout
+                android:layout_width="@dimen/detail_item_type_width"
                 android:layout_height="@dimen/detail_min_line_item_height"
-                android:paddingLeft="19dip"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:textColor="?android:attr/textColorTertiary"
-                android:singleLine="true"
-                android:ellipsize="marquee"
-                android:gravity="center_vertical" />
+                android:paddingLeft="@dimen/detail_item_side_margin">
+
+                <TextView
+                    android:id="@+id/kind"
+                    style="@style/ContactDetailItemType" />
+
+                <TextView
+                    android:id="@+id/type"
+                    style="@style/ContactDetailItemType" />
+
+            </FrameLayout>
 
             <LinearLayout
                 android:layout_width="wrap_content"
@@ -67,26 +63,21 @@
                 android:layout_weight="1"
                 android:paddingLeft="12dip"
                 android:orientation="vertical">
+
                 <TextView
                     android:id="@+id/data"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:textAppearance="?android:attr/textAppearanceMedium" />
+                    android:textAppearance="?android:attr/textAppearanceLarge" />
+
                 <TextView
                     android:id="@+id/footer"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:textAppearance="?android:attr/textAppearanceSmall"
                     android:visibility="gone" />
+
             </LinearLayout>
-            <TextView
-                android:id="@+id/type"
-                android:layout_width="wrap_content"
-                android:layout_height="@dimen/detail_min_line_item_height"
-                android:maxWidth="150dip"
-                android:gravity="right|center_vertical"
-                android:textColor="@color/detail_item_type_color"
-                android:textAppearance="?android:attr/textAppearanceSmall" />
 
             <ImageView
                 android:id="@+id/presence_icon"
@@ -96,14 +87,6 @@
                 android:gravity="center"
                 android:scaleType="centerInside" />
 
-            <ImageView
-                android:id="@+id/action_icon"
-                android:layout_width="32dip"
-                android:layout_height="@dimen/detail_min_line_item_height"
-                android:layout_marginLeft="16dip"
-                android:layout_gravity="center_vertical"
-                android:scaleType="centerInside" />
-
             <View
                 android:id="@+id/divider"
                 android:layout_width="1px"
@@ -125,10 +108,10 @@
         </LinearLayout>
     </LinearLayout>
 
-    <!-- Longer separating line (only for the last row) -->
-    <View
+    <!-- Separating line (only for the last row) -->
+    <include
         android:id="@+id/line_below_last"
-        android:layout_width="match_parent"
-        android:layout_height="1px"
-        android:background="@drawable/list_item_divider_holo" />
+        android:layout_marginBottom="8dip"
+        layout="@layout/contact_detail_divider" />
+
 </LinearLayout>
diff --git a/res/layout-xlarge/contact_detail_fragment.xml b/res/layout-xlarge/contact_detail_fragment.xml
index 60d3cd5..0a4c53c 100644
--- a/res/layout-xlarge/contact_detail_fragment.xml
+++ b/res/layout-xlarge/contact_detail_fragment.xml
@@ -34,11 +34,11 @@
             android:layout_height="wrap_content"
             android:layout_marginBottom="28dip"
             ex:layout_wideParentWidth="800dip"
-            ex:layout_wideMarginLeft="80dip"
-            ex:layout_wideMarginRight="48dip"
+            ex:layout_wideMarginLeft="64dip"
+            ex:layout_widePaddingRight="48dip"
             ex:layout_narrowParentWidth="500dip"
-            ex:layout_narrowMarginLeft="15dip"
-            ex:layout_narrowMarginRight="16dip"
+            ex:layout_narrowMarginLeft="32dip"
+            ex:layout_narrowPaddingRight="16dip"
         />
     </com.android.contacts.widget.InterpolatingLayout>
 
@@ -78,7 +78,7 @@
             ex:layout_narrowMarginLeft="32dip"
             ex:layout_narrowPaddingRight="16dip"
             android:cacheColorHint="#00000000"
-            android:divider="@android:color/transparent"
+            android:divider="@null"
         />
     </com.android.contacts.widget.InterpolatingLayout>
 
diff --git a/res/layout/contact_detail_divider.xml b/res/layout/contact_detail_divider.xml
new file mode 100644
index 0000000..c934daf
--- /dev/null
+++ b/res/layout/contact_detail_divider.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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.
+-->
+
+<View xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="10dip"
+    android:layout_marginTop="8dip"
+    android:background="?android:attr/listDivider"
+    />
\ No newline at end of file
diff --git a/res/layout/contact_detail_fragment.xml b/res/layout/contact_detail_fragment.xml
index 90a075a..da37323 100644
--- a/res/layout/contact_detail_fragment.xml
+++ b/res/layout/contact_detail_fragment.xml
@@ -24,12 +24,14 @@
         android:id="@+id/contact_header_widget"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"/>
-        
+
     <ListView android:id="@android:id/list"
+        android:paddingTop="5dip"
         android:layout_width="match_parent"
         android:layout_height="0px"
         android:layout_weight="1"
         android:background="@drawable/title_bar_shadow"
+        android:divider="@null"
     />
 
     <ScrollView android:id="@android:id/empty"
diff --git a/res/layout/contact_detail_header_view.xml b/res/layout/contact_detail_header_view.xml
index 3248920..9f87b26 100644
--- a/res/layout/contact_detail_header_view.xml
+++ b/res/layout/contact_detail_header_view.xml
@@ -14,46 +14,54 @@
      limitations under the License.
 -->
 
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/banner"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="horizontal"
-    android:background="@drawable/title_bar_medium"
-    android:paddingRight="5dip">
+    android:layout_height="150dip">
 
     <ImageView android:id="@+id/photo"
-        android:layout_gravity="center_vertical"
-        android:layout_marginLeft="-1dip"
-        android:layout_marginTop="4dip"
-        android:layout_marginBottom="4dip"
-        android:layout_marginRight="8dip"
-        android:layout_width="64dip"
-        android:layout_height="64dip"
-    />
+        android:scaleType="centerCrop"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_alignParentTop="true"
+        android:layout_alignParentLeft="true"
+        />
+
+    <!-- Transparent view to overlay on the contact's photo
+    (to allow white text to appear over a white photo). -->
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_alignParentTop="true"
+        android:layout_alignParentLeft="true"
+        android:background="#000000"
+        android:alpha=".25"
+        />
 
     <LinearLayout
-        android:layout_width="0dip"
-        android:layout_height="wrap_content"
-        android:layout_weight="1"
-        android:orientation="vertical"
-        android:layout_gravity="center_vertical" >
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_alignParentLeft="true"
+        android:layout_marginLeft="10dip"
+        android:orientation="vertical" >
 
         <TextView android:id="@+id/name"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
+            android:layout_width="wrap_content"
+            android:layout_height="0dip"
+            android:layout_weight="1"
             android:singleLine="true"
             android:ellipsize="end"
-            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:gravity="bottom"
+            android:textSize="30sp"
+            android:textColor="@color/detail_header_view_text_color"
             android:textStyle="bold"
-            android:shadowColor="#BB000000"
-            android:shadowRadius="2.75"
          />
 
         <TextView android:id="@+id/phonetic_name"
-            android:layout_width="match_parent"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:textColor="@color/detail_header_view_text_color"
             android:singleLine="true"
             android:ellipsize="end"
             android:layout_marginTop="-2dip"
@@ -61,9 +69,10 @@
         />
 
         <TextView android:id="@+id/organization"
-            android:layout_width="match_parent"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:textColor="@color/detail_header_view_text_color"
             android:singleLine="true"
             android:ellipsize="end"
             android:layout_marginTop="-2dip"
@@ -71,7 +80,7 @@
         />
 
         <TextView android:id="@+id/attribution"
-            android:layout_width="match_parent"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:textColor="?android:attr/textColorSecondary"
@@ -82,9 +91,10 @@
         />
 
         <TextView android:id="@+id/status"
-            android:layout_width="match_parent"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textColor="@color/detail_header_view_text_color"
             android:singleLine="true"
             android:ellipsize="end"
             android:layout_marginTop="-2dip"
@@ -92,9 +102,8 @@
         />
 
         <TextView android:id="@+id/status_date"
-            android:layout_width="match_parent"
-            android:layout_height="0dip"
-            android:layout_weight="1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:textSize="12sp"
             android:layout_marginTop="-2dip"
@@ -106,9 +115,13 @@
         android:id="@+id/star"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:layout_marginTop="10dip"
+        android:layout_marginRight="10dip"
+        android:layout_alignParentTop="true"
+        android:layout_alignParentRight="true"
         android:layout_gravity="center_vertical"
         android:contentDescription="@string/description_star"
         android:visibility="invisible"
         style="?android:attr/starStyle"
     />
-</LinearLayout>
+</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/contact_detail_list_item.xml b/res/layout/contact_detail_list_item.xml
index 13b07bb..db37862 100644
--- a/res/layout/contact_detail_list_item.xml
+++ b/res/layout/contact_detail_list_item.xml
@@ -23,68 +23,41 @@
     android:layout_height="wrap_content"
     android:orientation="vertical">
 
-    <!-- Seperator that shows the kind -->
-    <LinearLayout
+    <!-- Separating line (between kinds) -->
+    <include
         android:id="@+id/kind_divider"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical">
-        <ImageView
-            android:layout_width="match_parent"
-            android:layout_height="1px"
-            android:background="@drawable/list_item_divider_holo" />
-        <TextView
-            android:id="@+id/kind"
-            android:gravity="center_vertical"
-            android:layout_width="match_parent"
-            android:layout_height="31dip"
-            android:paddingLeft="16dip"
-            android:textAppearance="?android:attr/textAppearanceSmall"
-            android:textColor="?android:attr/textColorTertiary" />
-        <ImageView
-            android:layout_width="match_parent"
-            android:layout_height="1px"
-            android:background="@drawable/list_item_divider_holo" />
-    </LinearLayout>
-
-    <!-- Shorter seperating line if there was no kind-seperator -->
-    <ImageView
-        android:id="@+id/in_kind_divider"
-        android:layout_marginLeft="31dip"
-        android:layout_width="match_parent"
-        android:layout_height="1px"
-        android:background="@drawable/list_item_divider_holo" />
+        layout="@layout/contact_detail_divider" />
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_marginLeft="@dimen/detail_item_side_margin"
+        android:layout_marginBottom="7dip"
         android:minHeight="@dimen/detail_min_line_item_height"
         android:orientation="horizontal"
-        android:paddingLeft="31dip"
         android:gravity="center_vertical">
+
         <LinearLayout
             android:layout_width="0dip"
             android:layout_height="wrap_content"
             android:layout_weight="1"
-            android:layout_marginLeft="5dip"
             android:orientation="vertical"
-            android:paddingTop="5dip"
-            android:paddingBottom="7dip"
             android:gravity="center_vertical">
 
             <TextView
+                android:id="@+id/kind"
+                style="@style/ContactDetailItemType" />
+
+            <TextView
+                android:id="@+id/type"
+                style="@style/ContactDetailItemType" />
+
+            <TextView
                 android:id="@+id/data"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_gravity="center_vertical"
-                android:textAppearance="?android:attr/textAppearanceMedium" />
-
-            <TextView
-                android:id="@+id/type"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:textColor="@color/detail_item_type_color" />
+                android:textAppearance="?android:attr/textAppearanceLarge" />
 
             <TextView
                 android:id="@+id/footer"
@@ -104,31 +77,29 @@
             android:gravity="center"
             android:scaleType="centerInside" />
 
-        <ImageView
-            android:id="@+id/action_icon"
-            android:layout_width="32dip"
-            android:layout_height="32dip"
-            android:layout_marginLeft="16dip"
-            android:gravity="center"
-            android:scaleType="centerInside" />
-
         <View
             android:id="@+id/divider"
             android:layout_width="1px"
             android:layout_height="match_parent"
-            android:layout_marginTop="5dip"
-            android:layout_marginBottom="5dip"
-            android:layout_marginLeft="14dip"
-            android:layout_marginRight="14dip"
+            android:layout_marginTop="15dip"
+            android:layout_marginBottom="8dip"
             android:background="?android:attr/dividerVertical" />
 
         <ImageView
             android:id="@+id/secondary_action_button"
             android:layout_width="32dip"
             android:layout_height="match_parent"
-            android:layout_centerVertical="true"
-            android:gravity="center"
-            android:scaleType="center"
+            android:layout_marginLeft="@dimen/detail_item_icon_margin"
+            android:layout_marginRight="@dimen/detail_item_icon_margin"
+            android:duplicateParentState="false"
+            android:layout_gravity="bottom"
             android:background="?android:attr/selectableItemBackground" />
     </LinearLayout>
+
+    <!-- Separating line (only for the last row) -->
+    <include
+        android:id="@+id/line_below_last"
+        android:layout_marginBottom="8dip"
+        layout="@layout/contact_detail_divider" />
+
 </LinearLayout>
diff --git a/res/values-xlarge/dimens.xml b/res/values-xlarge/dimens.xml
index 7a9b742..f156672 100644
--- a/res/values-xlarge/dimens.xml
+++ b/res/values-xlarge/dimens.xml
@@ -18,6 +18,7 @@
     <dimen name="aggregation_suggestion_icon_size">64dip</dimen>
     <dimen name="editor_type_label_width">180dip</dimen>
     <dimen name="editor_field_spinner_text_size">15sp</dimen>
+    <dimen name="detail_item_side_margin">19dip</dimen>
     <dimen name="quick_contact_width">356dip</dimen>
     <dimen name="contact_name_text_size">26sp</dimen>
     <dimen name="action_bar_filter_min_width">120dip</dimen>
diff --git a/res/values-xlarge/styles.xml b/res/values-xlarge/styles.xml
index 6f6b334..dcb32ad 100644
--- a/res/values-xlarge/styles.xml
+++ b/res/values-xlarge/styles.xml
@@ -102,4 +102,15 @@
         <item name="android:windowNoDisplay">true</item>
         <item name="android:windowIsFloating">true</item>
     </style>
+
+    <style name="ContactDetailItemType">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">match_parent</item>
+        <item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
+        <item name="android:textColor">@color/detail_item_type_color</item>
+        <item name="android:singleLine">true</item>
+        <item name="android:ellipsize">marquee</item>
+        <item name="android:gravity">center_vertical</item>
+        <item name="android:paddingTop">5dip</item>
+    </style>
 </resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 69f92ad..a9a6ccb 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -39,4 +39,7 @@
 
     <!-- Color of the text indicating the type of entry (e.g. Home, Work etc) -->
     <color name="detail_item_type_color">#B4B4B4</color>
+
+    <!-- Color of the text indicating the type of entry (e.g. Home, Work etc) -->
+    <color name="detail_header_view_text_color">#FFFFFF</color>
 </resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 38b836a..67e6d03 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -58,9 +58,18 @@
     <!-- Font size for the entries in a spinner in the contact editor. -->
     <dimen name="editor_field_spinner_text_size">10sp</dimen>
 
+    <!-- Left and right padding for a contact detail item -->
+    <dimen name="detail_item_icon_margin">10dip</dimen>
+
+    <!-- Left and right padding for a contact detail item -->
+    <dimen name="detail_item_side_margin">10dip</dimen>
+
     <!-- Minimum height of a row in the contact detail -->
     <dimen name="detail_min_line_item_height">48dip</dimen>
 
+    <!-- Width of a contact detail item type (i.e. Nickname or Website). -->
+    <dimen name="detail_item_type_width">164dip</dimen>
+
     <!-- Padding to be used between a visible scrollbar and the contact list -->
     <dimen name="list_visible_scrollbar_padding">40dip</dimen>
 
diff --git a/res/values/styles.xml b/res/values/styles.xml
index c4a588f..593879f 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -189,4 +189,15 @@
         <item name="android:layout_height">2dip</item>
         <item name="android:layout_width">match_parent</item>
     </style>
+
+    <style name="ContactDetailItemType">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
+        <item name="android:textColor">@color/detail_item_type_color</item>
+        <item name="android:singleLine">true</item>
+        <item name="android:ellipsize">marquee</item>
+        <item name="android:gravity">center_vertical</item>
+        <item name="android:paddingTop">5dip</item>
+    </style>
 </resources>
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index 91e7f9e..7a74228 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -846,13 +846,11 @@
     /** Cache of the children views of a row */
     private static class ViewCache {
         public View kindDivider;
-        public View inKindDivider;
         public View lineBelowLast;
         public TextView kind;
         public TextView type;
         public TextView data;
         public TextView footer;
-        public ImageView actionIcon;
         public ImageView presenceIcon;
         public ImageView secondaryActionButton;
         public View secondaryActionDivider;
@@ -878,11 +876,9 @@
                 viewCache.kind = (TextView) v.findViewById(R.id.kind);
                 viewCache.kindDivider = v.findViewById(R.id.kind_divider);
                 viewCache.lineBelowLast = v.findViewById(R.id.line_below_last);
-                viewCache.inKindDivider = v.findViewById(R.id.in_kind_divider);
                 viewCache.type = (TextView) v.findViewById(R.id.type);
                 viewCache.data = (TextView) v.findViewById(R.id.data);
                 viewCache.footer = (TextView) v.findViewById(R.id.footer);
-                viewCache.actionIcon = (ImageView) v.findViewById(R.id.action_icon);
                 viewCache.presenceIcon = (ImageView) v.findViewById(R.id.presence_icon);
                 viewCache.secondaryActionButton = (ImageView) v.findViewById(
                         R.id.secondary_action_button);
@@ -894,28 +890,42 @@
             final ViewEntry previousEntry = position == 0 ? null : getEntry(position - 1);
             final boolean isFirstOfItsKind =
                     previousEntry == null ? true : !previousEntry.kind.equals(entry.kind);
-            final boolean isLast = position == getCount() - 1;
 
             // Bind the data to the view
-            bindView(v, entry, isFirstOfItsKind, isLast);
+            bindView(v, entry, position, isFirstOfItsKind);
             return v;
         }
 
-        protected void bindView(View view, ViewEntry entry, boolean isFirstOfItsKind,
-                boolean isLast) {
+        private void bindView(View view, ViewEntry entry, int position,
+                boolean isFirstOfItsKind) {
             final Resources resources = mContext.getResources();
             ViewCache views = (ViewCache) view.getTag();
 
-            views.kind.setText(isFirstOfItsKind ? entry.kind : "");
-            views.kindDivider.setVisibility(isFirstOfItsKind ? View.VISIBLE : View.GONE);
-            views.inKindDivider.setVisibility(isFirstOfItsKind ? View.GONE : View.VISIBLE);
-            if (views.lineBelowLast != null) {
-                views.lineBelowLast.setVisibility(isLast ? View.VISIBLE : View.GONE);
+            if (isFirstOfItsKind) {
+                views.kind.setText(entry.kind != null ? entry.kind.toUpperCase() : "");
+                views.kind.setVisibility(View.VISIBLE);
+            } else {
+                views.kind.setVisibility(View.GONE);
             }
 
-            views.type.setText(entry.typeString);
-            views.type.setVisibility(
-                    TextUtils.isEmpty(entry.typeString) ? View.GONE : View.VISIBLE);
+            views.kindDivider.setVisibility(isFirstOfItsKind && position != 0 ?
+                    View.VISIBLE : View.GONE);
+
+            if (position == getCount() - 1) {
+                views.lineBelowLast.setVisibility(View.VISIBLE);
+            } else {
+                views.lineBelowLast.setVisibility(View.GONE);
+            }
+
+            if (!TextUtils.isEmpty(entry.typeString)) {
+                views.type.setText(entry.typeString.toUpperCase());
+                views.type.setVisibility(View.VISIBLE);
+                if (isFirstOfItsKind) {
+                    views.kind.setVisibility(View.GONE);
+                }
+            } else {
+                views.type.setVisibility(View.GONE);
+            }
 
             views.data.setText(entry.data);
             setMaxLines(views.data, entry.maxLines);
@@ -928,24 +938,6 @@
                 views.footer.setVisibility(View.GONE);
             }
 
-            // Set the action icon
-            final ImageView action = views.actionIcon;
-            if (entry.actionIcon != -1) {
-                Drawable actionIcon;
-                if (entry.resPackageName != null) {
-                    // Load external resources through PackageManager
-                    actionIcon = mContext.getPackageManager().getDrawable(entry.resPackageName,
-                            entry.actionIcon, null);
-                } else {
-                    actionIcon = resources.getDrawable(entry.actionIcon);
-                }
-                action.setImageDrawable(actionIcon);
-                action.setVisibility(View.VISIBLE);
-            } else {
-                // Things should still line up as if there was an icon, so make it invisible
-                action.setVisibility(View.INVISIBLE);
-            }
-
             // Set the presence icon
             final Drawable presenceIcon = ContactPresenceIconUtil.getPresenceIcon(
                     mContext, entry.presence);