Allow disabling logo on Toolbar by customization
Bug: 146132116
Test: make RunCarUiRoboTests
Change-Id: Iaa333695083737414efe2d44efcb2d1228f3f477
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 54eaee7..3a2a38c 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
@@ -112,6 +112,19 @@
}
@Test
+ public void hideLogo_andTitleLogo_whenSet_andStateIsHome_andLogoIsDisabled() {
+ mockResources();
+ when(mResources.getBoolean(R.bool.car_ui_toolbar_show_logo)).thenReturn(false);
+
+ Toolbar toolbar = new Toolbar(mContext);
+ toolbar.setState(Toolbar.State.HOME);
+ toolbar.setLogo(R.drawable.test_ic_launcher);
+
+ assertThat(toolbar.findViewById(R.id.car_ui_toolbar_logo).isShown()).isFalse();
+ assertThat(toolbar.findViewById(R.id.car_ui_toolbar_title_logo).isShown()).isFalse();
+ }
+
+ @Test
public void showTitleLogo_whenSet_andStateIsNotHome() {
mToolbar.setState(Toolbar.State.SUBPAGE);
mToolbar.setLogo(R.drawable.test_ic_launcher);