Bring back account filter

- ContactListFilterController no longer loads accounts and groups,
to display in the action bar drop down menu. Now it just stores
current filter and saves it to preferences.
- ContactListFilterLoader is no longer needed because we're not
loading groups anymore
- Move adapter from ContactListFilterController to the
AccountFilterActivity
- AccountFilterActivity loads a list of accounts and returns
a ContactListFilter as an activity result based on the account
selected
- If "customize" is selected, then the CustomContactListFilterActivity
will be launched.
- Show header in contacts list according to what account filter
was selected
- Update filter activities to holo theme

- TODO: Remove the "display phones only" option in the
customize menu on the phone

Change-Id: I45e0bdee80e7885d39bf09183a66ec50d81d1982
diff --git a/res/layout/contact_list_filter.xml b/res/layout/contact_list_filter.xml
new file mode 100644
index 0000000..de05cf8
--- /dev/null
+++ b/res/layout/contact_list_filter.xml
@@ -0,0 +1,36 @@
+<?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.
+-->
+
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:fillViewport="true">
+
+    <ListView
+        android:id="@android:id/list"
+        android:layout_width="match_parent"
+        android:layout_height="0dip"
+        android:layout_weight="1" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dip"
+        android:layout_marginLeft="16dip"
+        android:layout_marginRight="16dip"
+        android:background="?android:attr/dividerHorizontal" />
+</LinearLayout>
diff --git a/res/layout/contacts_list_content.xml b/res/layout/contacts_list_content.xml
index 6792f9c..b92929b 100644
--- a/res/layout/contacts_list_content.xml
+++ b/res/layout/contacts_list_content.xml
@@ -21,6 +21,19 @@
     android:layout_height="match_parent"
     android:orientation="vertical">
 
+    <TextView
+        android:id="@+id/account_filter_header"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:singleLine="true"
+        android:ellipsize="end"
+        android:gravity="center"
+        android:padding="5dip"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@android:color/white"
+        android:background="@android:color/black"
+        android:visibility="gone" />
+
     <view
         class="com.android.contacts.list.ContactEntryListView"
         android:id="@android:id/list"
diff --git a/res/values-sw580dp/styles.xml b/res/values-sw580dp/styles.xml
index 32d02be..4f2b073 100644
--- a/res/values-sw580dp/styles.xml
+++ b/res/values-sw580dp/styles.xml
@@ -60,10 +60,11 @@
         <item name="list_item_header_text_size">14sp</item>
     </style>
 
-    <style name="CustomContactListFilterTheme" parent="@android:Theme.Holo.Light.Dialog">
+    <style name="ContactListFilterTheme" parent="@android:Theme.Holo.Light.Dialog">
+        <item name="android:windowCloseOnTouchOutside">true</item>
     </style>
 
-    <style name="CustomContactListFilterView" parent="CustomContactListFilterTheme">
+    <style name="CustomContactListFilterView" parent="ContactListFilterTheme">
         <item name="android:layout_width">400dip</item>
         <item name="android:layout_height">400dip</item>
     </style>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 821e5f8..a25b73d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -366,6 +366,9 @@
     <!-- Displayed at the top of the contacts showing the zero total number of contacts visible when a group or account is selected  [CHAR LIMIT=64]-->
     <string name="listTotalAllContactsZeroGroup">No contacts in <xliff:g id="name" example="Friends">%s</xliff:g></string>
 
+    <!-- Displayed at the top of the contacts showing the account filter selected  [CHAR LIMIT=64] -->
+    <string name="listAllContactsInAccount">Contacts in <xliff:g id="name" example="abc@gmail.com">%s</xliff:g></string>
+
     <!-- Displayed at the top of the contacts showing the total number of contacts found when "Only contacts with phones" not selected -->
     <plurals name="listFoundAllContacts">
         <item quantity="one">1 found</item>
@@ -1490,6 +1493,9 @@
     <!-- Title of the settings activity [CHAR LIMIT=64] -->
     <string name="activity_title_settings">Settings</string>
 
+    <!-- Title of the activity that allows the uesr to filter the list of contacts displayed according to account [CHAR LIMIT=25] -->
+    <string name="activity_title_contacts_filter">Contacts to display</string>
+
     <!-- Menu item for the settings activity [CHAR LIMIT=64] -->
     <string name="menu_settings">Settings</string>
 
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 067a730..914532c 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -227,7 +227,7 @@
     <style name="ContactsPreferencesTheme" parent="@android:Theme.Holo.Light">
     </style>
 
-    <style name="CustomContactListFilterTheme" parent="@android:Theme">
+    <style name="ContactListFilterTheme" parent="@android:Theme.Holo.Light">
     </style>
 
     <style name="ContactPickerLayout" parent="ContactPickerTheme">
@@ -235,7 +235,7 @@
         <item name="android:layout_height">match_parent</item>
     </style>
 
-    <style name="CustomContactListFilterView" parent="CustomContactListFilterTheme">
+    <style name="CustomContactListFilterView" parent="ContactListFilterTheme">
         <item name="android:layout_width">match_parent</item>
         <item name="android:layout_height">match_parent</item>
     </style>