1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 Copyright 2019, The Android Open Source Project 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16--> 17<com.android.car.ui.FocusArea 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 android:layout_width="match_parent" 20 android:layout_height="@dimen/car_ui_toolbar_first_row_height"> 21 <androidx.constraintlayout.widget.ConstraintLayout 22 xmlns:app="http://schemas.android.com/apk/res-auto" 23 android:layout_width="match_parent" 24 android:layout_height="match_parent" 25 android:id="@+id/car_ui_toolbar_background" 26 android:tag="carUiToolbar" 27 style="@style/Widget.CarUi.Toolbar.Container"> 28 29 <androidx.constraintlayout.widget.Guideline 30 android:layout_width="wrap_content" 31 android:layout_height="wrap_content" 32 android:id="@+id/car_ui_toolbar_start_guideline" 33 app:layout_constraintGuide_begin="@dimen/car_ui_toolbar_start_inset" 34 android:orientation="vertical"/> 35 36 <androidx.constraintlayout.widget.Guideline 37 android:layout_width="wrap_content" 38 android:layout_height="wrap_content" 39 android:id="@+id/car_ui_toolbar_top_guideline" 40 app:layout_constraintGuide_begin="@dimen/car_ui_toolbar_top_inset" 41 android:orientation="horizontal"/> 42 43 <androidx.constraintlayout.widget.Guideline 44 android:layout_width="wrap_content" 45 android:layout_height="wrap_content" 46 android:id="@+id/car_ui_toolbar_end_guideline" 47 app:layout_constraintGuide_end="@dimen/car_ui_toolbar_end_inset" 48 android:orientation="vertical"/> 49 50 <androidx.constraintlayout.widget.Guideline 51 android:layout_width="wrap_content" 52 android:layout_height="wrap_content" 53 android:id="@+id/car_ui_toolbar_bottom_guideline" 54 app:layout_constraintGuide_end="@dimen/car_ui_toolbar_bottom_inset" 55 android:orientation="horizontal"/> 56 57 <!-- The horizontal bias here is so that when you set this view as GONE, it will be 58 treated as if it's all the way to the left instead of centered in the margin --> 59 <FrameLayout 60 android:id="@+id/car_ui_toolbar_nav_icon_container" 61 android:layout_width="@dimen/car_ui_toolbar_margin" 62 android:layout_height="0dp" 63 style="@style/Widget.CarUi.Toolbar.NavIconContainer" 64 app:layout_constraintTop_toTopOf="@id/car_ui_toolbar_top_guideline" 65 app:layout_constraintBottom_toTopOf="@id/car_ui_toolbar_bottom_guideline" 66 app:layout_constraintStart_toEndOf="@id/car_ui_toolbar_start_guideline" 67 app:layout_constraintHorizontal_bias="0.0"> 68 <ImageView 69 android:id="@+id/car_ui_toolbar_nav_icon" 70 android:layout_width="@dimen/car_ui_toolbar_nav_icon_size" 71 android:layout_height="@dimen/car_ui_toolbar_nav_icon_size" 72 android:layout_gravity="center" 73 android:scaleType="fitXY" 74 style="@style/Widget.CarUi.Toolbar.NavIcon"/> 75 <ImageView 76 android:id="@+id/car_ui_toolbar_logo" 77 android:layout_width="@dimen/car_ui_toolbar_logo_size" 78 android:layout_height="@dimen/car_ui_toolbar_logo_size" 79 android:layout_gravity="center" 80 android:scaleType="fitXY"/> 81 </FrameLayout> 82 83 <FrameLayout 84 android:id="@+id/car_ui_toolbar_title_logo_container" 85 android:layout_width="wrap_content" 86 android:layout_height="wrap_content" 87 style="@style/Widget.CarUi.Toolbar.LogoContainer" 88 app:layout_constraintTop_toTopOf="@id/car_ui_toolbar_top_guideline" 89 app:layout_constraintBottom_toTopOf="@id/car_ui_toolbar_bottom_guideline" 90 app:layout_constraintStart_toEndOf="@id/car_ui_toolbar_nav_icon_container"> 91 92 <ImageView 93 android:id="@+id/car_ui_toolbar_title_logo" 94 android:layout_width="@dimen/car_ui_toolbar_logo_size" 95 android:layout_height="@dimen/car_ui_toolbar_logo_size" 96 android:scaleType="fitXY" 97 android:layout_gravity="center" 98 style="@style/Widget.CarUi.Toolbar.Logo"/> 99 </FrameLayout> 100 101 <LinearLayout android:layout_height="wrap_content" 102 android:layout_width="0dp" 103 android:id="@+id/car_ui_toolbar_title_container" 104 android:orientation="vertical" 105 android:layout_marginStart="@dimen/car_ui_toolbar_title_margin_start" 106 app:layout_goneMarginStart="@dimen/car_ui_toolbar_title_no_logo_margin_start" 107 app:layout_constraintTop_toTopOf="@id/car_ui_toolbar_top_guideline" 108 app:layout_constraintBottom_toTopOf="@id/car_ui_toolbar_bottom_guideline" 109 app:layout_constraintStart_toEndOf="@+id/car_ui_toolbar_title_logo_container" 110 app:layout_constraintEnd_toStartOf="@+id/car_ui_toolbar_menu_items_container"> 111 <TextView android:id="@+id/car_ui_toolbar_title" 112 android:layout_width="wrap_content" 113 android:layout_height="wrap_content" 114 android:singleLine="true" 115 style="@style/Widget.CarUi.Toolbar.Title"/> 116 <TextView android:id="@+id/car_ui_toolbar_subtitle" 117 android:layout_width="wrap_content" 118 android:layout_height="wrap_content" 119 android:visibility="gone" 120 style="@style/Widget.CarUi.Toolbar.Subtitle"/> 121 </LinearLayout> 122 123 <com.android.car.ui.toolbar.TabLayout 124 android:id="@+id/car_ui_toolbar_tabs" 125 android:layout_width="wrap_content" 126 android:layout_height="0dp" 127 app:layout_constraintTop_toTopOf="@id/car_ui_toolbar_top_guideline" 128 app:layout_constraintBottom_toTopOf="@id/car_ui_toolbar_bottom_guideline" 129 app:layout_constraintStart_toEndOf="@+id/car_ui_toolbar_title_logo_container" 130 app:layout_constraintEnd_toStartOf="@+id/car_ui_toolbar_menu_items_container" 131 app:layout_constraintHorizontal_bias="0.0"/> 132 133 <LinearLayout 134 android:id="@+id/car_ui_toolbar_menu_items_container" 135 android:layout_width="wrap_content" 136 android:layout_height="0dp" 137 android:orientation="horizontal" 138 style="@style/Widget.CarUi.Toolbar.MenuItem.Container" 139 app:layout_constraintTop_toTopOf="@id/car_ui_toolbar_top_guideline" 140 app:layout_constraintBottom_toTopOf="@id/car_ui_toolbar_bottom_guideline" 141 app:layout_constraintEnd_toStartOf="@+id/car_ui_toolbar_end_guideline"/> 142 143 <FrameLayout 144 android:id="@+id/car_ui_toolbar_search_view_container" 145 android:layout_width="0dp" 146 android:layout_height="@dimen/car_ui_toolbar_search_height" 147 app:layout_constraintTop_toTopOf="@id/car_ui_toolbar_top_guideline" 148 app:layout_constraintBottom_toTopOf="@id/car_ui_toolbar_bottom_guideline" 149 app:layout_constraintStart_toEndOf="@+id/car_ui_toolbar_nav_icon_container" 150 app:layout_constraintEnd_toStartOf="@+id/car_ui_toolbar_menu_items_container"/> 151 152 <View 153 android:id="@+id/car_ui_toolbar_row_separator" 154 android:layout_width="match_parent" 155 android:layout_height="@dimen/car_ui_toolbar_separator_height" 156 style="@style/Widget.CarUi.Toolbar.SeparatorView" 157 app:layout_constraintBottom_toTopOf="@id/car_ui_toolbar_bottom_guideline" 158 app:layout_constraintStart_toStartOf="parent" 159 app:layout_constraintEnd_toEndOf="parent"/> 160 161 <ProgressBar 162 android:id="@+id/car_ui_toolbar_progress_bar" 163 style="@style/Widget.CarUi.Toolbar.ProgressBar" 164 android:layout_width="match_parent" 165 android:layout_height="wrap_content" 166 app:layout_constraintBottom_toTopOf="@id/car_ui_toolbar_row_separator" 167 app:layout_constraintStart_toStartOf="parent" 168 app:layout_constraintEnd_toEndOf="parent" 169 android:indeterminate="true" 170 android:visibility="gone"/> 171 172 <View 173 android:id="@+id/car_ui_toolbar_bottom_styleable" 174 android:layout_width="match_parent" 175 android:layout_height="@dimen/car_ui_toolbar_bottom_view_height" 176 style="@style/Widget.CarUi.Toolbar.BottomView" 177 app:layout_constraintBottom_toTopOf="@+id/car_ui_toolbar_progress_bar" 178 app:layout_constraintStart_toStartOf="parent" 179 app:layout_constraintEnd_toEndOf="parent"/> 180 181 </androidx.constraintlayout.widget.ConstraintLayout> 182</com.android.car.ui.FocusArea> 183