Moving ContactListItemView and dependent classes.

Further clean-up of PhoneFavoriteFragment in Dialer app to move all necessary
dependencies into Contacts Common package.

Bug: 6993891
Change-Id: Ie310707da47d5e5c91e281d140f11e1eb47a5118
diff --git a/res-common/drawable-hdpi/list_section_divider_holo_custom.9.png b/res-common/drawable-hdpi/list_section_divider_holo_custom.9.png
new file mode 100644
index 0000000..1e3e778
--- /dev/null
+++ b/res-common/drawable-hdpi/list_section_divider_holo_custom.9.png
Binary files differ
diff --git a/res-common/drawable-mdpi/list_section_divider_holo_custom.9.png b/res-common/drawable-mdpi/list_section_divider_holo_custom.9.png
new file mode 100644
index 0000000..1d8fd09
--- /dev/null
+++ b/res-common/drawable-mdpi/list_section_divider_holo_custom.9.png
Binary files differ
diff --git a/res-common/drawable-xhdpi/list_section_divider_holo_custom.9.png b/res-common/drawable-xhdpi/list_section_divider_holo_custom.9.png
new file mode 100644
index 0000000..0bd8a0f
--- /dev/null
+++ b/res-common/drawable-xhdpi/list_section_divider_holo_custom.9.png
Binary files differ
diff --git a/res-common/layout/directory_header.xml b/res-common/layout/directory_header.xml
new file mode 100644
index 0000000..fcd255e
--- /dev/null
+++ b/res-common/layout/directory_header.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<!-- Layout used for list section separators. -->
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    style="@style/DirectoryHeader"
+    android:id="@+id/directory_header"
+    android:paddingLeft="?attr/list_item_padding_left"
+    android:paddingRight="?attr/list_item_padding_right"
+    android:minHeight="@dimen/list_section_divider_min_height"
+    android:layout_marginTop="@dimen/list_header_extra_top_padding"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    >
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_vertical"
+        android:background="@drawable/list_section_divider_holo_custom"
+        >
+        <TextView
+            android:id="@+id/label"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="8dip"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textColor="@color/people_app_theme_color"
+            android:singleLine="true"
+            android:textStyle="bold"
+            android:textAllCaps="true" />
+        <TextView
+            android:id="@+id/display_name"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="8dip"
+            android:layout_marginRight="8dip"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textColor="@color/people_app_theme_color"
+            android:singleLine="true"
+            android:textStyle="bold"
+            android:textAllCaps="true" />
+        <TextView
+            android:id="@+id/count"
+            android:paddingTop="1dip"
+            android:layout_width="0dip"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:gravity="right"
+            android:singleLine="true"
+            android:textSize="12sp"
+            android:textColor="@color/contact_count_text_color" />
+    </LinearLayout>
+</FrameLayout>
diff --git a/res-common/values/attrs.xml b/res-common/values/attrs.xml
new file mode 100644
index 0000000..eae9c36
--- /dev/null
+++ b/res-common/values/attrs.xml
@@ -0,0 +1,48 @@
+<!--
+  ~ Copyright (C) 2012 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>
+
+    <declare-styleable name="ContactListItemView">
+        <attr name="list_item_height" format="dimension"/>
+        <attr name="list_section_header_height" format="dimension"/>
+        <attr name="activated_background" format="reference"/>
+        <attr name="section_header_background" format="reference"/>
+        <attr name="list_item_divider" format="reference"/>
+        <attr name="list_item_padding_top" format="dimension"/>
+        <attr name="list_item_padding_right" format="dimension"/>
+        <attr name="list_item_padding_bottom" format="dimension"/>
+        <attr name="list_item_padding_left" format="dimension"/>
+        <attr name="list_item_gap_between_image_and_text" format="dimension"/>
+        <attr name="list_item_gap_between_label_and_data" format="dimension"/>
+        <attr name="list_item_presence_icon_margin" format="dimension"/>
+        <attr name="list_item_presence_icon_size" format="dimension"/>
+        <attr name="list_item_photo_size" format="dimension"/>
+        <attr name="list_item_profile_photo_size" format="dimension"/>
+        <attr name="list_item_prefix_highlight_color" format="color"/>
+        <attr name="list_item_header_text_indent" format="dimension"/>
+        <attr name="list_item_header_text_color" format="color"/>
+        <attr name="list_item_header_text_size" format="dimension"/>
+        <attr name="list_item_header_height" format="dimension"/>
+        <attr name="list_item_header_underline_height" format="dimension"/>
+        <attr name="list_item_header_underline_color" format="color"/>
+        <attr name="list_item_contacts_count_text_color" format="color"/>
+        <attr name="list_item_text_indent" format="dimension"/>
+        <attr name="list_item_contacts_count_text_size" format="dimension"/>
+        <attr name="list_item_data_width_weight" format="integer"/>
+        <attr name="list_item_label_width_weight" format="integer"/>
+    </declare-styleable>
+</resources>
diff --git a/res-common/values/colors.xml b/res-common/values/colors.xml
index 5f9044a..13eadd3 100644
--- a/res-common/values/colors.xml
+++ b/res-common/values/colors.xml
@@ -16,6 +16,12 @@
 
 <resources>
 
+    <!-- Colors in the contact browser list -->
+    <color name="contact_count_text_color">#AAAAAA</color>
+
+    <!-- Color of the theme of the People app -->
+    <color name="people_app_theme_color">#33B5E5</color>
+
     <!-- Color of image view placeholder. -->
     <color name="image_placeholder">#DDDDDD</color>
 
diff --git a/res-common/values/dimens.xml b/res-common/values/dimens.xml
new file mode 100644
index 0000000..c17234c
--- /dev/null
+++ b/res-common/values/dimens.xml
@@ -0,0 +1,27 @@
+<!--
+  ~ Copyright (C) 2012 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>
+
+    <!-- Padding between the action bar's bottom edge and the first header
+         in contacts/group lists. -->
+    <dimen name="list_header_extra_top_padding">0dip</dimen>
+
+    <!-- Minimum height used with @drawable/list_section_divider_holo_custom.
+         Right now the drawable has implicit 32dip minimal height, which is confusing.
+         This value is for making the hidden configuration explicit in xml. -->
+    <dimen name="list_section_divider_min_height">32dip</dimen>
+</resources>
diff --git a/res-common/values/donottranslate_config.xml b/res-common/values/donottranslate_config.xml
new file mode 100644
index 0000000..8603bb7
--- /dev/null
+++ b/res-common/values/donottranslate_config.xml
@@ -0,0 +1,30 @@
+<!--
+  ~ Copyright (C) 2012 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>
+
+    <!-- If true, an option is shown in Display Options UI to choose a sort order -->
+    <bool name="config_sort_order_user_changeable">true</bool>
+
+    <!-- If true, the default sort order is primary (i.e. by given name) -->
+    <bool name="config_default_sort_order_primary">true</bool>
+
+    <!-- If true, an option is shown in Display Options UI to choose a name display order -->
+    <bool name="config_display_order_user_changeable">true</bool>
+
+    <!-- If true, the default sort order is primary (i.e. by given name) -->
+    <bool name="config_default_display_order_primary">true</bool>
+</resources>
diff --git a/res-common/values/strings.xml b/res-common/values/strings.xml
index 7e28847..87ea719 100644
--- a/res-common/values/strings.xml
+++ b/res-common/values/strings.xml
@@ -135,4 +135,46 @@
     <!--  Used to display as default status when the contact is busy or Do not disturb for chat [CHAR LIMIT=19] -->
     <string name="status_busy">Busy</string>
 
+    <!-- Directory partition name (also exists in contacts) -->
+    <string name="contactsList">Contacts</string>
+
+    <!-- The name of the invisible local contact directory -->
+    <string name="local_invisible_directory">Other</string>
+
+    <!-- The label in section header in the contact list for a contact directory [CHAR LIMIT=128] -->
+    <string name="directory_search_label">Directory</string>
+
+    <!-- The label in section header in the contact list for a local contacts [CHAR LIMIT=128] -->
+    <string name="local_search_label">All contacts</string>
+
+    <!-- String describing the text on the header of the profile contact in the contacts list
+         This may be programatically capitalized. [CHAR LIMIT=20] -->
+    <string name="user_profile_contacts_list_header" msgid="9154761216179882405">Me</string>
+
+    <!-- Title shown in the search result activity of contacts app while searching.  [CHAR LIMIT=20]
+         (also in contacts) -->
+    <string name="search_results_searching">Searching\u2026</string>
+
+    <!-- Displayed at the top of search results indicating that more contacts were found than shown [CHAR LIMIT=64] -->
+    <string name="foundTooManyContacts">More than <xliff:g id="count">%d</xliff:g> found.</string>
+
+    <!-- Displayed at the top of the contacts showing the zero total number of contacts found when "Only contacts with phones" not selected. [CHAR LIMIT=30]
+         (also in contacts) -->
+    <string name="listFoundAllContactsZero">No contacts</string>
+
+    <!-- Displayed at the top of the contacts showing the total number of contacts found when typing search query -->
+    <plurals name="searchFoundContacts">
+        <item quantity="one">1 found</item>
+        <item quantity="other"><xliff:g id="count">%d</xliff:g> found</item>
+    </plurals>
+
+    <!-- String describing the text for photo of a contact in a contacts list.
+
+        Note: AccessibilityServices use this attribute to announce what the view represents.
+              This is especially valuable for views without textual representation like ImageView.
+    -->
+    <string name="description_quick_contact_for">Quick contact for <xliff:g id="name">%1$s</xliff:g></string>
+
+    <!-- Shown as the display name for a person when the name is missing or unknown. [CHAR LIMIT=18]-->
+    <string name="missing_name">(No name)</string>
 </resources>
diff --git a/res-common/values/styles.xml b/res-common/values/styles.xml
new file mode 100644
index 0000000..45137e7
--- /dev/null
+++ b/res-common/values/styles.xml
@@ -0,0 +1,22 @@
+<!--
+  ~ Copyright (C) 2012 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="DirectoryHeader">
+        <item name="android:background">@android:color/transparent</item>
+    </style>
+</resources>