Add tabs to People app
- Move account filter into overflow menu
- Use action bar in tab and standard mode so the SearchView
is right aligned and part of the options menu instead of the
custom view in the action bar
- Make visibility of action bar home icon a style so the icon
can be hidden on the phone
- TODO: Make physical search button work on the phone so the
search box can be removed from the action bar
- TODO: Fix SearchView focus problems
Change-Id: I7b3ba49f80e1911fb4a096679a00560967584426
diff --git a/res/layout-xlarge/people_activity.xml b/res/layout-xlarge/people_activity.xml
index 997ed21..3fbb3d2 100644
--- a/res/layout-xlarge/people_activity.xml
+++ b/res/layout-xlarge/people_activity.xml
@@ -43,12 +43,28 @@
android:layout_marginLeft="40dip"
android:layout_marginTop="24dip" />
+ <!-- Favorites -->
<fragment
- android:id="@+id/list_fragment"
+ android:id="@+id/favorites_fragment"
+ class="com.android.contacts.list.StrequentContactListFragment"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" />
+
+ <!-- Contacts -->
+ <fragment
+ android:id="@+id/contacts_fragment"
class="com.android.contacts.list.DefaultContactBrowseListFragment"
android:layout_height="0dip"
android:layout_width="match_parent"
- android:layout_weight="1"
+ android:layout_weight="1"
+ />
+
+ <!-- Groups -->
+ <fragment
+ android:id="@+id/groups_fragment"
+ class="com.android.contacts.group.GroupBrowseListFragment"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
/>
</LinearLayout>
diff --git a/res/layout/people_activity.xml b/res/layout/people_activity.xml
index 8affd46..bcf218b 100644
--- a/res/layout/people_activity.xml
+++ b/res/layout/people_activity.xml
@@ -18,17 +18,30 @@
android:id="@+id/list_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
- <FrameLayout
- android:id="@+id/main_view"
+
+ <!-- Favorites -->
+ <fragment
+ android:id="@+id/favorites_fragment"
+ class="com.android.contacts.list.StrequentContactListFragment"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" />
+
+ <!-- Contacts -->
+ <fragment
+ android:id="@+id/contacts_fragment"
+ class="com.android.contacts.list.DefaultContactBrowseListFragment"
+ android:layout_height="match_parent"
android:layout_width="match_parent"
- android:layout_height="match_parent">
- <fragment
- android:id="@+id/list_fragment"
- class="com.android.contacts.list.DefaultContactBrowseListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- />
- </FrameLayout>
+ />
+
+ <!-- Groups -->
+ <fragment
+ android:id="@+id/groups_fragment"
+ class="com.android.contacts.group.GroupBrowseListFragment"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ />
+
<FrameLayout
android:id="@+id/contacts_unavailable_view"
android:layout_width="match_parent"
diff --git a/res/menu/actions.xml b/res/menu/actions.xml
index a53967f..083d352 100644
--- a/res/menu/actions.xml
+++ b/res/menu/actions.xml
@@ -15,10 +15,20 @@
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
+ android:id="@+id/menu_search"
+ android:showAsAction="always"
+ android:actionViewClass="android.widget.SearchView" />
+
+ <item
android:id="@+id/menu_add"
android:showAsAction="always" />
<item
+ android:id="@+id/menu_contacts_filter"
+ android:icon="@drawable/ic_menu_settings_holo_light"
+ android:title="@string/menu_contacts_filter" />
+
+ <item
android:id="@+id/menu_settings"
android:icon="@drawable/ic_menu_settings_holo_light"
android:title="@string/menu_settings" />
diff --git a/res/values-xlarge/styles.xml b/res/values-xlarge/styles.xml
index d44d993..9d0ff29 100644
--- a/res/values-xlarge/styles.xml
+++ b/res/values-xlarge/styles.xml
@@ -36,6 +36,7 @@
<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>
+ <item name="show_home_icon">true</item>
</style>
<style name="ContactPickerTheme" parent="@android:Theme.Holo.Light.Dialog">
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2f9acb4..7e7e8b5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -993,6 +993,9 @@
<!-- The menu item to open the list of accounts -->
<string name="menu_accounts">Accounts</string>
+ <!-- The menu item to filter the list of contacts displayed -->
+ <string name="menu_contacts_filter">Contacts to display</string>
+
<!-- The menu item to bulk import or bulk export contacts from SIM card or SD card. -->
<string name="menu_import_export">Import/Export</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index df8b808..3f9986c 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -107,7 +107,12 @@
<attr name="list_item_header_text_size" format="dimension" />
</declare-styleable>
- <style name="PeopleTheme" parent="@android:Theme">
+ <!-- This style defines visibility of the action bar home icon -->
+ <declare-styleable name="ActionBarHomeIcon">
+ <attr name="show_home_icon" format="boolean"/>
+ </declare-styleable>
+
+ <style name="PeopleTheme" parent="android:Theme.Holo.Light">
<item name="list_item_height">?android:attr/listPreferredItemHeight</item>
<item name="activated_background">@drawable/list_item_activated_background</item>
<item name="section_header_background">@drawable/list_title_holo</item>
@@ -128,6 +133,7 @@
<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>
+ <item name="show_home_icon">false</item>
</style>
<!-- TODO: Clean up this file so themes aren't copied. -->