Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e9c0400 authored by Luna Zhang's avatar Luna Zhang Committed by Android (Google) Code Review
Browse files

Merge "Implement bluetooth details content view" into main

parents 1dad7dd8 e1856419
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -24,13 +24,17 @@ import androidx.compose.ui.viewinterop.AndroidView
import com.android.systemui.res.R

@Composable
fun BluetoothDetailsContent() {
fun BluetoothDetailsContent(detailsContentViewModel: BluetoothTileDialogViewModel) {
    AndroidView(
        modifier = Modifier.fillMaxSize(),
        factory = { context ->
            // Inflate with the existing dialog xml layout
            LayoutInflater.from(context).inflate(R.layout.bluetooth_tile_dialog, null)
            // TODO: b/378513956 - Implement the bluetooth details view
            val view =
                LayoutInflater.from(context)
                    .inflate(R.layout.bluetooth_tile_dialog, /* root= */ null)
            detailsContentViewModel.showDetailsContent(/* expandable= */ null, view)
            view
        },
        onRelease = { detailsContentViewModel.contentManager.releaseView() },
    )
}
+2 −2
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ data class DeviceItemClick(val deviceItem: DeviceItem, val clickedView: View, va
/** View content manager for showing active, connected and saved bluetooth devices. */
class BluetoothDetailsContentManager
@AssistedInject
internal constructor(
constructor(
    @Assisted private val initialUiProperties: BluetoothTileDialogViewModel.UiProperties,
    @Assisted private val cachedContentHeight: Int,
    @Assisted private val bluetoothTileDialogCallback: BluetoothTileDialogCallback,
@@ -112,7 +112,7 @@ internal constructor(
    private lateinit var scrollViewContent: View

    @AssistedFactory
    internal interface Factory {
    interface Factory {
        fun create(
            initialUiProperties: BluetoothTileDialogViewModel.UiProperties,
            cachedContentHeight: Int,
+5 −4
Original line number Diff line number Diff line
@@ -18,11 +18,12 @@ package com.android.systemui.bluetooth.qsdialog

import com.android.systemui.plugins.qs.TileDetailsViewModel

class BluetoothDetailsViewModel(onLongClick: () -> Unit) : TileDetailsViewModel() {
    private val _onLongClick = onLongClick

class BluetoothDetailsViewModel(
    private val onSettingsClick: () -> Unit,
    val detailsContentViewModel: BluetoothTileDialogViewModel,
) : TileDetailsViewModel() {
    override fun clickOnSettingsButton() {
        _onLongClick()
        onSettingsClick()
    }

    override fun getTitle(): String {
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ import dagger.assisted.AssistedInject
/** Dialog for showing active, connected and saved bluetooth devices. */
class BluetoothTileDialogDelegate
@AssistedInject
internal constructor(
constructor(
    @Assisted private val initialUiProperties: BluetoothTileDialogViewModel.UiProperties,
    @Assisted private val cachedContentHeight: Int,
    @Assisted private val bluetoothTileDialogCallback: BluetoothTileDialogCallback,
@@ -46,7 +46,7 @@ internal constructor(
    lateinit var contentManager: BluetoothDetailsContentManager

    @AssistedFactory
    internal interface Factory {
    interface Factory {
        fun create(
            initialUiProperties: BluetoothTileDialogViewModel.UiProperties,
            cachedContentHeight: Int,
+2 −2
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ import kotlinx.coroutines.withContext
 *   by the dialog view.
 */
@SysUISingleton
internal class BluetoothTileDialogViewModel
class BluetoothTileDialogViewModel
@Inject
constructor(
    private val deviceItemInteractor: DeviceItemInteractor,
@@ -396,7 +396,7 @@ constructor(
            else R.string.bt_is_off
    }

    internal data class UiProperties(
    data class UiProperties(
        @StringRes val subTitleResId: Int,
        val autoOnToggleVisibility: Int,
        @DimenRes val scrollViewMinHeightResId: Int,
Loading