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

Commit fa3a20fc authored by Anton Potapov's avatar Anton Potapov Committed by Android (Google) Code Review
Browse files

Merge "Remove device settings button" into main

parents 9b5907be 2f576625
Loading
Loading
Loading
Loading
+10 −6
Original line number Original line Diff line number Diff line
@@ -27,12 +27,14 @@ import androidx.compose.animation.scaleOut
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.animation.togetherWith
import androidx.compose.animation.togetherWith
import androidx.compose.foundation.background
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxSize
@@ -137,12 +139,14 @@ constructor(
                    }
                    }
                }
                }
            ) { targetViewModel ->
            ) { targetViewModel ->
                Expandable(
                Spacer(
                    modifier = Modifier.fillMaxSize(),
                    modifier =
                        Modifier.fillMaxSize()
                            .background(
                                color = targetViewModel.backgroundColor.toColor(),
                                color = targetViewModel.backgroundColor.toColor(),
                                shape = RoundedCornerShape(12.dp),
                                shape = RoundedCornerShape(12.dp),
                    onClick = { viewModel.onDeviceClick(it) },
                            ),
                ) {}
                )
            }
            }
            transition.AnimatedContent(
            transition.AnimatedContent(
                contentKey = { it.icon },
                contentKey = { it.icon },
+1 −1
Original line number Original line Diff line number Diff line
@@ -32,8 +32,8 @@ import com.android.systemui.util.mockito.whenever
import com.android.systemui.volume.localMediaRepository
import com.android.systemui.volume.localMediaRepository
import com.android.systemui.volume.mediaController
import com.android.systemui.volume.mediaController
import com.android.systemui.volume.mediaControllerRepository
import com.android.systemui.volume.mediaControllerRepository
import com.android.systemui.volume.mediaOutputActionsInteractor
import com.android.systemui.volume.mediaOutputInteractor
import com.android.systemui.volume.mediaOutputInteractor
import com.android.systemui.volume.panel.mediaOutputActionsInteractor
import com.android.systemui.volume.panel.volumePanelViewModel
import com.android.systemui.volume.panel.volumePanelViewModel
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ExperimentalCoroutinesApi
+0 −12
Original line number Original line Diff line number Diff line
@@ -16,14 +16,11 @@


package com.android.systemui.volume.panel.component.mediaoutput.domain.interactor
package com.android.systemui.volume.panel.component.mediaoutput.domain.interactor


import android.content.Intent
import android.provider.Settings
import com.android.internal.jank.InteractionJankMonitor
import com.android.internal.jank.InteractionJankMonitor
import com.android.systemui.animation.DialogCuj
import com.android.systemui.animation.DialogCuj
import com.android.systemui.animation.DialogTransitionAnimator
import com.android.systemui.animation.DialogTransitionAnimator
import com.android.systemui.animation.Expandable
import com.android.systemui.animation.Expandable
import com.android.systemui.media.dialog.MediaOutputDialogFactory
import com.android.systemui.media.dialog.MediaOutputDialogFactory
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.volume.panel.component.mediaoutput.domain.model.MediaDeviceSession
import com.android.systemui.volume.panel.component.mediaoutput.domain.model.MediaDeviceSession
import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope
import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope
import javax.inject.Inject
import javax.inject.Inject
@@ -34,17 +31,8 @@ class MediaOutputActionsInteractor
@Inject
@Inject
constructor(
constructor(
    private val mediaOutputDialogFactory: MediaOutputDialogFactory,
    private val mediaOutputDialogFactory: MediaOutputDialogFactory,
    private val activityStarter: ActivityStarter,
) {
) {


    fun onDeviceClick(expandable: Expandable) {
        activityStarter.startActivity(
            Intent(Settings.ACTION_BLUETOOTH_SETTINGS),
            true,
            expandable.activityTransitionController(),
        )
    }

    fun onBarClick(session: MediaDeviceSession, expandable: Expandable) {
    fun onBarClick(session: MediaDeviceSession, expandable: Expandable) {
        when (session) {
        when (session) {
            is MediaDeviceSession.Active -> {
            is MediaDeviceSession.Active -> {
+2 −2
Original line number Original line Diff line number Diff line
@@ -26,13 +26,13 @@ sealed interface DeviceIconViewModel {
    val iconColor: Color
    val iconColor: Color
    val backgroundColor: Color
    val backgroundColor: Color


    class IsPlaying(
    data class IsPlaying(
        override val icon: Icon,
        override val icon: Icon,
        override val iconColor: Color,
        override val iconColor: Color,
        override val backgroundColor: Color,
        override val backgroundColor: Color,
    ) : DeviceIconViewModel
    ) : DeviceIconViewModel


    class IsNotPlaying(
    data class IsNotPlaying(
        override val icon: Icon,
        override val icon: Icon,
        override val iconColor: Color,
        override val iconColor: Color,
        override val backgroundColor: Color,
        override val backgroundColor: Color,
+0 −5
Original line number Original line Diff line number Diff line
@@ -113,11 +113,6 @@ constructor(
    private fun MediaDeviceSession.isPlaying(): Boolean =
    private fun MediaDeviceSession.isPlaying(): Boolean =
        this is MediaDeviceSession.Active && playbackState?.isActive == true
        this is MediaDeviceSession.Active && playbackState?.isActive == true


    fun onDeviceClick(expandable: Expandable) {
        actionsInteractor.onDeviceClick(expandable)
        volumePanelViewModel.dismissPanel()
    }

    fun onBarClick(expandable: Expandable) {
    fun onBarClick(expandable: Expandable) {
        actionsInteractor.onBarClick(mediaDeviceSession.value, expandable)
        actionsInteractor.onBarClick(mediaDeviceSession.value, expandable)
        volumePanelViewModel.dismissPanel()
        volumePanelViewModel.dismissPanel()
Loading