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.Dialog.Title" 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:textAppearance="@style/TextAppearance.Dialog.Body.Message" 53 app:layout_constraintEnd_toEndOf="parent" 54 app:layout_constraintStart_toStartOf="parent" 55 app:layout_constraintTop_toBottomOf="@id/bluetooth_tile_dialog_title" /> 56 57 <View 58 android:id="@+id/bluetooth_tile_dialog_progress_background" 59 android:layout_width="0dp" 60 android:layout_height="0dp" 61 app:layout_constraintEnd_toEndOf="@id/bluetooth_tile_dialog_progress_animation" 62 app:layout_constraintStart_toStartOf="@id/bluetooth_tile_dialog_progress_animation" 63 app:layout_constraintTop_toTopOf="@id/bluetooth_tile_dialog_progress_animation" 64 app:layout_constraintBottom_toBottomOf="@id/bluetooth_tile_dialog_progress_animation" 65 android:background="?androidprv:attr/colorSurfaceVariant" /> 66 67 <ProgressBar 68 android:id="@+id/bluetooth_tile_dialog_progress_animation" 69 android:layout_width="152dp" 70 android:layout_height="4dp" 71 android:layout_marginTop="16dp" 72 style="@style/TrimmedHorizontalProgressBar" 73 app:layout_constraintEnd_toEndOf="parent" 74 app:layout_constraintStart_toStartOf="parent" 75 app:layout_constraintTop_toBottomOf="@id/bluetooth_tile_dialog_subtitle" 76 android:visibility="invisible" 77 android:indeterminate="true" /> 78 79 <androidx.core.widget.NestedScrollView 80 android:id="@+id/scroll_view" 81 android:layout_width="match_parent" 82 android:layout_height="wrap_content" 83 android:layout_marginTop="21dp" 84 android:minHeight="@dimen/bluetooth_dialog_scroll_view_min_height" 85 android:fillViewport="true" 86 app:layout_constrainedHeight="true" 87 app:layout_constraintStart_toStartOf="parent" 88 app:layout_constraintEnd_toEndOf="parent" 89 app:layout_constraintBottom_toBottomOf="parent" 90 app:layout_constraintTop_toBottomOf="@id/bluetooth_tile_dialog_progress_animation"> 91 92 <androidx.constraintlayout.widget.ConstraintLayout 93 android:id="@+id/scroll_layout" 94 android:layout_width="match_parent" 95 android:layout_height="wrap_content" > 96 97 <TextView 98 android:id="@+id/bluetooth_toggle_title" 99 android:layout_width="0dp" 100 android:layout_height="68dp" 101 android:maxLines="2" 102 android:ellipsize="end" 103 android:gravity="start|center_vertical" 104 android:paddingEnd="15dp" 105 android:paddingStart="36dp" 106 android:text="@string/turn_on_bluetooth" 107 android:clickable="false" 108 android:textAppearance="@style/TextAppearance.Dialog.Title" 109 android:textSize="16sp" 110 app:layout_constraintEnd_toStartOf="@+id/bluetooth_toggle" 111 app:layout_constraintStart_toStartOf="parent" 112 app:layout_constraintTop_toTopOf="parent" /> 113 114 <Switch 115 android:id="@+id/bluetooth_toggle" 116 android:layout_width="wrap_content" 117 android:layout_height="68dp" 118 android:gravity="start|center_vertical" 119 android:paddingEnd="40dp" 120 android:contentDescription="@string/turn_on_bluetooth" 121 android:switchMinWidth="@dimen/settingslib_switch_track_width" 122 android:theme="@style/MainSwitch.Settingslib" 123 android:thumb="@drawable/settingslib_thumb_selector" 124 android:track="@drawable/settingslib_track_selector" 125 app:layout_constraintEnd_toEndOf="parent" 126 app:layout_constraintStart_toEndOf="@+id/bluetooth_toggle_title" 127 app:layout_constraintTop_toTopOf="parent" /> 128 129 <androidx.constraintlayout.widget.Group 130 android:id="@+id/bluetooth_auto_on_toggle_layout" 131 android:layout_width="wrap_content" 132 android:layout_height="wrap_content" 133 android:visibility="gone" 134 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" /> 135 136 <TextView 137 android:id="@+id/bluetooth_auto_on_toggle_title" 138 android:layout_width="0dp" 139 android:layout_height="wrap_content" 140 android:minHeight="68dp" 141 android:layout_marginBottom="20dp" 142 android:maxLines="2" 143 android:ellipsize="end" 144 android:text="@string/turn_on_bluetooth_auto_tomorrow" 145 android:gravity="start|center_vertical" 146 android:paddingEnd="15dp" 147 android:paddingStart="36dp" 148 android:clickable="false" 149 android:textAppearance="@style/TextAppearance.Dialog.Title" 150 android:textSize="16sp" 151 app:layout_constraintEnd_toStartOf="@+id/bluetooth_auto_on_toggle" 152 app:layout_constraintStart_toStartOf="parent" 153 app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle_title" /> 154 155 <Switch 156 android:id="@+id/bluetooth_auto_on_toggle" 157 android:layout_width="wrap_content" 158 android:layout_height="68dp" 159 android:layout_marginBottom="20dp" 160 android:gravity="start|center_vertical" 161 android:paddingEnd="40dp" 162 android:contentDescription="@string/turn_on_bluetooth_auto_tomorrow" 163 android:switchMinWidth="@dimen/settingslib_switch_track_width" 164 android:theme="@style/MainSwitch.Settingslib" 165 android:thumb="@drawable/settingslib_thumb_selector" 166 android:track="@drawable/settingslib_track_selector" 167 app:layout_constraintEnd_toEndOf="parent" 168 app:layout_constraintStart_toEndOf="@+id/bluetooth_auto_on_toggle_title" 169 app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle" /> 170 171 <ImageView 172 android:id="@+id/bluetooth_auto_on_toggle_info_icon" 173 android:src="@drawable/ic_info_outline" 174 android:layout_width="wrap_content" 175 android:layout_height="wrap_content" 176 android:tint="?android:attr/textColorTertiary" 177 android:paddingStart="36dp" 178 android:layout_marginTop="20dp" 179 android:layout_marginBottom="@dimen/bluetooth_dialog_layout_margin" 180 app:layout_constraintStart_toStartOf="parent" 181 app:layout_constraintTop_toBottomOf="@+id/bluetooth_auto_on_toggle" /> 182 183 <TextView 184 android:id="@+id/bluetooth_auto_on_toggle_info_text" 185 android:layout_width="match_parent" 186 android:layout_height="wrap_content" 187 android:layout_marginTop="20dp" 188 android:paddingStart="36dp" 189 android:paddingEnd="40dp" 190 android:textAppearance="@style/TextAppearance.Dialog.Body.Message" 191 app:layout_constraintEnd_toEndOf="parent" 192 app:layout_constraintStart_toStartOf="parent" 193 app:layout_constraintTop_toBottomOf="@id/bluetooth_auto_on_toggle_info_icon" /> 194 195 <androidx.recyclerview.widget.RecyclerView 196 android:id="@+id/device_list" 197 android:layout_width="match_parent" 198 android:layout_height="wrap_content" 199 app:layout_constraintStart_toStartOf="parent" 200 app:layout_constraintEnd_toEndOf="parent" 201 app:layout_constraintTop_toBottomOf="@+id/bluetooth_toggle" /> 202 203 <Button 204 android:id="@+id/see_all_button" 205 style="@style/BluetoothTileDialog.Device" 206 android:paddingEnd="0dp" 207 android:paddingStart="20dp" 208 android:background="@drawable/bluetooth_tile_dialog_bg_off" 209 android:layout_width="0dp" 210 android:layout_height="64dp" 211 android:contentDescription="@string/accessibility_bluetooth_device_settings_see_all" 212 app:layout_constraintStart_toStartOf="parent" 213 app:layout_constraintEnd_toEndOf="parent" 214 app:layout_constraintTop_toBottomOf="@+id/device_list" 215 app:layout_constraintBottom_toTopOf="@+id/pair_new_device_button" 216 android:drawableStart="@drawable/ic_arrow_forward" 217 android:drawablePadding="20dp" 218 android:drawableTint="?android:attr/textColorPrimary" 219 android:text="@string/see_all_bluetooth_devices" 220 android:textSize="14sp" 221 android:textAppearance="@style/TextAppearance.Dialog.Title" 222 android:textDirection="locale" 223 android:textAlignment="viewStart" 224 android:maxLines="1" 225 android:ellipsize="end" 226 android:visibility="gone" /> 227 228 <Button 229 android:id="@+id/pair_new_device_button" 230 style="@style/BluetoothTileDialog.Device" 231 android:paddingEnd="0dp" 232 android:paddingStart="20dp" 233 android:background="@drawable/bluetooth_tile_dialog_bg_off" 234 android:layout_width="0dp" 235 android:layout_height="64dp" 236 android:contentDescription="@string/accessibility_bluetooth_device_settings_pair_new_device" 237 app:layout_constraintStart_toStartOf="parent" 238 app:layout_constraintEnd_toEndOf="parent" 239 app:layout_constraintTop_toBottomOf="@+id/see_all_button" 240 android:drawableStart="@drawable/ic_add" 241 android:drawablePadding="20dp" 242 android:drawableTint="?android:attr/textColorPrimary" 243 android:text="@string/pair_new_bluetooth_devices" 244 android:textSize="14sp" 245 android:textAppearance="@style/TextAppearance.Dialog.Title" 246 android:textDirection="locale" 247 android:textAlignment="viewStart" 248 android:maxLines="1" 249 android:ellipsize="end" 250 android:visibility="gone" /> 251 252 <androidx.constraintlayout.widget.Barrier 253 android:id="@+id/barrier" 254 android:layout_width="wrap_content" 255 android:layout_height="wrap_content" 256 app:barrierDirection="bottom" 257 app:constraint_referenced_ids="pair_new_device_button,bluetooth_auto_on_toggle_info_text" /> 258 259 <Button 260 android:id="@+id/audio_sharing_button" 261 style="@style/Widget.Dialog.Button.BorderButton" 262 android:layout_width="wrap_content" 263 android:layout_height="wrap_content" 264 android:layout_marginTop="9dp" 265 android:layout_marginBottom="@dimen/dialog_bottom_padding" 266 android:layout_marginEnd="@dimen/dialog_side_padding" 267 android:layout_marginStart="@dimen/dialog_side_padding" 268 android:ellipsize="end" 269 android:maxLines="1" 270 android:text="@string/quick_settings_bluetooth_audio_sharing_button" 271 android:drawableStart="@drawable/ic_bt_le_audio_sharing_18dp" 272 android:drawablePadding="10dp" 273 android:drawableTint="?android:attr/textColorPrimary" 274 app:layout_constrainedWidth="true" 275 app:layout_constraintHorizontal_bias="0" 276 app:layout_constraintEnd_toStartOf="@+id/done_button" 277 app:layout_constraintStart_toStartOf="parent" 278 app:layout_constraintBottom_toBottomOf="parent" 279 app:layout_constraintTop_toBottomOf="@+id/barrier" 280 app:layout_constraintVertical_bias="1" 281 android:visibility="gone" /> 282 283 <Button 284 android:id="@+id/done_button" 285 style="@style/Widget.Dialog.Button" 286 android:layout_width="wrap_content" 287 android:layout_height="wrap_content" 288 android:layout_marginTop="9dp" 289 android:layout_marginBottom="@dimen/dialog_bottom_padding" 290 android:layout_marginEnd="@dimen/dialog_side_padding" 291 android:layout_marginStart="@dimen/dialog_side_padding" 292 android:clickable="true" 293 android:ellipsize="end" 294 android:focusable="true" 295 android:maxLines="1" 296 android:text="@string/inline_done_button" 297 app:layout_constraintEnd_toEndOf="parent" 298 app:layout_constraintBottom_toBottomOf="parent" 299 app:layout_constraintTop_toBottomOf="@+id/barrier" 300 app:layout_constraintVertical_bias="1" /> 301 </androidx.constraintlayout.widget.ConstraintLayout> 302 </androidx.core.widget.NestedScrollView> 303</androidx.constraintlayout.widget.ConstraintLayout>