blob: 68c37d11417ab3b97bc886a865ed8e16d2f82a5b [file] [log] [blame]
Cole Faustd4e193b2019-10-03 09:49:26 -07001/*
2 * Copyright 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.car.ui.toolbar;
18
19import static com.google.common.truth.Truth.assertThat;
20
Ram Parameswaran05fec072019-10-17 13:24:27 -070021import static org.mockito.Mockito.spy;
22import static org.mockito.Mockito.when;
23
Cole Faustd4e193b2019-10-03 09:49:26 -070024import android.content.Context;
Ram Parameswaran05fec072019-10-17 13:24:27 -070025import android.content.res.Resources;
Cole Faustd4e193b2019-10-03 09:49:26 -070026import android.view.View;
27import android.view.ViewGroup;
28
29import com.android.car.ui.CarUiRobolectricTestRunner;
30import com.android.car.ui.R;
Cole Faustb2830152019-10-10 14:49:43 -070031import com.android.car.ui.utils.ShadowTypeface;
Cole Faustd4e193b2019-10-03 09:49:26 -070032
33import org.junit.Before;
34import org.junit.Test;
35import org.junit.runner.RunWith;
36import org.robolectric.Robolectric;
37import org.robolectric.RuntimeEnvironment;
38import org.robolectric.android.controller.ActivityController;
39import org.robolectric.annotation.Config;
40
41import java.util.Arrays;
42import java.util.Collections;
43import java.util.List;
44
45@RunWith(CarUiRobolectricTestRunner.class)
Cole Faustb2830152019-10-10 14:49:43 -070046@Config(qualifiers = "land", shadows = ShadowTypeface.class)
Cole Faustd4e193b2019-10-03 09:49:26 -070047public class ToolbarTest {
48
49 private Context mContext;
Ram Parameswaran05fec072019-10-17 13:24:27 -070050 private Resources mResources;
Cole Faustd4e193b2019-10-03 09:49:26 -070051 private ActivityController<TestActivity> mActivityController;
52 private TestActivity mActivity;
53 private Toolbar mToolbar;
54
55 @Before
56 public void setUp() {
57 mContext = RuntimeEnvironment.application;
Ram Parameswaran05fec072019-10-17 13:24:27 -070058 mResources = mContext.getResources();
Cole Faustd4e193b2019-10-03 09:49:26 -070059 mActivityController = Robolectric.buildActivity(TestActivity.class);
60 mActivityController.setup();
Cole Faustd4e193b2019-10-03 09:49:26 -070061 mActivity = mActivityController.get();
62 mToolbar = mActivity.findViewById(R.id.toolbar);
63 }
64
65 @Test
66 public void getters_nochanges_shouldReturnDefaults() {
67 assertThat(mToolbar.getBackgroundShown()).isEqualTo(true);
68 assertThat(mToolbar.getShowMenuItemsWhileSearching()).isEqualTo(false);
69 assertThat(mToolbar.getState()).isEquivalentAccordingToCompareTo(Toolbar.State.HOME);
70 assertThat(mToolbar.getNavButtonMode()).isEquivalentAccordingToCompareTo(
71 Toolbar.NavButtonMode.BACK);
72 }
73
74 @Test
75 public void setState_subpage_shouldCauseGetStateToReturnSubpage() {
76 mToolbar.setState(Toolbar.State.SUBPAGE);
77
78 assertThat(mToolbar.getState()).isEquivalentAccordingToCompareTo(Toolbar.State.SUBPAGE);
79 }
80
81 @Test
82 public void configurationChange_shouldNotLoseProperties() {
83 mToolbar.setTitle("Foo");
84 mToolbar.setSearchHint("Foo2");
85 mToolbar.setBackgroundShown(false);
86 mToolbar.setShowMenuItemsWhileSearching(true);
87 mToolbar.setState(Toolbar.State.SUBPAGE);
88 mToolbar.setNavButtonMode(Toolbar.NavButtonMode.CLOSE);
89
90 // TODO this is supposed to change the configuration, but doesn't
91 RuntimeEnvironment.setQualifiers("+port");
92 mActivityController.configurationChange();
93 mActivity = mActivityController.get();
94 mToolbar = mActivity.findViewById(R.id.toolbar);
95
96 assertThat(mToolbar.getTitle().toString()).isEqualTo("Foo");
97 assertThat(mToolbar.getSearchHint().toString()).isEqualTo("Foo2");
98 assertThat(mToolbar.getBackgroundShown()).isEqualTo(false);
99 assertThat(mToolbar.getShowMenuItemsWhileSearching()).isEqualTo(true);
100 assertThat(mToolbar.getState()).isEquivalentAccordingToCompareTo(Toolbar.State.SUBPAGE);
101 assertThat(mToolbar.getNavButtonMode()).isEquivalentAccordingToCompareTo(
102 Toolbar.NavButtonMode.CLOSE);
103 }
104
105 @Test
Cole Faustd4e193b2019-10-03 09:49:26 -0700106 public void showLogo_whenSet_andStateIsHome() {
107 mToolbar.setState(Toolbar.State.HOME);
108 mToolbar.setLogo(R.drawable.test_ic_launcher);
109
Cole Faustdb6866c2019-10-09 15:56:07 -0700110 assertThat(mToolbar.findViewById(R.id.car_ui_toolbar_logo).isShown()).isTrue();
Roberto Perez90c45bb2019-10-21 17:30:48 -0700111 assertThat(mToolbar.findViewById(R.id.car_ui_toolbar_title_logo).isShown()).isFalse();
Cole Faustd4e193b2019-10-03 09:49:26 -0700112 }
113
114 @Test
Roberto Perez90c45bb2019-10-21 17:30:48 -0700115 public void showTitleLogo_whenSet_andStateIsNotHome() {
Cole Faustd4e193b2019-10-03 09:49:26 -0700116 mToolbar.setState(Toolbar.State.SUBPAGE);
117 mToolbar.setLogo(R.drawable.test_ic_launcher);
118
Cole Faustdb6866c2019-10-09 15:56:07 -0700119 assertThat(mToolbar.findViewById(R.id.car_ui_toolbar_logo).isShown()).isFalse();
Roberto Perez90c45bb2019-10-21 17:30:48 -0700120 assertThat(mToolbar.findViewById(R.id.car_ui_toolbar_title_logo).isShown()).isTrue();
Cole Faustd4e193b2019-10-03 09:49:26 -0700121 }
122
123 @Test
Roberto Perez90c45bb2019-10-21 17:30:48 -0700124 public void hideLogo_andTitleLogo_whenNotSet_andStateIsHome() {
Cole Faustd4e193b2019-10-03 09:49:26 -0700125 mToolbar.setState(Toolbar.State.HOME);
126 mToolbar.setLogo(0);
127
Cole Faustdb6866c2019-10-09 15:56:07 -0700128 assertThat(mToolbar.findViewById(R.id.car_ui_toolbar_logo).isShown()).isFalse();
Roberto Perez90c45bb2019-10-21 17:30:48 -0700129 assertThat(mToolbar.findViewById(R.id.car_ui_toolbar_title_logo).isShown()).isFalse();
Cole Faustd4e193b2019-10-03 09:49:26 -0700130 }
131
132 @Test
Roberto Perez90c45bb2019-10-21 17:30:48 -0700133 public void hideLogo_andTitleLogo_whenNotSet_andStateIsNotHome() {
Cole Faustd4e193b2019-10-03 09:49:26 -0700134 mToolbar.setState(Toolbar.State.SUBPAGE);
135 mToolbar.setLogo(0);
136
Cole Faustdb6866c2019-10-09 15:56:07 -0700137 assertThat(mToolbar.findViewById(R.id.car_ui_toolbar_logo).isShown()).isFalse();
Roberto Perez90c45bb2019-10-21 17:30:48 -0700138 assertThat(mToolbar.findViewById(R.id.car_ui_toolbar_title_logo).isShown()).isFalse();
Cole Faustd4e193b2019-10-03 09:49:26 -0700139 }
140
141 @Test
142 public void registerOnBackListener_whenBackIsPressed_shouldCallListener() {
143 mToolbar.setState(Toolbar.State.SUBPAGE);
144 Mutable<Integer> timesBackPressed = new Mutable<>(0);
145 Toolbar.OnBackListener listener = () -> {
146 timesBackPressed.value++;
147 return false;
148 };
149
150 mToolbar.registerOnBackListener(listener);
151 pressBack();
152
153 assertThat(timesBackPressed.value).isEqualTo(1);
154 assertThat(mActivity.getTimesBackPressed()).isEqualTo(1);
155 }
156
157 @Test
158 public void registerOnBackListener_whenAListenerReturnsTrue_shouldSuppressBack() {
159 mToolbar.setState(Toolbar.State.SUBPAGE);
160
161 mToolbar.registerOnBackListener(() -> true);
162 pressBack();
163 mToolbar.registerOnBackListener(() -> false);
164 pressBack();
165
166 assertThat(mActivity.getTimesBackPressed()).isEqualTo(0);
167 }
168
169 @Test
Ram Parameswaran05fec072019-10-17 13:24:27 -0700170 public void testState_twoRow_withTitle_withTabs() {
171 mockResources();
172 when(mResources.getBoolean(R.bool.car_ui_toolbar_tabs_on_second_row)).thenReturn(true);
173
174 Toolbar toolbar = new Toolbar(mContext);
175 assertThat(toolbar.isTabsInSecondRow()).isTrue();
176
177 // Set title and tabs for toolbar.
178 toolbar.setTitle("Test title");
179 toolbar.addTab(new TabLayout.Tab(mContext.getDrawable(R.drawable.test_ic_launcher), "Foo"));
180 toolbar.addTab(new TabLayout.Tab(mContext.getDrawable(R.drawable.test_ic_launcher), "Foo"));
181
182 // Toolbar should display two rows, showing both title and tabs.
183 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_tabs).getVisibility()).isEqualTo(
184 View.VISIBLE);
185 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_title).getVisibility()).isEqualTo(
186 View.VISIBLE);
187 }
188
189 @Test
190 public void testState_twoRow_withTitle() {
191 mockResources();
192 when(mResources.getBoolean(R.bool.car_ui_toolbar_tabs_on_second_row)).thenReturn(true);
193
194 Toolbar toolbar = new Toolbar(mContext);
195 assertThat(toolbar.isTabsInSecondRow()).isTrue();
196
197 toolbar.setTitle("Test title");
198
199 // Toolbar should display two rows, but no tabs are set so they should not be visible.
200 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_title).getVisibility()).isEqualTo(
201 View.VISIBLE);
202 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_tabs).getVisibility()).isNotEqualTo(
203 View.VISIBLE);
204 }
205
206 @Test
207 public void testState_twoRow_withTabs() {
208 mockResources();
209 when(mResources.getBoolean(R.bool.car_ui_toolbar_tabs_on_second_row)).thenReturn(true);
210
211 Toolbar toolbar = new Toolbar(mContext);
212 assertThat(toolbar.isTabsInSecondRow()).isTrue();
213 toolbar.addTab(new TabLayout.Tab(mContext.getDrawable(R.drawable.test_ic_launcher), "Foo"));
214 toolbar.addTab(new TabLayout.Tab(mContext.getDrawable(R.drawable.test_ic_launcher), "Foo"));
215
216 // Toolbar should display two rows with an empty title and tabs.
217 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_tabs).getVisibility()).isEqualTo(
218 View.VISIBLE);
219 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_title).getVisibility()).isEqualTo(
220 View.VISIBLE);
221 }
222
223 @Test
224 public void testState_oneRow_withTitle_withTabs() {
225 mockResources();
226 when(mResources.getBoolean(R.bool.car_ui_toolbar_tabs_on_second_row)).thenReturn(false);
227
228 Toolbar toolbar = new Toolbar(mContext);
229 assertThat(toolbar.isTabsInSecondRow()).isFalse();
230
231 // Set title and tabs for toolbar.
232 toolbar.setTitle("Test title");
233 toolbar.addTab(new TabLayout.Tab(mContext.getDrawable(R.drawable.test_ic_launcher), "Foo"));
234 toolbar.addTab(new TabLayout.Tab(mContext.getDrawable(R.drawable.test_ic_launcher), "Foo"));
235
236 // With only one row available, toolbar will only show tabs and not the title.
237 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_tabs).getVisibility()).isEqualTo(
238 View.VISIBLE);
239 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_title).getVisibility()).isNotEqualTo(
240 View.VISIBLE);
241 }
242
243 @Test
244 public void testState_oneRow_withTitle() {
245 mockResources();
246 when(mResources.getBoolean(R.bool.car_ui_toolbar_tabs_on_second_row)).thenReturn(false);
247
248
249 Toolbar toolbar = new Toolbar(mContext);
250 assertThat(toolbar.isTabsInSecondRow()).isFalse();
251
252 toolbar.setTitle("Test title");
253
254 // Toolbar should display one row with the title and no tabs.
255 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_tabs).getVisibility()).isNotEqualTo(
256 View.VISIBLE);
257 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_title).getVisibility()).isEqualTo(
258 View.VISIBLE);
259 }
260
261 @Test
262 public void testState_oneRow_withTabs() {
263 mockResources();
264 when(mResources.getBoolean(R.bool.car_ui_toolbar_tabs_on_second_row)).thenReturn(false);
265
266
267 Toolbar toolbar = new Toolbar(mContext);
268 assertThat(toolbar.isTabsInSecondRow()).isFalse();
269
270 toolbar.addTab(new TabLayout.Tab(mContext.getDrawable(R.drawable.test_ic_launcher), "Foo"));
271 toolbar.addTab(new TabLayout.Tab(mContext.getDrawable(R.drawable.test_ic_launcher), "Foo"));
272
273 // Toolbar should display one row with only tabs.
274 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_tabs).getVisibility()).isEqualTo(
275 View.VISIBLE);
276 assertThat(toolbar.findViewById(R.id.car_ui_toolbar_title).getVisibility()).isNotEqualTo(
277 View.VISIBLE);
278 }
279
280 @Test
Cole Faustd4e193b2019-10-03 09:49:26 -0700281 public void registerOnBackListener_whenListenerRegisteredTwice_shouldntCallListenerTwice() {
282 mToolbar.setState(Toolbar.State.SUBPAGE);
283 Mutable<Integer> timesBackPressed = new Mutable<>(0);
284 Toolbar.OnBackListener listener = () -> {
285 timesBackPressed.value++;
286 return false;
287 };
288
289 // Registering a second time shouldn't do anything
290 mToolbar.registerOnBackListener(listener);
291 mToolbar.registerOnBackListener(listener);
292 pressBack();
293
294 assertThat(timesBackPressed.value).isEqualTo(1);
295 }
296
297 @Test
298 public void unregisterOnBackListener_previouslyRegisteredListener_shouldUnregister() {
299 mToolbar.setState(Toolbar.State.SUBPAGE);
300 Mutable<Integer> timesBackPressed = new Mutable<>(0);
301 Toolbar.OnBackListener listener = () -> {
302 timesBackPressed.value++;
303 return false;
304 };
305
306 mToolbar.registerOnBackListener(listener);
307 mToolbar.unregisterOnBackListener(listener);
308 pressBack();
309
310 assertThat(timesBackPressed.value).isEqualTo(0);
311 }
312
313 @Test
Cole Faust4ad34c82019-11-19 17:55:11 -0800314 public void menuItems_builder_id() {
315 MenuItem item = MenuItem.builder(mContext)
316 .setId(5)
317 .build();
318
319 assertThat(item.getId()).isEqualTo(5);
320 }
321
322 @Test
323 public void menuItems_setId_shouldWork() {
324 MenuItem item = MenuItem.builder(mContext).build();
325
326 assertThat(item.getId()).isEqualTo(0);
327
328 item.setId(7);
329
330 assertThat(item.getId()).isEqualTo(7);
331 }
332
333 @Test
Cole Faustd4e193b2019-10-03 09:49:26 -0700334 public void menuItems_whenClicked_shouldCallListener() {
Cole Faustdb6866c2019-10-09 15:56:07 -0700335 assertThat(getMenuItemViewCount()).isEqualTo(0);
Cole Faustd4e193b2019-10-03 09:49:26 -0700336
337 Mutable<Boolean> button1Clicked = new Mutable<>(false);
338 Mutable<Boolean> button2Clicked = new Mutable<>(false);
339 mToolbar.setMenuItems(Arrays.asList(
340 createMenuItem(i -> button1Clicked.value = true),
341 createMenuItem(i -> button2Clicked.value = true)));
342
Cole Faustdb6866c2019-10-09 15:56:07 -0700343 assertThat(getMenuItemViewCount()).isEqualTo(2);
Cole Faustd4e193b2019-10-03 09:49:26 -0700344
Cole Faustdb6866c2019-10-09 15:56:07 -0700345 getMenuItemView(0).performClick();
Cole Faustd4e193b2019-10-03 09:49:26 -0700346
347 assertThat(button1Clicked.value).isTrue();
348
Cole Faustdb6866c2019-10-09 15:56:07 -0700349 getMenuItemView(1).performClick();
Cole Faustd4e193b2019-10-03 09:49:26 -0700350
351 assertThat(button2Clicked.value).isTrue();
352 }
353
354 @Test
355 public void menuItems_null_shouldRemoveExistingMenuItems() {
356 mToolbar.setMenuItems(Arrays.asList(
Ram Parameswaran05fec072019-10-17 13:24:27 -0700357 createMenuItem(i -> {
358 }),
359 createMenuItem(i -> {
360 })));
Cole Faustd4e193b2019-10-03 09:49:26 -0700361
Cole Faustdb6866c2019-10-09 15:56:07 -0700362 assertThat(getMenuItemViewCount()).isEqualTo(2);
Cole Faustd4e193b2019-10-03 09:49:26 -0700363
364 mToolbar.setMenuItems(null);
365
Cole Faustdb6866c2019-10-09 15:56:07 -0700366 assertThat(getMenuItemViewCount()).isEqualTo(0);
Cole Faustd4e193b2019-10-03 09:49:26 -0700367 }
368
369 @Test
370 public void menuItems_setVisibility_shouldDefaultToShown() {
Ram Parameswaran05fec072019-10-17 13:24:27 -0700371 MenuItem item = createMenuItem(i -> {
372 });
Cole Faustd4e193b2019-10-03 09:49:26 -0700373 mToolbar.setMenuItems(Collections.singletonList(item));
374
Cole Faustdb6866c2019-10-09 15:56:07 -0700375 assertThat(getMenuItemView(0).isShown()).isTrue();
Cole Faustd4e193b2019-10-03 09:49:26 -0700376 }
377
378 @Test
379 public void menuItems_setVisibility_shouldHide() {
Ram Parameswaran05fec072019-10-17 13:24:27 -0700380 MenuItem item = createMenuItem(i -> {
381 });
Cole Faustd4e193b2019-10-03 09:49:26 -0700382 mToolbar.setMenuItems(Collections.singletonList(item));
383
Cole Faustd4e193b2019-10-03 09:49:26 -0700384 item.setVisible(false);
Cole Faustdb6866c2019-10-09 15:56:07 -0700385 assertThat(getMenuItemView(0).isShown()).isFalse();
Cole Faustd4e193b2019-10-03 09:49:26 -0700386 }
387
388 @Test
389 public void menuItems_setVisibility_shouldReshowAfterHiding() {
Ram Parameswaran05fec072019-10-17 13:24:27 -0700390 MenuItem item = createMenuItem(i -> {
391 });
Cole Faustd4e193b2019-10-03 09:49:26 -0700392 mToolbar.setMenuItems(Collections.singletonList(item));
393
Cole Faustd4e193b2019-10-03 09:49:26 -0700394 item.setVisible(false);
395 item.setVisible(true);
Cole Faustdb6866c2019-10-09 15:56:07 -0700396 assertThat(getMenuItemView(0).isShown()).isTrue();
Cole Faustd4e193b2019-10-03 09:49:26 -0700397 }
398
399 @Test
400 public void menuItems_equalItems_shouldntRecreateViews() {
401 List<MenuItem> menuItems = Arrays.asList(
Ram Parameswaran05fec072019-10-17 13:24:27 -0700402 createMenuItem(i -> {
403 }),
404 createMenuItem(i -> {
405 }));
Cole Faustd4e193b2019-10-03 09:49:26 -0700406 mToolbar.setMenuItems(menuItems);
407
Cole Faustdb6866c2019-10-09 15:56:07 -0700408 assertThat(getMenuItemViewCount()).isEqualTo(2);
Cole Faustd4e193b2019-10-03 09:49:26 -0700409
Cole Faustdb6866c2019-10-09 15:56:07 -0700410 View firstMenuItemView = getMenuItemView(0);
Cole Faustd4e193b2019-10-03 09:49:26 -0700411
412 mToolbar.setMenuItems(menuItems);
413
Cole Faustdb6866c2019-10-09 15:56:07 -0700414 assertThat(firstMenuItemView).isSameAs(getMenuItemView(0));
Cole Faustd4e193b2019-10-03 09:49:26 -0700415 }
416
417 @Test
418 public void menuItems_searchScreen_shouldHideMenuItems() {
419 mToolbar.setMenuItems(Arrays.asList(
Ram Parameswaran05fec072019-10-17 13:24:27 -0700420 MenuItem.Builder.createSearch(mContext, i -> {
421 }),
422 createMenuItem(i -> {
423 })));
Cole Faustd4e193b2019-10-03 09:49:26 -0700424
425 mToolbar.setShowMenuItemsWhileSearching(false);
426 mToolbar.setState(Toolbar.State.SEARCH);
427
Cole Faustdb6866c2019-10-09 15:56:07 -0700428 assertThat(getMenuItemView(0).isShown()).isFalse();
429 assertThat(getMenuItemView(1).isShown()).isFalse();
Cole Faustd4e193b2019-10-03 09:49:26 -0700430 }
431
432 @Test
433 public void menuItems_showMenuItemsWhileSearching() {
434 mToolbar.setMenuItems(Arrays.asList(
Ram Parameswaran05fec072019-10-17 13:24:27 -0700435 MenuItem.Builder.createSearch(mContext, i -> {
436 }),
437 createMenuItem(i -> {
438 })));
Cole Faustd4e193b2019-10-03 09:49:26 -0700439
440 mToolbar.setShowMenuItemsWhileSearching(true);
441 mToolbar.setState(Toolbar.State.SEARCH);
442
Cole Faustdb6866c2019-10-09 15:56:07 -0700443 assertThat(getMenuItemView(0).isShown()).isFalse();
444 assertThat(getMenuItemView(1).isShown()).isTrue();
Cole Faustd4e193b2019-10-03 09:49:26 -0700445 }
446
447 private MenuItem createMenuItem(MenuItem.OnClickListener listener) {
448 return new MenuItem.Builder(mContext)
449 .setTitle("Button!")
450 .setOnClickListener(listener)
451 .build();
452 }
453
Ram Parameswaran05fec072019-10-17 13:24:27 -0700454 private void mockResources() {
455 mContext = spy(RuntimeEnvironment.application);
456 mResources = spy(mContext.getResources());
457 when(mContext.getResources()).thenReturn(mResources);
458 }
459
Cole Faustdb6866c2019-10-09 15:56:07 -0700460 private int getMenuItemViewCount() {
461 return ((ViewGroup) mToolbar
462 .findViewById(R.id.car_ui_toolbar_menu_items_container))
463 .getChildCount();
464 }
465
466 private View getMenuItemView(int index) {
467 return ((ViewGroup) mToolbar
468 .findViewById(R.id.car_ui_toolbar_menu_items_container))
469 .getChildAt(index);
470 }
471
Cole Faustd4e193b2019-10-03 09:49:26 -0700472 private void pressBack() {
Cole Faustdb6866c2019-10-09 15:56:07 -0700473 mToolbar.findViewById(R.id.car_ui_toolbar_nav_icon_container).performClick();
Cole Faustd4e193b2019-10-03 09:49:26 -0700474 }
475
476 private static class Mutable<T> {
477 public T value;
478
479 Mutable(T value) {
480 this.value = value;
481 }
482 }
483
484}