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

Commit be8038dc authored by Danny Wang's avatar Danny Wang
Browse files

Screen Sharing: Load volume up icon in background

screenshot: http://screen/txUApXPZ3aGB8YC

BUG: 440967325
Test: manual
Flag: com.android.systemui.large_screen_sharing
Change-Id: I0ec96a7375a496f8146d88274ba1dbce78b335e9
parent ab7d7993
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -398,6 +398,8 @@
    <string name="screen_share_toolbar_share_button">Share</string>
    <!-- Text for app screen sharing thumbnail when no app is selected. [CHAR LIMIT=35] -->
    <string name="screen_share_no_select_app_thumbnail">Select an app to share</string>
    <!-- Text for share app audio. [CHAR LIMIT=35] -->
    <string name="screen_share_app_audio_sharing">Share window audio</string>
    <!-- Content description for the app window screenshot button in the toolbar, when the capture mode is set to "screenshot". [CHAR LIMIT=NONE] -->
    <string name="screen_capture_toolbar_app_window_button_screenshot_a11y">Take screenshot of window</string>
    <!-- Content description for the app window screenshot button in the toolbar, when the capture mode is set to "record". [CHAR LIMIT=NONE] -->
+18 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
@@ -41,6 +42,8 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.android.systemui.res.R
import com.android.systemui.screencapture.common.ui.compose.LoadingIcon
import com.android.systemui.screencapture.common.ui.compose.loadIcon
import com.android.systemui.screencapture.common.ui.viewmodel.RecentTaskViewModel
import com.android.systemui.screencapture.sharescreen.largescreen.ui.viewmodel.AudioSwitchViewModel
import com.android.systemui.screencapture.sharescreen.largescreen.ui.viewmodel.ShareContentListViewModel
@@ -142,7 +145,21 @@ private fun AudioSwitch(
        horizontalArrangement = Arrangement.SpaceBetween,
        modifier = Modifier.padding(4.dp, bottom = 12.dp).height(24.dp).fillMaxWidth(),
    ) {
        Text(text = "Share audio", style = MaterialTheme.typography.labelMedium)
        LoadingIcon(
            icon =
                loadIcon(
                        viewModel = audioSwitchViewModel,
                        resId = R.drawable.ic_speaker_on,
                        contentDescription = null,
                    )
                    .value,
            modifier = Modifier.size(20.dp).padding(2.dp),
        )
        Text(
            text = stringResource(R.string.screen_share_app_audio_sharing),
            style = MaterialTheme.typography.labelMedium,
            modifier = Modifier.width(452.dp),
        )
        Switch(
            checked = audioSwitchViewModel.audioSwitchChecked,
            onCheckedChange = {
+6 −1
Original line number Diff line number Diff line
@@ -19,10 +19,15 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.android.systemui.lifecycle.HydratedActivatable
import com.android.systemui.screencapture.common.ui.viewmodel.DrawableLoaderViewModel
import com.android.systemui.screencapture.common.ui.viewmodel.DrawableLoaderViewModelImpl
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject

class AudioSwitchViewModel @AssistedInject constructor() : HydratedActivatable() {
class AudioSwitchViewModel
@AssistedInject
constructor(private val drawableLoaderViewModelImpl: DrawableLoaderViewModelImpl) :
    HydratedActivatable(), DrawableLoaderViewModel by drawableLoaderViewModelImpl {
    var audioSwitchChecked by mutableStateOf(false)

    @AssistedFactory
+2 −1
Original line number Diff line number Diff line
@@ -18,11 +18,12 @@ package com.android.systemui.screencapture.sharescreen.largescreen.ui.viewmodel

import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.screencapture.common.ui.viewmodel.drawableLoaderViewModelImpl

val Kosmos.audioSwitchViewModelFactory by Fixture {
    object : AudioSwitchViewModel.Factory {
        override fun create(): AudioSwitchViewModel {
            return AudioSwitchViewModel()
            return AudioSwitchViewModel(drawableLoaderViewModelImpl)
        }
    }
}