Allow making search and settings MenuItems via XML
Fixes: 144957101
Test: Manually
Change-Id: I4fdb6d2107b05b5fb9044aa38de76dc3b2b4789f
diff --git a/car-ui-lib/tests/robotests/src/com/android/car/ui/toolbar/ToolbarTest.java b/car-ui-lib/tests/robotests/src/com/android/car/ui/toolbar/ToolbarTest.java
index 239caee..1744d76 100644
--- a/car-ui-lib/tests/robotests/src/com/android/car/ui/toolbar/ToolbarTest.java
+++ b/car-ui-lib/tests/robotests/src/com/android/car/ui/toolbar/ToolbarTest.java
@@ -417,8 +417,7 @@
@Test
public void menuItems_searchScreen_shouldHideMenuItems() {
mToolbar.setMenuItems(Arrays.asList(
- MenuItem.Builder.createSearch(mContext, i -> {
- }),
+ MenuItem.builder(mContext).setToSearch().build(),
createMenuItem(i -> {
})));
@@ -432,8 +431,7 @@
@Test
public void menuItems_showMenuItemsWhileSearching() {
mToolbar.setMenuItems(Arrays.asList(
- MenuItem.Builder.createSearch(mContext, i -> {
- }),
+ MenuItem.builder(mContext).setToSearch().build(),
createMenuItem(i -> {
})));
@@ -445,7 +443,7 @@
}
private MenuItem createMenuItem(MenuItem.OnClickListener listener) {
- return new MenuItem.Builder(mContext)
+ return MenuItem.builder(mContext)
.setTitle("Button!")
.setOnClickListener(listener)
.build();