• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2020 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<androidx.constraintlayout.widget.ConstraintLayout
18    xmlns:android="http://schemas.android.com/apk/res/android"
19    xmlns:app="http://schemas.android.com/apk/res-auto"
20    android:layout_width="match_parent"
21    android:layout_height="match_parent"
22    android:tag="CarUiBaseLayoutToolbar">
23
24    <!-- When not in touch mode, if we clear focus in current window, Android will re-focus the
25         first focusable view in the window automatically. Adding a FocusParkingView to the window
26         can fix this issue, because it can take focus, and it is transparent and its default focus
27         highlight is disabled, so it's invisible to the user no matter whether it's focused or not.
28         -->
29    <com.android.car.ui.FocusParkingView
30        android:layout_width="wrap_content"
31        android:layout_height="wrap_content"/>
32
33    <FrameLayout
34        android:id="@+id/car_ui_base_layout_content_container"
35        android:layout_width="match_parent"
36        android:layout_height="match_parent"
37        app:layout_constraintBottom_toBottomOf="parent"
38        app:layout_constraintTop_toTopOf="parent"/>
39
40    <com.android.car.ui.FocusArea
41        android:layout_width="match_parent"
42        android:layout_height="@dimen/car_ui_toolbar_first_row_height">
43        <androidx.constraintlayout.widget.ConstraintLayout
44            android:id="@+id/car_ui_toolbar_background"
45            style="@style/Widget.CarUi.Toolbar.Container"
46            android:layout_width="match_parent"
47            android:layout_height="match_parent"
48            android:tag="car_ui_top_inset"
49            app:layout_constraintTop_toTopOf="parent">
50            <com.android.car.ui.baselayout.ClickBlockingView
51                android:layout_width="0dp"
52                android:layout_height="0dp"
53                app:layout_constraintStart_toStartOf="parent"
54                app:layout_constraintEnd_toEndOf="parent"
55                app:layout_constraintTop_toTopOf="parent"
56                app:layout_constraintBottom_toBottomOf="parent"/>
57
58            <!-- The horizontal bias set to 0.0 here is so that when you set this view as GONE, it will
59                 be treated as if it's all the way to the left instead of centered in the margin -->
60            <FrameLayout
61                android:id="@+id/car_ui_toolbar_nav_icon_container"
62                style="@style/Widget.CarUi.Toolbar.NavIconContainer"
63                android:layout_width="@dimen/car_ui_toolbar_margin"
64                android:layout_height="0dp"
65                app:layout_constraintBottom_toBottomOf="parent"
66                app:layout_constraintHorizontal_bias="0.0"
67                app:layout_constraintStart_toStartOf="parent"
68                app:layout_constraintTop_toTopOf="parent">
69
70                <ImageView
71                    android:id="@+id/car_ui_toolbar_nav_icon"
72                    style="@style/Widget.CarUi.Toolbar.NavIcon"
73                    android:layout_width="@dimen/car_ui_toolbar_nav_icon_size"
74                    android:layout_height="@dimen/car_ui_toolbar_nav_icon_size"
75                    android:layout_gravity="center"
76                    android:scaleType="fitXY"/>
77
78                <ImageView
79                    android:id="@+id/car_ui_toolbar_logo"
80                    android:layout_width="@dimen/car_ui_toolbar_logo_size"
81                    android:layout_height="@dimen/car_ui_toolbar_logo_size"
82                    android:layout_gravity="center"
83                    android:scaleType="fitXY"/>
84            </FrameLayout>
85
86            <FrameLayout
87                android:id="@+id/car_ui_toolbar_title_logo_container"
88                style="@style/Widget.CarUi.Toolbar.LogoContainer"
89                android:layout_width="wrap_content"
90                android:layout_height="wrap_content"
91                app:layout_constraintBottom_toBottomOf="parent"
92                app:layout_constraintStart_toEndOf="@id/car_ui_toolbar_nav_icon_container"
93                app:layout_constraintTop_toTopOf="parent">
94
95                <ImageView
96                    android:id="@+id/car_ui_toolbar_title_logo"
97                    style="@style/Widget.CarUi.Toolbar.Logo"
98                    android:layout_width="@dimen/car_ui_toolbar_logo_size"
99                    android:layout_height="@dimen/car_ui_toolbar_logo_size"
100                    android:layout_gravity="center"
101                    android:scaleType="fitXY"/>
102            </FrameLayout>
103
104            <LinearLayout android:layout_height="wrap_content"
105                          android:layout_width="0dp"
106                          android:id="@+id/car_ui_toolbar_title_container"
107                          android:orientation="vertical"
108                          android:layout_marginStart="@dimen/car_ui_toolbar_title_margin_start"
109                          app:layout_goneMarginStart="@dimen/car_ui_toolbar_title_no_logo_margin_start"
110                          app:layout_constraintBottom_toBottomOf="parent"
111                          app:layout_constraintEnd_toStartOf="@+id/car_ui_toolbar_menu_items_container"
112                          app:layout_constraintStart_toEndOf="@+id/car_ui_toolbar_title_logo_container"
113                          app:layout_constraintTop_toTopOf="parent">
114                <TextView android:id="@+id/car_ui_toolbar_title"
115                          android:layout_width="wrap_content"
116                          android:layout_height="wrap_content"
117                          android:singleLine="true"
118                          style="@style/Widget.CarUi.Toolbar.Title"/>
119                <TextView android:id="@+id/car_ui_toolbar_subtitle"
120                          android:layout_width="wrap_content"
121                          android:layout_height="wrap_content"
122                          android:visibility="gone"
123                          style="@style/Widget.CarUi.Toolbar.Subtitle"/>
124            </LinearLayout>
125
126            <com.android.car.ui.toolbar.TabLayout
127                android:id="@+id/car_ui_toolbar_tabs"
128                android:layout_width="wrap_content"
129                android:layout_height="0dp"
130                app:layout_constraintBottom_toBottomOf="parent"
131                app:layout_constraintEnd_toStartOf="@+id/car_ui_toolbar_menu_items_container"
132                app:layout_constraintHorizontal_bias="0.0"
133                app:layout_constraintStart_toEndOf="@+id/car_ui_toolbar_title_logo_container"
134                app:layout_constraintTop_toTopOf="parent"/>
135
136            <LinearLayout
137                android:id="@+id/car_ui_toolbar_menu_items_container"
138                style="@style/Widget.CarUi.Toolbar.MenuItem.Container"
139                android:layout_width="wrap_content"
140                android:layout_height="0dp"
141                android:orientation="horizontal"
142                app:layout_constraintBottom_toBottomOf="parent"
143                app:layout_constraintEnd_toEndOf="parent"
144                app:layout_constraintTop_toTopOf="parent"/>
145
146            <FrameLayout
147                android:id="@+id/car_ui_toolbar_search_view_container"
148                android:layout_width="0dp"
149                android:layout_height="@dimen/car_ui_toolbar_search_height"
150                android:layout_marginStart="@dimen/car_ui_toolbar_title_margin_start"
151                app:layout_goneMarginStart="@dimen/car_ui_toolbar_title_no_logo_margin_start"
152                app:layout_constraintBottom_toBottomOf="parent"
153                app:layout_constraintEnd_toStartOf="@+id/car_ui_toolbar_menu_items_container"
154                app:layout_constraintStart_toEndOf="@+id/car_ui_toolbar_title_logo_container"
155                app:layout_constraintTop_toTopOf="parent"/>
156
157            <ProgressBar
158                android:id="@+id/car_ui_toolbar_progress_bar"
159                style="@style/Widget.CarUi.Toolbar.ProgressBar"
160                android:layout_width="match_parent"
161                android:layout_height="wrap_content"
162                android:indeterminate="true"
163                android:visibility="gone"
164                app:layout_constraintBottom_toBottomOf="parent"
165                app:layout_constraintEnd_toEndOf="parent"
166                app:layout_constraintStart_toStartOf="parent"/>
167
168        </androidx.constraintlayout.widget.ConstraintLayout>
169    </com.android.car.ui.FocusArea>
170
171</androidx.constraintlayout.widget.ConstraintLayout>
172