xref: /aosp_15_r20/frameworks/base/packages/SystemUI/res/layout/bluetooth_tile_dialog.xml (revision d57664e9bc4670b3ecf6748a746a57c557b6bc9e)
1<?xml version="1.0" encoding="utf-8"?><!--
2  ~ Copyright (C) 2023 The Android Open Source Project
3  ~
4  ~ Licensed under the Apache License, Version 2.0 (the "License");
5  ~ you may not use this file except in compliance with the License.
6  ~ You may obtain a copy of the License at
7  ~
8  ~      http://www.apache.org/licenses/LICENSE-2.0
9  ~
10  ~ Unless required by applicable law or agreed to in writing, software
11  ~ distributed under the License is distributed on an "AS IS" BASIS,
12  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  ~ See the License for the specific language governing permissions and
14  ~ limitations under the License.
15  -->
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    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
21    android:id="@+id/root"
22    style="@style/Widget.SliceView.Panel"
23    android:layout_width="wrap_content"
24    android:layout_height="wrap_content">
25
26    <TextView
27        android:id="@+id/bluetooth_tile_dialog_title"
28        android:layout_width="wrap_content"
29        android:layout_height="wrap_content"
30        android:paddingTop="24dp"
31        android:maxLines="1"
32        android:ellipsize="end"
33        android:gravity="center_vertical|center_horizontal"
34        android:text="@string/quick_settings_bluetooth_label"
35        android:textAppearance="@style/TextAppearance.BluetoothTileDialog"
36        android:textSize="24sp"
37        app:layout_constraintEnd_toEndOf="parent"
38        app:layout_constraintStart_toStartOf="parent"
39        app:layout_constraintBottom_toTopOf="@id/bluetooth_tile_dialog_subtitle"
40        app:layout_constraintTop_toTopOf="parent" />
41
42    <TextView
43        android:id="@+id/bluetooth_tile_dialog_subtitle"
44        android:layout_width="wrap_content"
45        android:layout_height="wrap_content"
46        android:layout_marginTop="4dp"
47        android:layout_marginBottom="@dimen/bluetooth_dialog_layout_margin"
48        android:ellipsize="end"
49        android:gravity="center_vertical|center_horizontal"
50        android:maxLines="2"
51        android:text="@string/quick_settings_bluetooth_tile_subtitle"
52        android:textSize="14sp"
53        android:textAppearance="@style/TextAppearance.BluetoothTileDialog"
54        app:layout_constraintEnd_toEndOf="parent"
55        app:layout_constraintStart_toStartOf="parent"
56        app:layout_constraintTop_toBottomOf="@id/bluetooth_tile_dialog_title" />
57
58    <View
59        android:id="@+id/bluetooth_tile_dialog_progress_background"
60        android:layout_width="0dp"
61        android:layout_height="0dp"
62        app:layout_constraintEnd_toEndOf="@id/bluetooth_tile_dialog_progress_animation"
63        app:layout_constraintStart_toStartOf="@id/bluetooth_tile_dialog_progress_animation"
64        app:layout_constraintTop_toTopOf="@id/bluetooth_tile_dialog_progress_animation"
65        app:layout_constraintBottom_toBottomOf="@id/bluetooth_tile_dialog_progress_animation"
66        android:background="?androidprv:attr/colorSurfaceVariant" />
67
68    <ProgressBar
69        android:id="@+id/bluetooth_tile_dialog_progress_animation"
70        android:layout_width="152dp"
71        android:layout_height="4dp"
72        android:layout_marginTop="16dp"
73        style="@style/TrimmedHorizontalProgressBar"
74        app:layout_constraintEnd_toEndOf="parent"
75        app:layout_constraintStart_toStartOf="parent"
76        app:layout_constraintTop_toBottomOf="@id/bluetooth_tile_dialog_subtitle"
77        android:visibility="invisible"
78        android:indeterminate="true" />
79
80    <androidx.core.widget.NestedScrollView
81        android:id="@+id/scroll_view"
82        android:layout_width="match_parent"
83        android:layout_height="wrap_content"
84        android:layout_marginTop="21dp"
85        android:minHeight="@dimen/bluetooth_dialog_scroll_view_min_height"
86        android:fillViewport="true"
87        app:layout_constrainedHeight="true"
88        app:layout_constraintStart_toStartOf="parent"
89        app:layout_constraintEnd_toEndOf="parent"
90        app:layout_constraintBottom_toBottomOf="parent"
91        app:layout_constraintTop_toBottomOf="@id/bluetooth_tile_dialog_progress_animation">
92
93        <androidx.constraintlayout.widget.ConstraintLayout
94            android:id="@+id/scroll_layout"
95            android:layout_width="match_parent"
96            android:layout_height="wrap_content" >
97
98            <TextView
99                android:id="@+id/bluetooth_toggle_title"
100                android:layout_width="0dp"
101                android:layout_height="68dp"
102                android:maxLines="2"
103                android:ellipsize="end"
104                android:gravity="start|center_vertical"
105                android:paddingEnd="15dp"
106                android:paddingStart="36dp"
107                android:text="@string/turn_on_bluetooth"
108                android:clickable="false"
109                android:textAppearance="@style/TextAppearance.BluetoothTileDialog"
110                android:textSize="16sp"
111                app:layout_constraintEnd_toStartOf="@+id/bluetooth_toggle"
112                app:layout_constraintStart_toStartOf="parent"
113                app:layout_constraintTop_toTopOf="parent" />
114
115            <Switch
116                android:id="@+id/bluetooth_toggle"
117                android:layout_width="wrap_content"
118                android:layout_height="68dp"
119                android:gravity="start|center_vertical"
120                android:paddingEnd="40dp"
121                android:contentDescription="@string/turn_on_bluetooth"
122                android:switchMinWidth="@dimen/settingslib_switch_track_width"
123                android:theme="@style/MainSwitch.Settingslib"
124                android:thumb="@drawable/settingslib_thumb_selector"
125                android:track="@drawable/settingslib_track_selector"
126                app:layout_constraintEnd_toEndOf="parent"
127                app:layout_constraintStart_toEndOf="@+id/bluetooth_toggle_title"
128                app:layout_constraintTop_toTopOf="parent" />
129
130            <androidx.constraintlayout.widget.Group
131                android:id="@+id/bluetooth_auto_on_toggle_layout"
132                android:layout_width="wrap_content"
133                android:layout_height="wrap_content"
134                android:visibility="gone"
135                app:constraint_referenced_ids="bluetooth_auto_on_toggle_title,bluetooth_auto_on_toggle,bluetooth_auto_on_toggle_info_icon,bluetooth_auto_on_toggle_info_text" />
136
137            <TextView
138                android:id="@+id/bluetooth_auto_on_toggle_title"
139                android:layout_width="0dp"
140                android:layout_height="wrap_content"
141                android:minHeight="68dp"
142                android:layout_marginBottom="20dp"
143                android:maxLines="2"
144                android:ellipsize="end"
145                android:text="@string/turn_on_bluetooth_auto_tomorrow"
146                android:gravity="start|center_vertical"
147                android:paddingEnd="15dp"
148                android:paddingStart="36dp"
149                android:clickable="false"
150                android:textAppearance="@style/TextAppearance.BluetoothTileDialog"
151                android:textSize="16sp"
152                app:layout_constraintEnd_toStartOf="@+id/bluetooth_auto_on_toggle"
153                app:layout_constraintStart_toStartOf="parent"
154                app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle_title" />
155
156            <Switch
157                android:id="@+id/bluetooth_auto_on_toggle"
158                android:layout_width="wrap_content"
159                android:layout_height="68dp"
160                android:layout_marginBottom="20dp"
161                android:gravity="start|center_vertical"
162                android:paddingEnd="40dp"
163                android:contentDescription="@string/turn_on_bluetooth_auto_tomorrow"
164                android:switchMinWidth="@dimen/settingslib_switch_track_width"
165                android:theme="@style/MainSwitch.Settingslib"
166                android:thumb="@drawable/settingslib_thumb_selector"
167                android:track="@drawable/settingslib_track_selector"
168                app:layout_constraintEnd_toEndOf="parent"
169                app:layout_constraintStart_toEndOf="@+id/bluetooth_auto_on_toggle_title"
170                app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle" />
171
172            <ImageView
173                android:id="@+id/bluetooth_auto_on_toggle_info_icon"
174                android:src="@drawable/ic_info_outline"
175                android:layout_width="wrap_content"
176                android:layout_height="wrap_content"
177                android:tint="?android:attr/textColorTertiary"
178                android:paddingStart="36dp"
179                android:layout_marginTop="20dp"
180                android:layout_marginBottom="@dimen/bluetooth_dialog_layout_margin"
181                app:layout_constraintStart_toStartOf="parent"
182                app:layout_constraintTop_toBottomOf="@+id/bluetooth_auto_on_toggle" />
183
184            <TextView
185                android:id="@+id/bluetooth_auto_on_toggle_info_text"
186                android:layout_width="match_parent"
187                android:layout_height="wrap_content"
188                android:layout_marginTop="20dp"
189                android:paddingStart="36dp"
190                android:paddingEnd="40dp"
191                android:textSize="14sp"
192                android:textAppearance="@style/TextAppearance.BluetoothTileDialog"
193                app:layout_constraintEnd_toEndOf="parent"
194                app:layout_constraintStart_toStartOf="parent"
195                app:layout_constraintTop_toBottomOf="@id/bluetooth_auto_on_toggle_info_icon" />
196
197            <androidx.recyclerview.widget.RecyclerView
198                android:id="@+id/device_list"
199                android:layout_width="match_parent"
200                android:layout_height="wrap_content"
201                app:layout_constraintStart_toStartOf="parent"
202                app:layout_constraintEnd_toEndOf="parent"
203                app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle" />
204
205            <Button
206                android:id="@+id/see_all_button"
207                style="@style/BluetoothTileDialog.Device"
208                android:paddingEnd="0dp"
209                android:paddingStart="26dp"
210                android:background="@drawable/bluetooth_tile_dialog_bg_off"
211                android:layout_width="0dp"
212                android:layout_height="64dp"
213                android:contentDescription="@string/accessibility_bluetooth_device_settings_see_all"
214                app:layout_constraintStart_toStartOf="parent"
215                app:layout_constraintEnd_toEndOf="parent"
216                app:layout_constraintTop_toBottomOf="@+id/device_list"
217                app:layout_constraintBottom_toTopOf="@+id/pair_new_device_button"
218                android:drawableStart="@drawable/ic_arrow_forward"
219                android:drawablePadding="26dp"
220                android:drawableTint="?android:attr/textColorPrimary"
221                android:text="@string/see_all_bluetooth_devices"
222                android:textSize="14sp"
223                android:textAppearance="@style/TextAppearance.BluetoothTileDialog"
224                android:textDirection="locale"
225                android:textAlignment="viewStart"
226                android:maxLines="1"
227                android:ellipsize="end"
228                android:visibility="gone" />
229
230            <Button
231                android:id="@+id/pair_new_device_button"
232                style="@style/BluetoothTileDialog.Device"
233                android:paddingEnd="0dp"
234                android:paddingStart="26dp"
235                android:background="@drawable/bluetooth_tile_dialog_bg_off"
236                android:layout_width="0dp"
237                android:layout_height="64dp"
238                android:contentDescription="@string/accessibility_bluetooth_device_settings_pair_new_device"
239                app:layout_constraintStart_toStartOf="parent"
240                app:layout_constraintEnd_toEndOf="parent"
241                app:layout_constraintTop_toBottomOf="@+id/see_all_button"
242                android:drawableStart="@drawable/ic_add"
243                android:drawablePadding="26dp"
244                android:drawableTint="?android:attr/textColorPrimary"
245                android:text="@string/pair_new_bluetooth_devices"
246                android:textSize="14sp"
247                android:textAppearance="@style/TextAppearance.BluetoothTileDialog"
248                android:textDirection="locale"
249                android:textAlignment="viewStart"
250                android:maxLines="1"
251                android:ellipsize="end"
252                android:visibility="gone" />
253
254            <androidx.constraintlayout.widget.Barrier
255                android:id="@+id/barrier"
256                android:layout_width="wrap_content"
257                android:layout_height="wrap_content"
258                app:barrierDirection="bottom"
259                app:constraint_referenced_ids="pair_new_device_button,bluetooth_auto_on_toggle_info_text" />
260
261            <Button
262                android:id="@+id/audio_sharing_button"
263                style="@style/BluetoothTileDialog.AudioSharingButton"
264                android:textAppearance="@style/TextAppearance.BluetoothTileDialog"
265                android:layout_width="wrap_content"
266                android:layout_height="wrap_content"
267                android:layout_marginTop="9dp"
268                android:layout_marginBottom="@dimen/dialog_bottom_padding"
269                android:layout_marginEnd="@dimen/dialog_side_padding"
270                android:layout_marginStart="@dimen/dialog_side_padding"
271                android:ellipsize="end"
272                android:maxLines="1"
273                android:text="@string/quick_settings_bluetooth_audio_sharing_button"
274                android:drawableStart="@drawable/ic_bt_le_audio_sharing_18dp"
275                android:drawablePadding="10dp"
276                app:layout_constrainedWidth="true"
277                app:layout_constraintHorizontal_bias="0"
278                app:layout_constraintEnd_toStartOf="@+id/done_button"
279                app:layout_constraintStart_toStartOf="parent"
280                app:layout_constraintBottom_toBottomOf="parent"
281                app:layout_constraintTop_toBottomOf="@+id/barrier"
282                app:layout_constraintVertical_bias="1"
283                android:visibility="gone" />
284
285            <Button
286                android:id="@+id/done_button"
287                style="@style/Widget.Dialog.Button"
288                android:textAppearance="@style/TextAppearance.BluetoothTileDialog"
289                android:layout_width="wrap_content"
290                android:layout_height="wrap_content"
291                android:layout_marginTop="9dp"
292                android:layout_marginBottom="@dimen/dialog_bottom_padding"
293                android:layout_marginEnd="@dimen/dialog_side_padding"
294                android:layout_marginStart="@dimen/dialog_side_padding"
295                android:clickable="true"
296                android:ellipsize="end"
297                android:focusable="true"
298                android:maxLines="1"
299                android:text="@string/inline_done_button"
300                app:layout_constraintEnd_toEndOf="parent"
301                app:layout_constraintBottom_toBottomOf="parent"
302                app:layout_constraintTop_toBottomOf="@+id/barrier"
303                app:layout_constraintVertical_bias="1" />
304        </androidx.constraintlayout.widget.ConstraintLayout>
305    </androidx.core.widget.NestedScrollView>
306</androidx.constraintlayout.widget.ConstraintLayout>