People: Enable split action bar on 1-pane
- Also fixes bug 5023543: (1pane) Search menu item will be gone forever
- Also removed onCreatePanelMenu() and onPreparePanel(). With the action
bar, returning false from onCreateOptionsMenu() is enough to hide
all menu itesm.
HOWEVER, because of a bug in the action bar, we can't simply return
false from it... I put workaround code which should be removed
once the action bar bug is fixed.
Bug 4689447
Bug 5023543
Change-Id: I46c34df127fb777fc9019b99783377c2ee15f7d1
diff --git a/res/menu/actions.xml b/res/menu/actions.xml
index 7bd3765..fd2b967 100644
--- a/res/menu/actions.xml
+++ b/res/menu/actions.xml
@@ -17,17 +17,20 @@
<item
android:id="@+id/menu_search"
android:icon="@android:drawable/ic_menu_search"
- android:title="@string/menu_search" />
+ android:title="@string/menu_search"
+ android:showAsAction="ifRoom" />
<item
android:id="@+id/menu_add_contact"
android:icon="@drawable/ic_menu_add_contact_holo_light"
- android:title="@string/menu_new_contact_action_bar" />
+ android:title="@string/menu_new_contact_action_bar"
+ android:showAsAction="ifRoom" />
<item
android:id="@+id/menu_add_group"
android:icon="@drawable/ic_menu_display_all_holo_light"
- android:title="@string/menu_new_group_action_bar" />
+ android:title="@string/menu_new_group_action_bar"
+ android:showAsAction="ifRoom" />
<item
android:id="@+id/menu_contacts_filter"
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 01f0e62..8fdccfc 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -161,7 +161,7 @@
<attr name="call_log_list_item_height" format="dimension" />
</declare-styleable>
- <style name="PeopleTheme" parent="android:Theme.Holo.Light">
+ <style name="PeopleTheme" parent="android:Theme.Holo.Light.SplitActionBarWhenNarrow">
<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>