diff --git a/res/layout-xlarge/contact_browser.xml b/res/layout-xlarge/contact_browser.xml
index 4643e44..7b90089 100644
--- a/res/layout-xlarge/contact_browser.xml
+++ b/res/layout-xlarge/contact_browser.xml
@@ -25,7 +25,6 @@
         android:id="@+id/list_container"
         android:layout_width="380dip"
         android:layout_height="match_parent" 
-        android:layout_marginLeft="20dip"
         android:layout_marginRight="50dip"/>
 
     <!--  Holder for detail- or editor-fragment. -->
diff --git a/res/layout-xlarge/contact_detail_list_item.xml b/res/layout-xlarge/contact_detail_list_item.xml
new file mode 100644
index 0000000..dd5c4be
--- /dev/null
+++ b/res/layout-xlarge/contact_detail_list_item.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright 2010, 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.
+ */
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeight"
+    android:orientation="horizontal"
+    android:paddingLeft="9dip"
+    android:gravity="center_vertical"
+>
+    <TextView android:id="@+id/kind"
+        android:layout_width="100dip"
+        android:layout_height="wrap_content"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+    />
+
+    <TextView android:id="@+id/type"
+        android:layout_width="100dip"
+        android:layout_height="wrap_content"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+    />
+
+    <TextView android:id="@+id/data"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_vertical"
+        android:layout_weight="1"
+        android:layout_marginLeft="8dip"
+        android:textAppearance="?android:attr/textAppearanceLarge"
+    />
+
+    <ImageView android:id="@+id/primary_icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_vertical"
+        android:paddingLeft="3dip"
+        android:src="@drawable/ic_default_number"
+    />
+
+    <TextView
+        android:id="@+id/footer"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_vertical"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:visibility="gone" />
+
+    <ImageView android:id="@+id/presence_icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="5dip"
+        android:gravity="center"
+        android:scaleType="centerInside"
+    />
+
+    <ImageView android:id="@+id/action_icon"
+        android:layout_width="30dip"
+        android:layout_height="30dip"
+        android:layout_marginLeft="14dip"
+        android:layout_marginRight="14dip"
+        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:background="@drawable/divider_vertical_dark"
+    />
+
+    <ImageView android:id="@+id/secondary_action_button"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_centerVertical="true"
+        android:paddingLeft="14dip"
+        android:paddingRight="14dip"
+        android:gravity="center"
+        android:scaleType="center"
+        android:background="@android:drawable/list_selector_background"
+    />
+
+</LinearLayout>
diff --git a/res/layout/list_item_text_icons.xml b/res/layout/contact_detail_list_item.xml
similarity index 97%
rename from res/layout/list_item_text_icons.xml
rename to res/layout/contact_detail_list_item.xml
index 69e064e..a110ec2 100644
--- a/res/layout/list_item_text_icons.xml
+++ b/res/layout/contact_detail_list_item.xml
@@ -37,7 +37,7 @@
         android:gravity="center_vertical"
     >
 
-        <TextView android:id="@android:id/text1"
+        <TextView android:id="@+id/kind_and_type"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:textAppearance="?android:attr/textAppearanceLarge"
@@ -49,7 +49,7 @@
             android:orientation="horizontal"
         >
             
-            <TextView android:id="@android:id/text2"
+            <TextView android:id="@+id/data"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_gravity="center_vertical"
diff --git a/src/com/android/contacts/views/detail/ContactDetailFragment.java b/src/com/android/contacts/views/detail/ContactDetailFragment.java
index ae14568..2bb5e52 100644
--- a/src/com/android/contacts/views/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/views/detail/ContactDetailFragment.java
@@ -26,6 +26,7 @@
 import com.android.contacts.TypePrecedence;
 import com.android.contacts.model.ContactsSource;
 import com.android.contacts.model.ContactsSource.DataKind;
+import com.android.contacts.model.ContactsSource.EditType;
 import com.android.contacts.model.Sources;
 import com.android.contacts.util.Constants;
 import com.android.contacts.util.DataStatus;
@@ -299,7 +300,7 @@
                 if (mimeType == null) continue;
 
                 final DataKind kind = sources.getKindOrFallback(accountType, mimeType, mContext,
-                        ContactsSource.LEVEL_MIMETYPES);
+                        ContactsSource.LEVEL_CONSTRAINTS);
                 if (kind == null) continue;
 
                 final ViewEntry entry = ViewEntry.fromValues(mContext, mimeType, kind, dataId,
@@ -380,8 +381,8 @@
                         entry.intent = imActions.getPrimaryIntent();
                         entry.secondaryIntent = imActions.getSecondaryIntent();
                     }
-                    if (TextUtils.isEmpty(entry.label)) {
-                        entry.label = mContext.getString(R.string.chat).toLowerCase();
+                    if (TextUtils.isEmpty(entry.kindAndType)) {
+                        entry.kindAndType = mContext.getString(R.string.chat).toLowerCase();
                     }
 
                     // Apply presence and status details when available
@@ -391,7 +392,7 @@
                     }
                     mImEntries.add(entry);
                 } else if (Organization.CONTENT_ITEM_TYPE.equals(mimeType) &&
-                        (hasData || !TextUtils.isEmpty(entry.label))) {
+                        (hasData || !TextUtils.isEmpty(entry.typeString))) {
                     // Build organization entries
                     final boolean isNameRawContact =
                             (mContactData.getNameRawContactId() == rawContactId);
@@ -400,13 +401,14 @@
                             isNameRawContact
                             && mContactData.getDisplayNameSource()
                                 == DisplayNameSources.ORGANIZATION
-                            && (!hasData || TextUtils.isEmpty(entry.label));
+                            && (!hasData || TextUtils.isEmpty(entry.typeString));
 
                     if (!duplicatesTitle) {
                         entry.uri = null;
 
-                        if (TextUtils.isEmpty(entry.label)) {
-                            entry.label = entry.data;
+                        if (TextUtils.isEmpty(entry.typeString)) {
+                            entry.kindAndType = entry.data;
+                            entry.typeString = entry.data;
                             entry.data = "";
                         }
 
@@ -474,8 +476,7 @@
         }
     }
 
-    private static String buildActionString(DataKind kind, ContentValues values,
-            boolean lowerCase, Context context) {
+    private static String buildActionString(DataKind kind, ContentValues values, Context context) {
         if (kind.actionHeader == null) {
             return null;
         }
@@ -483,7 +484,7 @@
         if (actionHeader == null) {
             return null;
         }
-        return lowerCase ? actionHeader.toString().toLowerCase() : actionHeader.toString();
+        return actionHeader.toString();
     }
 
     private static String buildDataString(DataKind kind, ContentValues values,
@@ -499,9 +500,10 @@
      * A basic structure with the data for a contact entry in the list.
      */
     private static class ViewEntry implements Collapsible<ViewEntry> {
-        // Copied from baseclass
         public int type = -1;
-        public String label;
+        public String kindAndType;
+        public String kind;
+        public String typeString;
         public String data;
         public Uri uri;
         public long id = 0;
@@ -515,7 +517,6 @@
         public int secondaryActionIcon = -1;
         public Intent intent;
         public Intent secondaryIntent = null;
-        public int maxLabelLines = 1;
         public ArrayList<Long> ids = new ArrayList<Long>();
         public int collapseCount = 0;
 
@@ -536,12 +537,31 @@
             entry.id = dataId;
             entry.uri = ContentUris.withAppendedId(Data.CONTENT_URI, entry.id);
             entry.mimetype = mimeType;
-            entry.label = buildActionString(kind, values, false, context);
+            entry.kindAndType = buildActionString(kind, values, context);
+            entry.kind = kind.titleRes == -1 ? "" : context.getString(kind.titleRes);
             entry.data = buildDataString(kind, values, context);
 
             if (kind.typeColumn != null && values.containsKey(kind.typeColumn)) {
                 entry.type = values.getAsInteger(kind.typeColumn);
+
+                // get type string
+                entry.typeString = "";
+                for (EditType type : kind.typeList) {
+                    if (type.rawValue == entry.type) {
+                        if (type.customColumn == null) {
+                            // Non-custom type. Get its description from the resource
+                            entry.typeString = context.getString(type.labelRes);
+                        } else {
+                            // Custom type. Read it from the database
+                            entry.typeString = values.getAsString(type.customColumn);
+                        }
+                        break;
+                    }
+                }
+            } else {
+                entry.typeString = "";
             }
+
             if (kind.iconRes > 0) {
                 entry.resPackageName = kind.resPackageName;
                 entry.actionIcon = kind.iconRes;
@@ -578,12 +598,13 @@
             if (TypePrecedence.getTypePrecedence(mimetype, type)
                     > TypePrecedence.getTypePrecedence(entry.mimetype, entry.type)) {
                 type = entry.type;
-                label = entry.label;
+                kindAndType = entry.kindAndType;
+                kind = entry.kind;
+                typeString = entry.typeString;
             }
 
             // Choose the max of the maxLines and maxLabelLines values.
             maxLines = Math.max(maxLines, entry.maxLines);
-            maxLabelLines = Math.max(maxLabelLines, entry.maxLabelLines);
 
             // Choose the presence with the highest precedence.
             if (StatusUpdates.getPresencePrecedence(presence)
@@ -626,7 +647,9 @@
 
     /** Cache of the children views of a row */
     private static class ViewCache {
-        public TextView label;
+        public TextView kindAndType;
+        public TextView kind;
+        public TextView type;
         public TextView data;
         public TextView footer;
         public ImageView actionIcon;
@@ -649,12 +672,14 @@
                 viewCache = (ViewCache) v.getTag();
             } else {
                 // Create a new view if needed
-                v = mInflater.inflate(R.layout.list_item_text_icons, parent, false);
+                v = mInflater.inflate(R.layout.contact_detail_list_item, parent, false);
 
                 // Cache the children
                 viewCache = new ViewCache();
-                viewCache.label = (TextView) v.findViewById(android.R.id.text1);
-                viewCache.data = (TextView) v.findViewById(android.R.id.text2);
+                viewCache.kindAndType = (TextView) v.findViewById(R.id.kind_and_type);
+                viewCache.kind = (TextView) v.findViewById(R.id.kind);
+                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.primaryIcon = (ImageView) v.findViewById(R.id.primary_icon);
@@ -666,30 +691,34 @@
                 v.setTag(viewCache);
             }
 
+            final ViewEntry previousEntry = position == 0 ? null : getEntry(position - 1);
+            final boolean isFirstOfItsKind =
+                    previousEntry == null ? true : !previousEntry.kind.equals(entry.kind);
+
             // Bind the data to the view
-            bindView(v, entry);
+            bindView(v, entry, isFirstOfItsKind);
             return v;
         }
 
-        protected void bindView(View view, ViewEntry entry) {
+        protected void bindView(View view, ViewEntry entry, boolean isFirstOfItsKind) {
             final Resources resources = mContext.getResources();
             ViewCache views = (ViewCache) view.getTag();
 
-            // Set the label
-            TextView label = views.label;
-            setMaxLines(label, entry.maxLabelLines);
-            label.setText(entry.label);
+            // Set the label. This is either a combination field or separate fields for kind of type
+            if (views.kindAndType != null) views.kindAndType.setText(entry.kindAndType);
+            if (views.kind != null) views.kind.setText(isFirstOfItsKind ? entry.kind : "");
+            if (views.type != null) views.type.setText(entry.typeString);
 
-            // Set the data
-            TextView data = views.data;
-            if (data != null) {
+            // Set the content
+            final TextView content = views.data;
+            if (content != null) {
                 if (entry.mimetype.equals(Phone.CONTENT_ITEM_TYPE)
                         || entry.mimetype.equals(Constants.MIME_SMS_ADDRESS)) {
-                    data.setText(PhoneNumberUtils.formatNumber(entry.data));
+                    content.setText(PhoneNumberUtils.formatNumber(entry.data));
                 } else {
-                    data.setText(entry.data);
+                    content.setText(entry.data);
                 }
-                setMaxLines(data, entry.maxLines);
+                setMaxLines(content, entry.maxLines);
             }
 
             // Set the footer
