From df21e0df6c65063aef4bcba1ebf17739a6f58432 Mon Sep 17 00:00:00 2001 From: chelseahao Date: Fri, 15 Sep 2023 16:49:24 +0800 Subject: Implemented click events for gear, see all and pair new device. Flag: BLUETOOTH_QS_TILE_DIALOG Test: atest -c BluetoothTileDialogTest BluetoothTileDialogViewModelTest DeviceItemFactoryTest DeviceItemInteractorTest BluetoothTileDialogRepositoryTest BluetoothStateInteractorTest Bug: b/298124674 b/299400510 Change-Id: I0549c6cc31fef1eea4213b592430c17288e31a5c --- .../SystemUI/res/layout/bluetooth_device_item.xml | 88 +++--- .../SystemUI/res/layout/bluetooth_tile_dialog.xml | 306 +++++++++++---------- packages/SystemUI/res/values/strings.xml | 8 +- packages/SystemUI/res/values/styles.xml | 1 - .../tiles/dialog/bluetooth/BluetoothTileDialog.kt | 68 +++-- .../dialog/bluetooth/BluetoothTileDialogUiEvent.kt | 34 +++ .../bluetooth/BluetoothTileDialogViewModel.kt | 53 +++- .../qs/tiles/dialog/bluetooth/DeviceItemFactory.kt | 37 ++- .../tiles/dialog/bluetooth/DeviceItemInteractor.kt | 4 + .../dialog/bluetooth/BluetoothTileDialogTest.kt | 68 +++-- .../bluetooth/BluetoothTileDialogViewModelTest.kt | 28 ++ .../dialog/bluetooth/DeviceItemInteractorTest.kt | 4 + 12 files changed, 458 insertions(+), 241 deletions(-) create mode 100644 packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/bluetooth/BluetoothTileDialogUiEvent.kt diff --git a/packages/SystemUI/res/layout/bluetooth_device_item.xml b/packages/SystemUI/res/layout/bluetooth_device_item.xml index 4265c4b14ee9..6dd44fbe645d 100644 --- a/packages/SystemUI/res/layout/bluetooth_device_item.xml +++ b/packages/SystemUI/res/layout/bluetooth_device_item.xml @@ -14,55 +14,81 @@ ~ limitations under the License. --> + - - + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + android:layout_gravity="center_vertical" /> - - + - - - + android:paddingTop="10dp" + app:layout_constraintWidth_percent="0.7" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toEndOf="@+id/bluetooth_device_icon" + app:layout_constraintEnd_toStartOf="@+id/gear_icon" + app:layout_constraintBottom_toTopOf="@+id/bluetooth_device_summary" + android:gravity="center_vertical" + android:textSize="14sp" /> - - - + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/bluetooth_tile_dialog.xml b/packages/SystemUI/res/layout/bluetooth_tile_dialog.xml index 9d14d0f36048..16aeb951822c 100644 --- a/packages/SystemUI/res/layout/bluetooth_tile_dialog.xml +++ b/packages/SystemUI/res/layout/bluetooth_tile_dialog.xml @@ -14,155 +14,175 @@ ~ limitations under the License. --> - + style="@style/Widget.SliceView.Panel" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> - + + - - - - - - - + + + + + + + + + + - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - -