Merge "Move CarUxRestrictionsUtil into utils package" into pi-car-dev
diff --git a/car-ui-lib/res/layout/car_ui_toolbar.xml b/car-ui-lib/res/layout/car_ui_toolbar.xml
index 8512b6d..7ee939f 100644
--- a/car-ui-lib/res/layout/car_ui_toolbar.xml
+++ b/car-ui-lib/res/layout/car_ui_toolbar.xml
@@ -30,14 +30,41 @@
android:focusable="true"
android:focusableInTouchMode="true"/>
+ <androidx.constraintlayout.widget.Guideline
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/toolbar_start_guideline"
+ app:layout_constraintGuide_begin="@dimen/car_ui_toolbar_start_inset"
+ android:orientation="vertical"/>
+
+ <androidx.constraintlayout.widget.Guideline
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/toolbar_top_guideline"
+ app:layout_constraintGuide_begin="@dimen/car_ui_toolbar_top_inset"
+ android:orientation="horizontal"/>
+
+ <androidx.constraintlayout.widget.Guideline
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/toolbar_end_guideline"
+ app:layout_constraintGuide_end="@dimen/car_ui_toolbar_end_inset"
+ android:orientation="vertical"/>
+
+ <androidx.constraintlayout.widget.Guideline
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/toolbar_bottom_guideline"
+ app:layout_constraintGuide_end="@dimen/car_ui_toolbar_bottom_inset"
+ android:orientation="horizontal"/>
<FrameLayout
android:id="@+id/nav_icon_container"
android:layout_width="@dimen/car_ui_toolbar_nav_button_width"
android:layout_height="0dp"
android:background="?android:attr/selectableItemBackground"
- app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintTop_toTopOf="@id/toolbar_top_guideline"
app:layout_constraintBottom_toTopOf="@+id/bottom_styleable"
- app:layout_constraintStart_toStartOf="parent">
+ app:layout_constraintStart_toStartOf="@id/toolbar_start_guideline">
<ImageView
android:id="@+id/nav_icon"
android:layout_width="@dimen/car_ui_toolbar_icon_size"
@@ -59,7 +86,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/car_ui_toolbar_title_margin_start"
style="@style/TextAppearance.CarUi.Widget.Toolbar.Title"
- app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintTop_toTopOf="@id/toolbar_top_guideline"
app:layout_constraintBottom_toTopOf="@+id/bottom_styleable"
app:layout_constraintStart_toEndOf="@+id/nav_icon_container"
app:layout_constraintEnd_toStartOf="@+id/menu_items_container"/>
@@ -69,7 +96,7 @@
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginEnd="@dimen/car_ui_toolbar_menu_item_margin"
- app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintTop_toTopOf="@id/toolbar_top_guideline"
app:layout_constraintBottom_toTopOf="@+id/bottom_styleable"
app:layout_constraintStart_toEndOf="@+id/nav_icon_container"
app:layout_constraintEnd_toStartOf="@+id/menu_items_container"
@@ -80,7 +107,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="gone"
- app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintTop_toTopOf="@id/toolbar_top_guideline"
app:layout_constraintBottom_toTopOf="@+id/bottom_styleable"
app:layout_constraintStart_toEndOf="@+id/nav_icon_container"
app:layout_constraintEnd_toStartOf="@+id/menu_items_container"/>
@@ -92,7 +119,7 @@
android:orientation="horizontal"
android:divider="@drawable/car_ui_toolbar_menu_item_divider"
android:showDividers="beginning|middle|end"
- app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintTop_toTopOf="@id/toolbar_top_guideline"
app:layout_constraintBottom_toTopOf="@+id/bottom_styleable"
app:layout_constraintEnd_toStartOf="@+id/car_ui_toolbar_overflow_button"/>
@@ -103,9 +130,9 @@
android:layout_marginLeft="@dimen/car_ui_toolbar_menu_item_margin"
android:layout_marginRight="@dimen/car_ui_toolbar_menu_item_margin"
android:visibility="gone"
- app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintTop_toTopOf="@id/toolbar_top_guideline"
app:layout_constraintBottom_toTopOf="@id/bottom_styleable"
- app:layout_constraintEnd_toEndOf="parent">
+ app:layout_constraintEnd_toEndOf="@id/toolbar_end_guideline">
<ImageView
android:src="@drawable/car_ui_icon_overflow_menu"
android:layout_width="@dimen/car_ui_primary_icon_size"
@@ -121,7 +148,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:visibility="gone"
- app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintTop_toTopOf="@id/toolbar_top_guideline"
app:layout_constraintBottom_toTopOf="@+id/bottom_styleable"
app:layout_constraintStart_toEndOf="@+id/nav_icon_container"
app:layout_constraintEnd_toStartOf="@+id/menu_items_container"/>
@@ -131,8 +158,7 @@
android:id="@+id/bottom_styleable"
android:layout_width="match_parent"
android:layout_height="0.01dp"
- app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintBottom_toBottomOf="@id/toolbar_bottom_guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
-
</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/car-ui-lib/res/values/dimens.xml b/car-ui-lib/res/values/dimens.xml
index eb4b9e1..d92801d 100644
--- a/car-ui-lib/res/values/dimens.xml
+++ b/car-ui-lib/res/values/dimens.xml
@@ -50,6 +50,10 @@
<dimen name="car_ui_toolbar_first_row_height">@dimen/car_ui_toolbar_row_height</dimen>
<dimen name="car_ui_toolbar_second_row_height">@dimen/car_ui_toolbar_row_height</dimen>
<dimen name="car_ui_toolbar_nav_button_width">@dimen/car_ui_margin</dimen>
+ <dimen name="car_ui_toolbar_start_inset">0dp</dimen>
+ <dimen name="car_ui_toolbar_end_inset">0dp</dimen>
+ <dimen name="car_ui_toolbar_top_inset">0dp</dimen>
+ <dimen name="car_ui_toolbar_bottom_inset">0dp</dimen>
<dimen name="car_ui_toolbar_icon_size">@dimen/car_ui_primary_icon_size</dimen>
<dimen name="car_ui_toolbar_title_margin_start">@dimen/car_ui_padding_2</dimen>
<dimen name="car_ui_toolbar_menu_item_margin">@dimen/car_ui_padding_2</dimen>