Move non-default configurations to referencedesign RRO
Going forward all car-ui-lib qualified resources must be added to
reference design RRO. See bug for more details.
Bug: 149843967
Test: manual
Change-Id: I74072d717068e803208a33faf5ac309c896bd0bd
diff --git a/car-ui-lib/car-ui-lib/src/main/res-overlayable/values/overlayable.xml b/car-ui-lib/car-ui-lib/src/main/res-overlayable/values/overlayable.xml
index 4d0cab6..e9b706d 100644
--- a/car-ui-lib/car-ui-lib/src/main/res-overlayable/values/overlayable.xml
+++ b/car-ui-lib/car-ui-lib/src/main/res-overlayable/values/overlayable.xml
@@ -70,9 +70,11 @@
<item type="attr" name="layout_optimizationLevel"/>
<item type="attr" name="state_ux_restricted"/>
<item type="attr" name="title"/>
+ <item type="bool" name="car_ui_clear_focus_area_history_when_rotating"/>
<item type="bool" name="car_ui_enable_focus_area_background_highlight"/>
<item type="bool" name="car_ui_enable_focus_area_foreground_highlight"/>
<item type="bool" name="car_ui_escrow_check_components_automatically"/>
+ <item type="bool" name="car_ui_focus_area_default_focus_overrides_history"/>
<item type="bool" name="car_ui_list_item_single_line_title"/>
<item type="bool" name="car_ui_preference_list_show_full_screen"/>
<item type="bool" name="car_ui_preference_show_chevron"/>
@@ -329,12 +331,17 @@
<item type="id" name="spinner"/>
<item type="id" name="supplemental_icon"/>
<item type="id" name="switch_widget"/>
+ <item type="id" name="text_container"/>
<item type="id" name="textbox"/>
<item type="id" name="title"/>
<item type="id" name="title_template"/>
<item type="id" name="toolbar"/>
<item type="id" name="touch_interceptor"/>
<item type="integer" name="car_ui_default_max_string_length"/>
+ <item type="integer" name="car_ui_focus_area_history_cache_type"/>
+ <item type="integer" name="car_ui_focus_area_history_expiration_period_ms"/>
+ <item type="integer" name="car_ui_focus_history_cache_type"/>
+ <item type="integer" name="car_ui_focus_history_expiration_period_ms"/>
<item type="integer" name="car_ui_scrollbar_longpress_initial_delay"/>
<item type="integer" name="car_ui_scrollbar_longpress_repeat_interval"/>
<item type="layout" name="car_ui_alert_dialog_edit_text"/>
diff --git a/car-ui-lib/car-ui-lib/src/main/res/values-port/bools.xml b/car-ui-lib/car-ui-lib/src/main/res/values-port/bools.xml
index 16f3724..136b3e9 100644
--- a/car-ui-lib/car-ui-lib/src/main/res/values-port/bools.xml
+++ b/car-ui-lib/car-ui-lib/src/main/res/values-port/bools.xml
@@ -16,11 +16,11 @@
-->
<resources>
- <!-- Toolbar -->
+ <!-- Toolbar -->
- <!-- Whether tabs should use flex layout or not -->
- <bool name="car_ui_toolbar_tab_flexible_layout">true</bool>
- <!-- Whether tabs should be displayed on a second row, or they should be placed in the first
- row, replacing the title -->
- <bool name="car_ui_toolbar_tabs_on_second_row">true</bool>
+ <!-- Normally no resources should live in any other resource folder than default configuration. -->
+ <!-- Because OEMs will have to always add them to their RROs. -->
+ <!-- But we can't remove this resource from -port folder, because it was used as part of an earlier release -->
+ <!-- Whether tabs should use flex layout or not -->
+ <bool name="car_ui_toolbar_tab_flexible_layout">true</bool>
</resources>
diff --git a/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_button_ripple_background.xml b/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_button_ripple_background.xml
new file mode 100644
index 0000000..0acb196
--- /dev/null
+++ b/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_button_ripple_background.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright 2019 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<ripple
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="@color/car_ui_ripple_color" />
diff --git a/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_ic_down.xml b/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_ic_down.xml
new file mode 100644
index 0000000..380bf46
--- /dev/null
+++ b/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_ic_down.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright 2019 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportWidth="48.0"
+ android:viewportHeight="48.0">
+ <path
+ android:pathData="M14.83,16.42L24,25.59l9.17,-9.17L36,19.25l-12,12 -12,-12z"
+ android:fillColor="#FFFFFF"/>
+</vector>
diff --git a/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_ic_up.xml b/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_ic_up.xml
new file mode 100644
index 0000000..2eff62f
--- /dev/null
+++ b/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_ic_up.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright 2019 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportWidth="48.0"
+ android:viewportHeight="48.0">
+ <path
+ android:pathData="M14.83,30.83L24,21.66l9.17,9.17L36,28 24,16 12,28z"
+ android:fillColor="#FFFFFF"/>
+</vector>
diff --git a/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_scrollbar_thumb.xml b/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_scrollbar_thumb.xml
new file mode 100644
index 0000000..ec6318a
--- /dev/null
+++ b/car-ui-lib/referencedesign/res/drawable-ldrtl/car_ui_recyclerview_scrollbar_thumb.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright 2019 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<shape
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <solid android:color="@color/car_ui_scrollbar_thumb" />
+ <corners android:radius="@dimen/car_ui_scrollbar_thumb_radius"/>
+</shape>
diff --git a/car-ui-lib/car-ui-lib/src/main/res/layout-ldrtl/car_ui_recycler_view.xml b/car-ui-lib/referencedesign/res/layout-ldrtl/car_ui_recycler_view.xml
similarity index 100%
rename from car-ui-lib/car-ui-lib/src/main/res/layout-ldrtl/car_ui_recycler_view.xml
rename to car-ui-lib/referencedesign/res/layout-ldrtl/car_ui_recycler_view.xml
diff --git a/car-ui-lib/referencedesign/res/layout-ldrtl/car_ui_recyclerview_scrollbar.xml b/car-ui-lib/referencedesign/res/layout-ldrtl/car_ui_recyclerview_scrollbar.xml
new file mode 100644
index 0000000..5896819
--- /dev/null
+++ b/car-ui-lib/referencedesign/res/layout-ldrtl/car_ui_recyclerview_scrollbar.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright 2019 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<androidx.constraintlayout.widget.ConstraintLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="@dimen/car_ui_scrollbar_container_width"
+ android:layout_height="match_parent"
+ android:id="@+id/car_ui_scroll_bar"
+ android:gravity="center">
+
+ <ImageView
+ android:id="@+id/car_ui_scrollbar_page_up"
+ android:layout_width="@dimen/car_ui_scrollbar_button_size"
+ android:layout_height="@dimen/car_ui_scrollbar_button_size"
+ android:background="@drawable/car_ui_recyclerview_button_ripple_background"
+ android:contentDescription="@string/car_ui_scrollbar_page_up_button"
+ android:focusable="false"
+ android:hapticFeedbackEnabled="false"
+ android:src="@drawable/car_ui_recyclerview_ic_up"
+ android:scaleType="centerInside"
+ android:layout_marginTop="15dp"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintLeft_toLeftOf="parent"
+ app:layout_constraintRight_toRightOf="parent"/>
+
+ <!-- View height is dynamically calculated during layout. -->
+ <View
+ android:id="@+id/car_ui_scrollbar_thumb"
+ android:layout_width="@dimen/car_ui_scrollbar_thumb_width"
+ android:layout_height="0dp"
+ android:layout_gravity="center_horizontal"
+ android:background="@drawable/car_ui_recyclerview_scrollbar_thumb"
+ app:layout_constraintTop_toBottomOf="@+id/car_ui_scrollbar_page_up"
+ app:layout_constraintLeft_toLeftOf="parent"
+ app:layout_constraintRight_toRightOf="parent"/>
+
+ <View
+ android:id="@+id/car_ui_scrollbar_track"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_marginTop="@dimen/car_ui_scrollbar_separator_margin"
+ android:layout_marginBottom="@dimen/car_ui_scrollbar_separator_margin"
+ app:layout_constraintTop_toBottomOf="@+id/car_ui_scrollbar_page_up"
+ app:layout_constraintBottom_toTopOf="@+id/car_ui_scrollbar_page_down"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"/>
+
+ <ImageView
+ android:id="@+id/car_ui_scrollbar_page_down"
+ android:layout_width="@dimen/car_ui_scrollbar_button_size"
+ android:layout_height="@dimen/car_ui_scrollbar_button_size"
+ android:background="@drawable/car_ui_recyclerview_button_ripple_background"
+ android:contentDescription="@string/car_ui_scrollbar_page_down_button"
+ android:focusable="false"
+ android:hapticFeedbackEnabled="false"
+ android:src="@drawable/car_ui_recyclerview_ic_down"
+ android:scaleType="centerInside"
+ android:layout_marginBottom="15dp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintLeft_toLeftOf="parent"
+ app:layout_constraintRight_toRightOf="parent"/>
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/car-ui-lib/referencedesign/res/values-ldrtl/values.xml b/car-ui-lib/referencedesign/res/values-ldrtl/values.xml
index 2d50133..60df94e 100644
--- a/car-ui-lib/referencedesign/res/values-ldrtl/values.xml
+++ b/car-ui-lib/referencedesign/res/values-ldrtl/values.xml
@@ -1,4 +1,17 @@
<resources>
<bool name="car_ui_toolbar_nav_icon_reserve_space">false</bool>
<bool name="car_ui_toolbar_logo_fills_nav_icon_space">false</bool>
+
+ <dimen name="car_ui_scrollbar_margin">112dp</dimen>
+ <dimen name="car_ui_scrollbar_container_width">112dp</dimen>
+ <dimen name="car_ui_scrollbar_button_size">112dp</dimen>
+ <dimen name="car_ui_scrollbar_thumb_width">112dp</dimen>
+ <dimen name="car_ui_scrollbar_separator_margin">112dp</dimen>
+
+ <string name="car_ui_scrollbar_page_up_button">Scroll up</string>
+ <string name="car_ui_scrollbar_page_down_button">Scroll down</string>
+
+ <color name="car_ui_ripple_color">#27ffffff</color>
+ <color name="car_ui_scrollbar_thumb">#99ffffff</color>
+ <dimen name="car_ui_scrollbar_thumb_radius">100dp</dimen>
</resources>
diff --git a/car-ui-lib/car-ui-lib/src/main/res/values-night/colors.xml b/car-ui-lib/referencedesign/res/values-night/colors.xml
similarity index 100%
rename from car-ui-lib/car-ui-lib/src/main/res/values-night/colors.xml
rename to car-ui-lib/referencedesign/res/values-night/colors.xml
diff --git a/car-ui-lib/referencedesign/res/values-port/bools.xml b/car-ui-lib/referencedesign/res/values-port/bools.xml
new file mode 100644
index 0000000..16f3724
--- /dev/null
+++ b/car-ui-lib/referencedesign/res/values-port/bools.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources>
+ <!-- Toolbar -->
+
+ <!-- Whether tabs should use flex layout or not -->
+ <bool name="car_ui_toolbar_tab_flexible_layout">true</bool>
+ <!-- Whether tabs should be displayed on a second row, or they should be placed in the first
+ row, replacing the title -->
+ <bool name="car_ui_toolbar_tabs_on_second_row">true</bool>
+</resources>
diff --git a/car-ui-lib/referencedesign/res/xml/overlays.xml b/car-ui-lib/referencedesign/res/xml/overlays.xml
index 78b3e24..46c9ed2 100644
--- a/car-ui-lib/referencedesign/res/xml/overlays.xml
+++ b/car-ui-lib/referencedesign/res/xml/overlays.xml
@@ -43,9 +43,12 @@
<item target="style/Widget.CarUi.Toolbar.NavIcon" value="@style/Widget.CarUi.Toolbar.NavIcon"/>
<item target="dimen/car_ui_toolbar_margin" value="@dimen/car_ui_toolbar_margin"/>
+ <item target="layout/car_ui_recycler_view" value="@layout/car_ui_recycler_view"/>
<item target="bool/car_ui_toolbar_nav_icon_reserve_space" value="@bool/car_ui_toolbar_nav_icon_reserve_space" />
<item target="bool/car_ui_toolbar_logo_fills_nav_icon_space" value="@bool/car_ui_toolbar_logo_fills_nav_icon_space" />
+ <item target="bool/car_ui_toolbar_tab_flexible_layout" value="@bool/car_ui_toolbar_tab_flexible_layout" />
+ <item target="bool/car_ui_toolbar_tabs_on_second_row" value="@bool/car_ui_toolbar_tabs_on_second_row" />
<item target="id/car_ui_toolbar_background" value="@id/car_ui_toolbar_background" />
<item target="id/car_ui_toolbar_nav_icon_container" value="@id/car_ui_toolbar_nav_icon_container" />
@@ -69,6 +72,7 @@
<item target="id/car_ui_toolbar_menu_item_text_with_icon" value="@id/car_ui_toolbar_menu_item_text_with_icon"/>
<item target="id/seekbar" value="@id/seekbar"/>
<item target="id/seekbar_value" value="@id/seekbar_value"/>
+ <item target="id/car_ui_recycler_view" value="@id/car_ui_recycler_view" />
<item target="attr/layout_constraintGuide_begin" value="@attr/layout_constraintGuide_begin"/>
<item target="attr/layout_constraintGuide_end" value="@attr/layout_constraintGuide_end"/>