Merge "Making Event and Group selectors look like spinners" into honeycomb
diff --git a/src/com/android/contacts/list/ContactListAdapter.java b/src/com/android/contacts/list/ContactListAdapter.java
index 2183622..a6db641 100644
--- a/src/com/android/contacts/list/ContactListAdapter.java
+++ b/src/com/android/contacts/list/ContactListAdapter.java
@@ -234,9 +234,14 @@
     }
 
     protected void bindSectionHeaderAndDivider(ContactListItemView view, int position) {
-        Placement placement = getItemPlacementInSection(position);
-        view.setSectionHeader(placement.firstInSection ? placement.sectionHeader : null);
-        view.setDividerVisible(!placement.lastInSection);
+        if (isSectionHeaderDisplayEnabled()) {
+            Placement placement = getItemPlacementInSection(position);
+            view.setSectionHeader(placement.firstInSection ? placement.sectionHeader : null);
+            view.setDividerVisible(!placement.lastInSection);
+        } else {
+            view.setSectionHeader(null);
+            view.setDividerVisible(true);
+        }
     }
 
     protected void bindPhoto(final ContactListItemView view, int partitionIndex, Cursor cursor) {
diff --git a/src/com/android/contacts/list/PhoneNumberListAdapter.java b/src/com/android/contacts/list/PhoneNumberListAdapter.java
index ffd5ab9..48a6042 100644
--- a/src/com/android/contacts/list/PhoneNumberListAdapter.java
+++ b/src/com/android/contacts/list/PhoneNumberListAdapter.java
@@ -174,19 +174,12 @@
     }
 
     protected void bindSectionHeaderAndDivider(final ContactListItemView view, int position) {
-        final int section = getSectionForPosition(position);
-        if (getPositionForSection(section) == position) {
-            String title = (String)getSections()[section];
-            view.setSectionHeader(title);
+        if (isSectionHeaderDisplayEnabled()) {
+            Placement placement = getItemPlacementInSection(position);
+            view.setSectionHeader(placement.firstInSection ? placement.sectionHeader : null);
+            view.setDividerVisible(!placement.lastInSection);
         } else {
-            view.setDividerVisible(false);
             view.setSectionHeader(null);
-        }
-
-        // move the divider for the last item in a section
-        if (getPositionForSection(section + 1) - 1 == position) {
-            view.setDividerVisible(false);
-        } else {
             view.setDividerVisible(true);
         }
     }
@@ -205,10 +198,4 @@
 
         getPhotoLoader().loadPhoto(view.getPhotoView(), photoId);
     }
-//
-//    protected void bindSearchSnippet(final ContactListItemView view, Cursor cursor) {
-//        view.showSnippet(cursor, SUMMARY_SNIPPET_MIMETYPE_COLUMN_INDEX,
-//                SUMMARY_SNIPPET_DATA1_COLUMN_INDEX, SUMMARY_SNIPPET_DATA4_COLUMN_INDEX);
-//    }
-
 }
diff --git a/src/com/android/contacts/list/PhoneNumberPickerFragment.java b/src/com/android/contacts/list/PhoneNumberPickerFragment.java
index a84f4ff..071a370 100644
--- a/src/com/android/contacts/list/PhoneNumberPickerFragment.java
+++ b/src/com/android/contacts/list/PhoneNumberPickerFragment.java
@@ -36,6 +36,8 @@
     public PhoneNumberPickerFragment() {
         setQuickContactEnabled(false);
         setPhotoLoaderEnabled(true);
+        setVisibleScrollbarEnabled(true);
+        setSectionHeaderDisplayEnabled(true);
         setDirectorySearchMode(DirectoryListLoader.SEARCH_MODE_DATA_SHORTCUT);
     }
 
@@ -76,13 +78,6 @@
     }
 
     @Override
-    protected void configureAdapter() {
-        setSectionHeaderDisplayEnabled(!isSearchMode());
-        setVisibleScrollbarEnabled(!isSearchMode());
-        super.configureAdapter();
-    }
-
-    @Override
     protected View inflateView(LayoutInflater inflater, ViewGroup container) {
         return inflater.inflate(R.layout.contacts_list_content, null);
     }