DO NOT MERGE Visual tweaks for 7" tablets

- Move menu options into overflow menu for portrait for 7" and
keep anchored popup menu account selector for XOOM and
7" landscape
- Prevent custom filter dialog from being cut off at the bottom
- Prevent "no info for this contact" message from being cut off
in portrait
- Change narrow width values for interpolating layouts
- Fix editor spacing (field width, padding)
- Use sw580dp to disqualify any devices that have less than
580dp in either direction from showing any tablet UI

Bug: 3468527
Change-Id: I88628c36202897c330662565b592fd9b4e77180f
diff --git a/res/drawable-w580dp-hdpi/panel_message.9.png b/res/drawable-sw580dp-hdpi/panel_message.9.png
similarity index 100%
rename from res/drawable-w580dp-hdpi/panel_message.9.png
rename to res/drawable-sw580dp-hdpi/panel_message.9.png
Binary files differ
diff --git a/res/drawable-w580dp-mdpi/panel_message.9.png b/res/drawable-sw580dp-mdpi/panel_message.9.png
similarity index 100%
rename from res/drawable-w580dp-mdpi/panel_message.9.png
rename to res/drawable-sw580dp-mdpi/panel_message.9.png
Binary files differ
diff --git a/res/drawable-w580dp-nodpi/divider_vertical_dark.9.png b/res/drawable-sw580dp-nodpi/divider_vertical_dark.9.png
similarity index 100%
rename from res/drawable-w580dp-nodpi/divider_vertical_dark.9.png
rename to res/drawable-sw580dp-nodpi/divider_vertical_dark.9.png
Binary files differ
diff --git a/res/layout-sw580dp-w1000dp/contact_detail_empty.xml b/res/layout-sw580dp-w1000dp/contact_detail_empty.xml
new file mode 100644
index 0000000..51ea04c
--- /dev/null
+++ b/res/layout-sw580dp-w1000dp/contact_detail_empty.xml
@@ -0,0 +1,37 @@
+<?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.
+-->
+
+<!-- Placeholder for empty details for a contact -->
+
+<com.android.contacts.widget.InterpolatingLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+    <TextView android:id="@+id/emptyText"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/no_contact_details"
+        android:textSize="20sp"
+        android:textColor="?android:attr/textColorSecondary"
+        ex:layout_wideParentWidth="800dip"
+        ex:layout_wideMarginLeft="80dip"
+        ex:layout_narrowParentWidth="500dip"
+        ex:layout_narrowMarginLeft="44dip"
+        android:paddingTop="10dip"
+        android:lineSpacingMultiplier="0.92"
+    />
+</com.android.contacts.widget.InterpolatingLayout>
diff --git a/res/layout-w1000dp-land/contact_detail_header_view.xml b/res/layout-sw580dp-w1000dp/contact_detail_header_view.xml
similarity index 87%
rename from res/layout-w1000dp-land/contact_detail_header_view.xml
rename to res/layout-sw580dp-w1000dp/contact_detail_header_view.xml
index fb57202..82432a0 100644
--- a/res/layout-w1000dp-land/contact_detail_header_view.xml
+++ b/res/layout-sw580dp-w1000dp/contact_detail_header_view.xml
@@ -25,7 +25,7 @@
     <TextView
         android:id="@+id/attribution"
         android:layout_width="match_parent"
-        android:layout_height="56dip"
+        android:layout_height="@dimen/detail_header_attribution_height"
         android:paddingRight="16dip"
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:textColor="?android:attr/textColorTertiary"
@@ -60,7 +60,7 @@
                 android:layout_height="wrap_content"
                 android:orientation="horizontal"
                 android:paddingTop="16dip"
-                android:layout_marginLeft="16dip">
+                android:layout_marginLeft="@dimen/detail_header_view_margin">
 
                 <!-- Star -->
                 <CheckBox
@@ -77,33 +77,24 @@
                 <LinearLayout
                     android:layout_width="fill_parent"
                     android:layout_height="wrap_content"
-                    android:paddingLeft="16dip"
+                    android:paddingLeft="@dimen/detail_header_view_margin"
                     android:orientation="vertical">
 
                     <TextView
                         android:id="@+id/name"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:singleLine="true"
-                        android:ellipsize="end"
+                        style="@style/ContactDetailHeaderTextView"
                         android:textSize="@dimen/contact_name_text_size" />
 
                     <TextView
                         android:id="@+id/phonetic_name"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
+                        style="@style/ContactDetailHeaderTextView"
                         android:textAppearance="?android:attr/textAppearanceMedium"
-                        android:singleLine="true"
-                        android:ellipsize="end"
                         android:layout_marginTop="-2dip"
                         android:visibility="gone" />
 
                     <TextView
                         android:id="@+id/organization"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:singleLine="true"
-                        android:ellipsize="end"
+                        style="@style/ContactDetailHeaderTextView"
                         android:layout_marginTop="-2dip"
                         android:visibility="gone"
                         android:textAppearance="?android:attr/textAppearanceMedium"
diff --git a/res/layout-w1000dp-land/contact_detail_list_item.xml b/res/layout-sw580dp-w1000dp/contact_detail_list_item.xml
similarity index 100%
rename from res/layout-w1000dp-land/contact_detail_list_item.xml
rename to res/layout-sw580dp-w1000dp/contact_detail_list_item.xml
diff --git a/res/layout-w580dp/aggregation_suggestions.xml b/res/layout-sw580dp/aggregation_suggestions.xml
similarity index 100%
rename from res/layout-w580dp/aggregation_suggestions.xml
rename to res/layout-sw580dp/aggregation_suggestions.xml
diff --git a/res/layout-w580dp/aggregation_suggestions_item.xml b/res/layout-sw580dp/aggregation_suggestions_item.xml
similarity index 100%
rename from res/layout-w580dp/aggregation_suggestions_item.xml
rename to res/layout-sw580dp/aggregation_suggestions_item.xml
diff --git a/res/layout-w580dp/contact_browser.xml b/res/layout-sw580dp/contact_browser.xml
similarity index 100%
rename from res/layout-w580dp/contact_browser.xml
rename to res/layout-sw580dp/contact_browser.xml
diff --git a/res/layout-w580dp/contact_detail_fragment.xml b/res/layout-sw580dp/contact_detail_fragment.xml
similarity index 74%
rename from res/layout-w580dp/contact_detail_fragment.xml
rename to res/layout-sw580dp/contact_detail_fragment.xml
index 60d3cd5..7778736 100644
--- a/res/layout-w580dp/contact_detail_fragment.xml
+++ b/res/layout-sw580dp/contact_detail_fragment.xml
@@ -36,32 +36,17 @@
             ex:layout_wideParentWidth="800dip"
             ex:layout_wideMarginLeft="80dip"
             ex:layout_wideMarginRight="48dip"
-            ex:layout_narrowParentWidth="500dip"
-            ex:layout_narrowMarginLeft="15dip"
+            ex:layout_narrowParentWidth="300dip"
+            ex:layout_narrowMarginLeft="5dip"
             ex:layout_narrowMarginRight="16dip"
         />
     </com.android.contacts.widget.InterpolatingLayout>
 
     <!-- Placeholder for empty list -->
-    <com.android.contacts.widget.InterpolatingLayout
+    <include
         android:id="@android:id/empty"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:visibility="gone">
-        <TextView android:id="@+id/emptyText"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/no_contact_details"
-            android:textSize="20sp"
-            android:textColor="?android:attr/textColorSecondary"
-            ex:layout_wideParentWidth="800dip"
-            ex:layout_wideMarginLeft="64dip"
-            ex:layout_narrowParentWidth="500dip"
-            ex:layout_narrowMarginLeft="42dip"
-            android:paddingTop="10dip"
-            android:lineSpacingMultiplier="0.92"
-        />
-    </com.android.contacts.widget.InterpolatingLayout>
+        layout="@layout/contact_detail_empty"
+        android:visibility="gone" />
 
     <!-- Real list -->
     <com.android.contacts.widget.InterpolatingLayout
@@ -74,8 +59,8 @@
             ex:layout_wideParentWidth="800dip"
             ex:layout_wideMarginLeft="64dip"
             ex:layout_widePaddingRight="48dip"
-            ex:layout_narrowParentWidth="500dip"
-            ex:layout_narrowMarginLeft="32dip"
+            ex:layout_narrowParentWidth="300dip"
+            ex:layout_narrowMarginLeft="5dip"
             ex:layout_narrowPaddingRight="16dip"
             android:cacheColorHint="#00000000"
             android:divider="@android:color/transparent"
diff --git a/res/layout-w580dp/contact_detail_header_view.xml b/res/layout-sw580dp/contact_detail_header_view.xml
similarity index 87%
rename from res/layout-w580dp/contact_detail_header_view.xml
rename to res/layout-sw580dp/contact_detail_header_view.xml
index 19132dd..52c21eb 100644
--- a/res/layout-w580dp/contact_detail_header_view.xml
+++ b/res/layout-sw580dp/contact_detail_header_view.xml
@@ -25,7 +25,7 @@
     <TextView
         android:id="@+id/attribution"
         android:layout_width="match_parent"
-        android:layout_height="56dip"
+        android:layout_height="@dimen/detail_header_attribution_height"
         android:paddingRight="24dip"
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:textColor="?android:attr/textColorTertiary"
@@ -39,7 +39,7 @@
 
         <ImageView
             android:id="@+id/photo"
-            android:layout_marginLeft="16dip"
+            android:layout_marginLeft="@dimen/detail_header_view_margin"
             android:layout_width="96dip"
             android:layout_height="96dip" />
 
@@ -60,7 +60,7 @@
                 android:layout_height="wrap_content"
                 android:orientation="horizontal"
                 android:paddingTop="16dip"
-                android:layout_marginLeft="16dip">
+                android:layout_marginLeft="@dimen/detail_header_view_margin">
 
                 <!-- Star -->
                 <CheckBox
@@ -77,31 +77,24 @@
                 <LinearLayout
                     android:layout_width="fill_parent"
                     android:layout_height="wrap_content"
-                    android:paddingLeft="16dip"
+                    android:paddingLeft="@dimen/detail_header_view_margin"
                     android:orientation="vertical">
 
                     <TextView
                         android:id="@+id/name"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:singleLine="true"
-                        android:ellipsize="end"
+                        style="@style/ContactDetailHeaderTextView"
                         android:textSize="@dimen/contact_name_text_size" />
 
                     <TextView
                         android:id="@+id/phonetic_name"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
+                        style="@style/ContactDetailHeaderTextView"
                         android:textAppearance="?android:attr/textAppearanceMedium"
-                        android:singleLine="true"
-                        android:ellipsize="end"
                         android:layout_marginTop="-2dip"
                         android:visibility="gone" />
 
                     <TextView
                         android:id="@+id/organization"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
+                        style="@style/ContactDetailHeaderTextView"
                         android:layout_marginTop="-2dip"
                         android:visibility="gone"
                         android:textAppearance="?android:attr/textAppearanceMedium"
diff --git a/res/layout-w580dp/contact_editor_activity.xml b/res/layout-sw580dp/contact_editor_activity.xml
similarity index 100%
rename from res/layout-w580dp/contact_editor_activity.xml
rename to res/layout-sw580dp/contact_editor_activity.xml
diff --git a/res/layout-w580dp/contact_editor_fragment.xml b/res/layout-sw580dp/contact_editor_fragment.xml
similarity index 100%
rename from res/layout-w580dp/contact_editor_fragment.xml
rename to res/layout-sw580dp/contact_editor_fragment.xml
diff --git a/res/layout-w580dp/contact_picker_content.xml b/res/layout-sw580dp/contact_picker_content.xml
similarity index 100%
rename from res/layout-w580dp/contact_picker_content.xml
rename to res/layout-sw580dp/contact_picker_content.xml
diff --git a/res/layout-w580dp/external_raw_contact_editor_view.xml b/res/layout-sw580dp/external_raw_contact_editor_view.xml
similarity index 92%
rename from res/layout-w580dp/external_raw_contact_editor_view.xml
rename to res/layout-sw580dp/external_raw_contact_editor_view.xml
index 0304c48..b185c8a 100644
--- a/res/layout-w580dp/external_raw_contact_editor_view.xml
+++ b/res/layout-sw580dp/external_raw_contact_editor_view.xml
@@ -43,7 +43,7 @@
                 android:layout_gravity="top|left"
                 ex:layout_wideParentWidth="960dip"
                 ex:layout_wideMarginLeft="96dip"
-                ex:layout_narrowParentWidth="800dip"
+                ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
                 ex:layout_narrowMarginLeft="15dip">
 
                 <include
@@ -58,7 +58,7 @@
                 android:layout_gravity="top"
                 ex:layout_wideParentWidth="960dip"
                 ex:layout_wideMarginRight="48dip"
-                ex:layout_narrowParentWidth="800dip"
+                ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
                 ex:layout_narrowMarginRight="15dip"
                 android:orientation="vertical">
 
@@ -71,7 +71,7 @@
                     android:id="@+id/read_only_name"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginLeft="64dip"
+                    android:layout_marginLeft="@dimen/editor_name_text_field_left_margin"
                     android:layout_marginRight="48dip"
                     android:layout_marginTop="6dip"
                     android:layout_marginBottom="4dip"
@@ -91,7 +91,7 @@
                 ex:layout_wideParentWidth="960dip"
                 ex:layout_wideMarginLeft="96dip"
                 ex:layout_wideMarginRight="96dip"
-                ex:layout_narrowParentWidth="800dip"
+                ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
                 ex:layout_narrowMarginLeft="15dip"
                 ex:layout_narrowMarginRight="15dip">
 
@@ -132,7 +132,7 @@
                 ex:layout_wideParentWidth="960dip"
                 ex:layout_wideMarginLeft="246dip"
                 ex:layout_wideMarginRight="156dip"
-                ex:layout_narrowParentWidth="800dip"
+                ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
                 ex:layout_narrowMarginLeft="165dip"
                 ex:layout_narrowMarginRight="121dip"
                 android:layout_width="match_parent"
diff --git a/res/layout-w580dp/item_group_membership.xml b/res/layout-sw580dp/item_group_membership.xml
similarity index 97%
rename from res/layout-w580dp/item_group_membership.xml
rename to res/layout-sw580dp/item_group_membership.xml
index 41d77b7..985b7ae 100644
--- a/res/layout-w580dp/item_group_membership.xml
+++ b/res/layout-sw580dp/item_group_membership.xml
@@ -24,7 +24,7 @@
 
     <TextView
         android:id="@+id/kind_title"
-        android:layout_width="150dip"
+        android:layout_width="@dimen/editor_title_label_width"
         android:layout_height="@dimen/editor_min_line_item_height"
         android:gravity="center_vertical"
         android:textAppearance="?android:attr/textAppearanceSmall"
diff --git a/res/layout-w580dp/item_kind_section.xml b/res/layout-sw580dp/item_kind_section.xml
similarity index 97%
rename from res/layout-w580dp/item_kind_section.xml
rename to res/layout-sw580dp/item_kind_section.xml
index 57de26d..eaae563 100644
--- a/res/layout-w580dp/item_kind_section.xml
+++ b/res/layout-sw580dp/item_kind_section.xml
@@ -24,7 +24,7 @@
 
     <TextView
         android:id="@+id/kind_title"
-        android:layout_width="150dip"
+        android:layout_width="@dimen/editor_title_label_width"
         android:layout_height="@dimen/editor_min_line_item_height"
         android:gravity="center_vertical"
         android:textColor="#7F7F7F"
diff --git a/res/layout-w580dp/list_section.xml b/res/layout-sw580dp/list_section.xml
similarity index 100%
rename from res/layout-w580dp/list_section.xml
rename to res/layout-sw580dp/list_section.xml
diff --git a/res/layout-w580dp/raw_contact_editor_header.xml b/res/layout-sw580dp/raw_contact_editor_header.xml
similarity index 100%
rename from res/layout-w580dp/raw_contact_editor_header.xml
rename to res/layout-sw580dp/raw_contact_editor_header.xml
diff --git a/res/layout-w580dp/raw_contact_editor_view.xml b/res/layout-sw580dp/raw_contact_editor_view.xml
similarity index 86%
rename from res/layout-w580dp/raw_contact_editor_view.xml
rename to res/layout-sw580dp/raw_contact_editor_view.xml
index 3c3b9d0..eef82ec 100644
--- a/res/layout-w580dp/raw_contact_editor_view.xml
+++ b/res/layout-sw580dp/raw_contact_editor_view.xml
@@ -43,8 +43,8 @@
                 android:layout_gravity="top|left"
                 ex:layout_wideParentWidth="960dip"
                 ex:layout_wideMarginLeft="96dip"
-                ex:layout_narrowParentWidth="800dip"
-                ex:layout_narrowMarginLeft="15dip">
+                ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
+                ex:layout_narrowMarginLeft="20dip">
 
                 <include
                     android:id="@+id/edit_photo"
@@ -58,8 +58,10 @@
                 android:layout_gravity="top"
                 ex:layout_wideParentWidth="960dip"
                 ex:layout_wideMarginRight="48dip"
-                ex:layout_narrowParentWidth="800dip"
+                ex:layout_wideMarginLeft="10dip"
+                ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
                 ex:layout_narrowMarginRight="15dip"
+                ex:layout_narrowMarginLeft="5dip"
                 android:orientation="vertical">
 
                 <View
@@ -72,7 +74,7 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:paddingRight="?android:attr/scrollbarSize"
-                    android:layout_marginLeft="52dip"
+                    android:layout_marginLeft="@dimen/editor_name_text_field_left_margin"
                     android:layout_marginRight="48dip"
                     android:layout_marginTop="6dip"
                     android:layout_marginBottom="4dip" />
@@ -82,7 +84,7 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:paddingRight="?android:attr/scrollbarSize"
-                    android:layout_marginLeft="52dip"
+                    android:layout_marginLeft="@dimen/editor_name_text_field_left_margin"
                     android:layout_marginRight="48dip"
                     android:layout_marginTop="6dip"
                     android:layout_marginBottom="4dip" />
@@ -90,7 +92,7 @@
                 <FrameLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginLeft="52dip"
+                    android:layout_marginLeft="@dimen/editor_name_text_field_left_margin"
                     android:layout_marginRight="48dip">
                     <ViewStub
                         android:id="@+id/aggregation_suggestion_stub"
@@ -113,16 +115,16 @@
                 ex:layout_wideParentWidth="960dip"
                 ex:layout_wideMarginLeft="96dip"
                 ex:layout_wideMarginRight="48dip"
-                ex:layout_narrowParentWidth="800dip"
-                ex:layout_narrowMarginLeft="15dip"
-                ex:layout_narrowMarginRight="15dip">
+                ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
+                ex:layout_narrowMarginLeft="25dip"
+                ex:layout_narrowMarginRight="10dip">
 
                 <LinearLayout
                     android:id="@+id/sect_fields"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:orientation="vertical"
-                    android:paddingRight="?android:attr/scrollbarSize" />
+                    android:paddingRight="@dimen/editor_name_text_field_right_margin" />
             </LinearLayout>
         </com.android.contacts.widget.InterpolatingLayout>
 
@@ -137,7 +139,7 @@
                 ex:layout_wideParentWidth="960dip"
                 ex:layout_wideMarginLeft="246dip"
                 ex:layout_wideMarginRight="156dip"
-                ex:layout_narrowParentWidth="800dip"
+                ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
                 ex:layout_narrowMarginLeft="165dip"
                 ex:layout_narrowMarginRight="121dip"
                 android:layout_width="match_parent"
diff --git a/res/layout-w580dp/search_header.xml b/res/layout-sw580dp/search_header.xml
similarity index 100%
rename from res/layout-w580dp/search_header.xml
rename to res/layout-sw580dp/search_header.xml
diff --git a/res/layout-w580dp/total_contacts.xml b/res/layout-sw580dp/total_contacts.xml
similarity index 100%
rename from res/layout-w580dp/total_contacts.xml
rename to res/layout-sw580dp/total_contacts.xml
diff --git a/res/layout/contact_detail_empty.xml b/res/layout/contact_detail_empty.xml
new file mode 100644
index 0000000..e1ba04a
--- /dev/null
+++ b/res/layout/contact_detail_empty.xml
@@ -0,0 +1,29 @@
+<?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.
+-->
+
+<!-- Placeholder for empty details for a contact -->
+
+<TextView
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:text="@string/no_contact_details"
+    android:textSize="20sp"
+    android:textColor="?android:attr/textColorSecondary"
+    android:layout_marginLeft="15dip"
+    android:paddingTop="10dip"
+    android:lineSpacingMultiplier="0.92"
+/>
\ 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..fb71d87 100644
--- a/res/layout/contact_detail_list_item.xml
+++ b/res/layout/contact_detail_list_item.xml
@@ -38,7 +38,7 @@
             android:gravity="center_vertical"
             android:layout_width="match_parent"
             android:layout_height="31dip"
-            android:paddingLeft="16dip"
+            android:paddingLeft="8dip"
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:textColor="?android:attr/textColorTertiary" />
         <ImageView
@@ -60,7 +60,7 @@
         android:layout_height="wrap_content"
         android:minHeight="@dimen/detail_min_line_item_height"
         android:orientation="horizontal"
-        android:paddingLeft="31dip"
+        android:paddingLeft="15dip"
         android:gravity="center_vertical">
         <LinearLayout
             android:layout_width="0dip"
diff --git a/res/menu-sw580dp-w720dp/actions.xml b/res/menu-sw580dp-w720dp/actions.xml
new file mode 100644
index 0000000..86b77b6
--- /dev/null
+++ b/res/menu-sw580dp-w720dp/actions.xml
@@ -0,0 +1,45 @@
+<?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.
+-->
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:id="@+id/menu_add"
+        android:showAsAction="always" />
+
+    <item
+        android:id="@+id/menu_settings"
+        android:icon="@drawable/ic_menu_settings_holo_light"
+        android:title="@string/menu_settings" />
+
+    <item
+        android:id="@+id/menu_accounts"
+        android:icon="@drawable/ic_menu_accounts_holo_light"
+        android:title="@string/menu_accounts" />
+
+    <item
+        android:id="@+id/menu_import_export"
+        android:icon="@drawable/ic_menu_import_export_holo_light"
+        android:title="@string/menu_import_export" />
+
+    <item
+        android:id="@+id/menu_rename_group"
+        android:icon="@drawable/ic_menu_settings_holo_light"
+        android:title="@string/menu_renameGroup" />
+
+    <item
+        android:id="@+id/menu_delete_group"
+        android:icon="@drawable/ic_menu_trash_holo_light"
+        android:title="@string/menu_deleteGroup" />
+</menu>
diff --git a/res/menu-sw580dp-w720dp/view.xml b/res/menu-sw580dp-w720dp/view.xml
new file mode 100644
index 0000000..5be1b6b
--- /dev/null
+++ b/res/menu-sw580dp-w720dp/view.xml
@@ -0,0 +1,40 @@
+<?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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:id="@+id/menu_edit"
+        android:icon="@drawable/ic_menu_compose_holo_light"
+        android:title="@string/menu_editContact"
+        android:alphabeticShortcut="e"
+        android:showAsAction="always" />
+
+    <item
+        android:id="@+id/menu_share"
+        android:icon="@drawable/ic_menu_share_holo_light"
+        android:title="@string/menu_share"
+        android:alphabeticShortcut="s" />
+
+    <item
+        android:id="@+id/menu_options"
+        android:icon="@drawable/ic_menu_mark"
+        android:title="@string/menu_contactOptions" />
+
+    <item
+        android:id="@+id/menu_delete"
+        android:icon="@drawable/ic_menu_trash_holo_light"
+        android:title="@string/menu_deleteContact" />
+</menu>
diff --git a/res/menu-sw580dp/actions.xml b/res/menu-sw580dp/actions.xml
new file mode 100644
index 0000000..de5110f
--- /dev/null
+++ b/res/menu-sw580dp/actions.xml
@@ -0,0 +1,46 @@
+<?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.
+-->
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:id="@+id/menu_new_contact"
+        android:icon="@drawable/ic_menu_add_contact_holo_light"
+        android:title="@string/menu_new_contact_action_bar" />
+
+    <item
+        android:id="@+id/menu_settings"
+        android:icon="@drawable/ic_menu_settings_holo_light"
+        android:title="@string/menu_settings" />
+
+    <item
+        android:id="@+id/menu_accounts"
+        android:icon="@drawable/ic_menu_accounts_holo_light"
+        android:title="@string/menu_accounts" />
+
+    <item
+        android:id="@+id/menu_import_export"
+        android:icon="@drawable/ic_menu_import_export_holo_light"
+        android:title="@string/menu_import_export" />
+
+    <item
+        android:id="@+id/menu_rename_group"
+        android:icon="@drawable/ic_menu_settings_holo_light"
+        android:title="@string/menu_renameGroup" />
+
+    <item
+        android:id="@+id/menu_delete_group"
+        android:icon="@drawable/ic_menu_trash_holo_light"
+        android:title="@string/menu_deleteGroup" />
+</menu>
diff --git a/res/menu-sw580dp/view.xml b/res/menu-sw580dp/view.xml
new file mode 100644
index 0000000..7cf17d6
--- /dev/null
+++ b/res/menu-sw580dp/view.xml
@@ -0,0 +1,39 @@
+<?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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:id="@+id/menu_edit"
+        android:icon="@drawable/ic_menu_compose_holo_light"
+        android:title="@string/menu_editContact"
+        android:alphabeticShortcut="e" />
+
+    <item
+        android:id="@+id/menu_share"
+        android:icon="@drawable/ic_menu_share_holo_light"
+        android:title="@string/menu_share"
+        android:alphabeticShortcut="s" />
+
+    <item
+        android:id="@+id/menu_options"
+        android:icon="@drawable/ic_menu_mark"
+        android:title="@string/menu_contactOptions" />
+
+    <item
+        android:id="@+id/menu_delete"
+        android:icon="@drawable/ic_menu_trash_holo_light"
+        android:title="@string/menu_deleteContact" />
+</menu>
diff --git a/res/values-w1000dp-land/dimens.xml b/res/values-sw580dp-w1000dp/dimens.xml
similarity index 88%
rename from res/values-w1000dp-land/dimens.xml
rename to res/values-sw580dp-w1000dp/dimens.xml
index 52c521e..45da0a8 100644
--- a/res/values-w1000dp-land/dimens.xml
+++ b/res/values-sw580dp-w1000dp/dimens.xml
@@ -19,4 +19,6 @@
     <dimen name="action_bar_filter_max_width">300dip</dimen>
     <dimen name="action_bar_search_max_width">336dip</dimen>
     <dimen name="action_bar_search_spacing">32dip</dimen>
+    <dimen name="detail_header_view_margin">16dip</dimen>
+    <dimen name="detail_header_attribution_height">56dip</dimen>
 </resources>
diff --git a/res/values-sw580dp-w720dp/dimens.xml b/res/values-sw580dp-w720dp/dimens.xml
new file mode 100644
index 0000000..399c26c
--- /dev/null
+++ b/res/values-sw580dp-w720dp/dimens.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+<resources>
+    <dimen name="editor_type_label_width">180dip</dimen>
+    <dimen name="editor_round_button_padding_left">8dip</dimen>
+    <dimen name="editor_round_button_padding_right">8dip</dimen>
+    <dimen name="editor_name_text_field_left_margin">52dip</dimen>
+    <dimen name="editor_title_label_width">150dip</dimen>
+    <dimen name="editor_interpolator_narrow_width">800dip</dimen>
+    <dimen name="editor_name_text_field_right_margin">10dip</dimen>
+</resources>
diff --git a/res/values-sw580dp-w720dp/styles.xml b/res/values-sw580dp-w720dp/styles.xml
new file mode 100644
index 0000000..ad21632
--- /dev/null
+++ b/res/values-sw580dp-w720dp/styles.xml
@@ -0,0 +1,47 @@
+<?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.
+-->
+<resources>
+    <style name="ContactBrowserTheme" parent="@android:Theme.Holo.Light">
+        <item name="list_item_height">66dip</item>
+        <item name="activated_background">@drawable/list_item_activated_background</item>
+        <item name="android:windowContentOverlay">@null</item>
+        <item name="android:actionBarStyle">@style/TransparentActionBarStyle</item>
+        <item name="section_header_background">@drawable/list_title_holo</item>
+        <item name="list_item_divider">?android:attr/listDivider</item>
+        <item name="list_item_padding_top">0dip</item>
+        <item name="list_item_padding_right">24dip</item>
+        <item name="list_item_padding_bottom">0dip</item>
+        <item name="list_item_padding_left">0dip</item>
+        <item name="list_item_gap_between_image_and_text">16dip</item>
+        <item name="list_item_gap_between_label_and_data">5dip</item>
+        <item name="list_item_call_button_padding">14dip</item>
+        <item name="list_item_vertical_divider_margin">5dip</item>
+        <item name="list_item_presence_icon_margin">30dip</item>
+        <item name="list_item_photo_size">64dip</item>
+        <item name="list_item_prefix_highlight_color">#729a27</item>
+        <item name="list_item_header_text_indent">77dip</item>
+        <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>
+    </style>
+
+    <style name="ContactDetailHeaderTextView">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:singleLine">true</item>
+        <item name="android:ellipsize">end</item>
+    </style>
+</resources>
diff --git a/res/values-w580dp/colors.xml b/res/values-sw580dp/colors.xml
similarity index 100%
rename from res/values-w580dp/colors.xml
rename to res/values-sw580dp/colors.xml
diff --git a/res/values-w580dp/dimens.xml b/res/values-sw580dp/dimens.xml
similarity index 100%
rename from res/values-w580dp/dimens.xml
rename to res/values-sw580dp/dimens.xml
diff --git a/res/values-w580dp/styles.xml b/res/values-sw580dp/styles.xml
similarity index 95%
rename from res/values-w580dp/styles.xml
rename to res/values-sw580dp/styles.xml
index e601590..caa5283 100644
--- a/res/values-w580dp/styles.xml
+++ b/res/values-sw580dp/styles.xml
@@ -22,14 +22,14 @@
         <item name="section_header_background">@drawable/list_title_holo</item>
         <item name="list_item_divider">?android:attr/listDivider</item>
         <item name="list_item_padding_top">0dip</item>
-        <item name="list_item_padding_right">24dip</item>
+        <item name="list_item_padding_right">20dip</item>
         <item name="list_item_padding_bottom">0dip</item>
         <item name="list_item_padding_left">0dip</item>
-        <item name="list_item_gap_between_image_and_text">16dip</item>
+        <item name="list_item_gap_between_image_and_text">8dip</item>
         <item name="list_item_gap_between_label_and_data">5dip</item>
         <item name="list_item_call_button_padding">14dip</item>
         <item name="list_item_vertical_divider_margin">5dip</item>
-        <item name="list_item_presence_icon_margin">30dip</item>
+        <item name="list_item_presence_icon_margin">18dip</item>
         <item name="list_item_photo_size">64dip</item>
         <item name="list_item_prefix_highlight_color">#729a27</item>
         <item name="list_item_header_text_indent">77dip</item>
@@ -65,7 +65,7 @@
 
     <style name="CustomContactListFilterView" parent="CustomContactListFilterTheme">
         <item name="android:layout_width">400dip</item>
-        <item name="android:layout_height">600dip</item>
+        <item name="android:layout_height">400dip</item>
     </style>
 
     <style name="ContactPickerLayout" parent="ContactPickerTheme">
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 47150b4..3aca306 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -35,17 +35,35 @@
     <dimen name="quick_contact_width">352dip</dimen>
 
     <!-- Padding of the rounded plus/minus/expand/collapse buttons in the editor  -->
-    <dimen name="editor_round_button_padding_left">8dip</dimen>
-    <dimen name="editor_round_button_padding_right">8dip</dimen>
+    <dimen name="editor_round_button_padding_left">2dip</dimen>
+    <dimen name="editor_round_button_padding_right">2dip</dimen>
     <dimen name="editor_round_button_padding_top">8dip</dimen>
     <dimen name="editor_round_button_padding_bottom">8dip</dimen>
 
     <!-- Width of the Type-Label in the Editor -->
-    <dimen name="editor_type_label_width">180dip</dimen>
+    <dimen name="editor_type_label_width">140dip</dimen>
     
     <!-- Minimum height of a row in the Editor -->
     <dimen name="editor_min_line_item_height">48dip</dimen>
 
+    <!-- Left margin of the name text input fields and the photo in the contact editor -->
+    <dimen name="editor_name_text_field_left_margin">25dip</dimen>
+
+    <!-- Right margin of the text input fields in the contact editor -->
+    <dimen name="editor_name_text_field_right_margin">0dip</dimen>
+
+    <!-- Width of the title labels in the contact editor -->
+    <dimen name="editor_title_label_width">120dip</dimen>
+
+    <!-- Interpolator layout narrow width value of the contact editor -->
+    <dimen name="editor_interpolator_narrow_width">600dip</dimen>
+
+    <!-- Height of the attribution text view in the contact detail header view -->
+    <dimen name="detail_header_attribution_height">40dip</dimen>
+
+    <!-- Margin between the photo, the star, and text in the contact detail header view -->
+    <dimen name="detail_header_view_margin">8dip</dimen>
+
     <!-- Minimum height of a row in the contact detail -->
     <dimen name="detail_min_line_item_height">48dip</dimen>
 
diff --git a/res/values/styles.xml b/res/values/styles.xml
index db50204..8aa527d 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -208,4 +208,9 @@
         <item name="android:layout_height">2dip</item>
         <item name="android:layout_width">match_parent</item>
     </style>
+
+    <style name="ContactDetailHeaderTextView">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">wrap_content</item>
+    </style>
 </resources>
diff --git a/src/com/android/contacts/activities/ContactBrowserActivity.java b/src/com/android/contacts/activities/ContactBrowserActivity.java
index e888bc0..f58a28c 100644
--- a/src/com/android/contacts/activities/ContactBrowserActivity.java
+++ b/src/com/android/contacts/activities/ContactBrowserActivity.java
@@ -163,16 +163,6 @@
     protected void onCreate(Bundle savedState) {
         super.onCreate(savedState);
 
-        mAddContactImageView = getLayoutInflater().inflate(
-                R.layout.add_contact_menu_item, null, false);
-        View item = mAddContactImageView.findViewById(R.id.menu_item);
-        item.setOnClickListener(new OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                createNewContact();
-            }
-        });
-
         configureContentView(true, savedState);
     }
 
@@ -631,9 +621,24 @@
         if (mHasActionBar) {
             inflater.inflate(R.menu.actions, menu);
 
-            // Change add contact button to button with a custom view
+            // On narrow screens we specify a NEW contact button in the {@link ActionBar}, so that
+            // it can be in the overflow menu. On wide screens, we use a custom view because we need
+            // its location for anchoring the account-selector popup.
+            // TODO: Take this hack out later when the account switcher in the contact editor is
+            // present.
             final MenuItem addContact = menu.findItem(R.id.menu_add);
-            addContact.setActionView(mAddContactImageView);
+            if (addContact != null) {
+                mAddContactImageView = getLayoutInflater().inflate(
+                        R.layout.add_contact_menu_item, null, false);
+                View item = mAddContactImageView.findViewById(R.id.menu_item);
+                item.setOnClickListener(new OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        createNewContact();
+                    }
+                });
+                addContact.setActionView(mAddContactImageView);
+            }
             return true;
         } else if (mRequest.getActionCode() == ContactsRequest.ACTION_DEFAULT ||
                 mRequest.getActionCode() == ContactsRequest.ACTION_STREQUENT) {
@@ -740,6 +745,10 @@
                 return true;
             }
             case R.id.menu_add: {
+                createNewContact();
+                return true;
+            }
+            case R.id.menu_new_contact: {
                 final Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
                 startActivityForResult(intent, SUBACTIVITY_NEW_CONTACT);
                 return true;