Loading packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/button/ui/composable/ButtonComponent.kt +2 −2 Original line number Diff line number Diff line Loading @@ -69,9 +69,9 @@ class ButtonComponent( role = Role.Button contentDescription = label }, color = MaterialTheme.colorScheme.primaryContainer, color = MaterialTheme.colorScheme.tertiaryContainer, shape = RoundedCornerShape(28.dp), contentColor = MaterialTheme.colorScheme.onPrimaryContainer, contentColor = MaterialTheme.colorScheme.onTertiaryContainer, onClick = onClick, ) { Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Loading packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/button/ui/composable/ToggleButtonComponent.kt +2 −2 Original line number Diff line number Diff line Loading @@ -66,8 +66,8 @@ class ToggleButtonComponent( val colors = if (viewModel.isChecked) { ButtonDefaults.buttonColors( containerColor = MaterialTheme.colorScheme.primaryContainer, contentColor = MaterialTheme.colorScheme.onPrimaryContainer, containerColor = MaterialTheme.colorScheme.tertiaryContainer, contentColor = MaterialTheme.colorScheme.onTertiaryContainer, ) } else { ButtonDefaults.buttonColors( Loading packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/selector/ui/composable/VolumePanelRadioButtons.kt +36 −4 Original line number Diff line number Diff line Loading @@ -30,9 +30,11 @@ import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.CornerSize import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.LocalContentColor import androidx.compose.material3.MaterialTheme import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment Loading Loading @@ -119,6 +121,7 @@ fun VolumePanelRadioButtonBar( ) { for (itemIndex in items.indices) { val item = items[itemIndex] val isSelected = itemIndex == scope.selectedIndex Row( modifier = Modifier.height(48.dp) Loading @@ -126,7 +129,7 @@ fun VolumePanelRadioButtonBar( .semantics { item.contentDescription?.let { contentDescription = it } role = Role.Switch selected = itemIndex == scope.selectedIndex selected = isSelected } .clickable( interactionSource = null, Loading @@ -137,11 +140,15 @@ fun VolumePanelRadioButtonBar( verticalAlignment = Alignment.CenterVertically, ) { if (item.icon !== Empty) { CompositionLocalProvider( LocalContentColor provides colors.getIconColor(isSelected) ) { with(items[itemIndex]) { icon() } } } } } } Row( modifier = Modifier.layoutId(RadioButtonBarComponent.Labels) Loading @@ -163,11 +170,14 @@ fun VolumePanelRadioButtonBar( ) { val item = items[itemIndex] if (item.icon !== Empty) { val textColor = colors.getLabelColor(itemIndex == scope.selectedIndex) CompositionLocalProvider(LocalContentColor provides textColor) { with(items[itemIndex]) { label() } } } } } } }, measurePolicy = with(LocalDensity.current) { Loading Loading @@ -265,8 +275,22 @@ data class VolumePanelRadioButtonBarColors( val indicatorColor: Color, /** Color of the indicator background. */ val indicatorBackgroundColor: Color, /** Color of the icon. */ val iconColor: Color, /** Color of the icon when it's selected. */ val selectedIconColor: Color, /** Color of the label. */ val labelColor: Color, /** Color of the label when it's selected. */ val selectedLabelColor: Color, ) private fun VolumePanelRadioButtonBarColors.getIconColor(selected: Boolean): Color = if (selected) selectedIconColor else iconColor private fun VolumePanelRadioButtonBarColors.getLabelColor(selected: Boolean): Color = if (selected) selectedLabelColor else labelColor object VolumePanelRadioButtonBarDefaults { val DefaultIndicatorBackgroundPadding = 8.dp Loading @@ -283,12 +307,20 @@ object VolumePanelRadioButtonBarDefaults { */ @Composable fun defaultColors( indicatorColor: Color = MaterialTheme.colorScheme.primaryContainer, indicatorColor: Color = MaterialTheme.colorScheme.tertiaryContainer, indicatorBackgroundColor: Color = MaterialTheme.colorScheme.surface, iconColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, selectedIconColor: Color = MaterialTheme.colorScheme.onTertiaryContainer, labelColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, selectedLabelColor: Color = MaterialTheme.colorScheme.onSurface, ): VolumePanelRadioButtonBarColors = VolumePanelRadioButtonBarColors( indicatorColor = indicatorColor, indicatorBackgroundColor = indicatorBackgroundColor, iconColor = iconColor, selectedIconColor = selectedIconColor, labelColor = labelColor, selectedLabelColor = selectedLabelColor, ) } Loading packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/spatialaudio/ui/composable/SpatialAudioPopup.kt +3 −8 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.volume.panel.component.spatialaudio.ui.composable import androidx.compose.foundation.basicMarquee import androidx.compose.material3.LocalContentColor import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable Loading @@ -29,7 +30,6 @@ import androidx.compose.ui.text.style.TextAlign import com.android.internal.logging.UiEventLogger import com.android.systemui.animation.Expandable import com.android.systemui.common.ui.compose.Icon import com.android.systemui.common.ui.compose.toColor import com.android.systemui.res.R import com.android.systemui.statusbar.phone.SystemUIDialog import com.android.systemui.volume.panel.component.popup.ui.composable.VolumePanelPopup Loading Loading @@ -88,18 +88,13 @@ constructor( isSelected = buttonViewModel.button.isChecked, onItemSelected = { viewModel.setEnabled(buttonViewModel.model) }, contentDescription = label, icon = { Icon( icon = buttonViewModel.button.icon, tint = buttonViewModel.iconColor.toColor(), ) }, icon = { Icon(icon = buttonViewModel.button.icon) }, label = { Text( modifier = Modifier.basicMarquee(), text = label, style = MaterialTheme.typography.labelMedium, color = buttonViewModel.labelColor.toColor(), color = LocalContentColor.current, textAlign = TextAlign.Center, maxLines = 2 ) Loading packages/SystemUI/src/com/android/systemui/volume/panel/component/spatial/ui/viewmodel/SpatialAudioButtonViewModel.kt +0 −3 Original line number Diff line number Diff line Loading @@ -16,13 +16,10 @@ package com.android.systemui.volume.panel.component.spatial.ui.viewmodel import com.android.systemui.common.shared.model.Color import com.android.systemui.volume.panel.component.button.ui.viewmodel.ToggleButtonViewModel import com.android.systemui.volume.panel.component.spatial.domain.model.SpatialAudioEnabledModel data class SpatialAudioButtonViewModel( val model: SpatialAudioEnabledModel, val button: ToggleButtonViewModel, val iconColor: Color, val labelColor: Color, ) Loading
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/button/ui/composable/ButtonComponent.kt +2 −2 Original line number Diff line number Diff line Loading @@ -69,9 +69,9 @@ class ButtonComponent( role = Role.Button contentDescription = label }, color = MaterialTheme.colorScheme.primaryContainer, color = MaterialTheme.colorScheme.tertiaryContainer, shape = RoundedCornerShape(28.dp), contentColor = MaterialTheme.colorScheme.onPrimaryContainer, contentColor = MaterialTheme.colorScheme.onTertiaryContainer, onClick = onClick, ) { Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Loading
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/button/ui/composable/ToggleButtonComponent.kt +2 −2 Original line number Diff line number Diff line Loading @@ -66,8 +66,8 @@ class ToggleButtonComponent( val colors = if (viewModel.isChecked) { ButtonDefaults.buttonColors( containerColor = MaterialTheme.colorScheme.primaryContainer, contentColor = MaterialTheme.colorScheme.onPrimaryContainer, containerColor = MaterialTheme.colorScheme.tertiaryContainer, contentColor = MaterialTheme.colorScheme.onTertiaryContainer, ) } else { ButtonDefaults.buttonColors( Loading
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/selector/ui/composable/VolumePanelRadioButtons.kt +36 −4 Original line number Diff line number Diff line Loading @@ -30,9 +30,11 @@ import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.CornerSize import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.LocalContentColor import androidx.compose.material3.MaterialTheme import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment Loading Loading @@ -119,6 +121,7 @@ fun VolumePanelRadioButtonBar( ) { for (itemIndex in items.indices) { val item = items[itemIndex] val isSelected = itemIndex == scope.selectedIndex Row( modifier = Modifier.height(48.dp) Loading @@ -126,7 +129,7 @@ fun VolumePanelRadioButtonBar( .semantics { item.contentDescription?.let { contentDescription = it } role = Role.Switch selected = itemIndex == scope.selectedIndex selected = isSelected } .clickable( interactionSource = null, Loading @@ -137,11 +140,15 @@ fun VolumePanelRadioButtonBar( verticalAlignment = Alignment.CenterVertically, ) { if (item.icon !== Empty) { CompositionLocalProvider( LocalContentColor provides colors.getIconColor(isSelected) ) { with(items[itemIndex]) { icon() } } } } } } Row( modifier = Modifier.layoutId(RadioButtonBarComponent.Labels) Loading @@ -163,11 +170,14 @@ fun VolumePanelRadioButtonBar( ) { val item = items[itemIndex] if (item.icon !== Empty) { val textColor = colors.getLabelColor(itemIndex == scope.selectedIndex) CompositionLocalProvider(LocalContentColor provides textColor) { with(items[itemIndex]) { label() } } } } } } }, measurePolicy = with(LocalDensity.current) { Loading Loading @@ -265,8 +275,22 @@ data class VolumePanelRadioButtonBarColors( val indicatorColor: Color, /** Color of the indicator background. */ val indicatorBackgroundColor: Color, /** Color of the icon. */ val iconColor: Color, /** Color of the icon when it's selected. */ val selectedIconColor: Color, /** Color of the label. */ val labelColor: Color, /** Color of the label when it's selected. */ val selectedLabelColor: Color, ) private fun VolumePanelRadioButtonBarColors.getIconColor(selected: Boolean): Color = if (selected) selectedIconColor else iconColor private fun VolumePanelRadioButtonBarColors.getLabelColor(selected: Boolean): Color = if (selected) selectedLabelColor else labelColor object VolumePanelRadioButtonBarDefaults { val DefaultIndicatorBackgroundPadding = 8.dp Loading @@ -283,12 +307,20 @@ object VolumePanelRadioButtonBarDefaults { */ @Composable fun defaultColors( indicatorColor: Color = MaterialTheme.colorScheme.primaryContainer, indicatorColor: Color = MaterialTheme.colorScheme.tertiaryContainer, indicatorBackgroundColor: Color = MaterialTheme.colorScheme.surface, iconColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, selectedIconColor: Color = MaterialTheme.colorScheme.onTertiaryContainer, labelColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, selectedLabelColor: Color = MaterialTheme.colorScheme.onSurface, ): VolumePanelRadioButtonBarColors = VolumePanelRadioButtonBarColors( indicatorColor = indicatorColor, indicatorBackgroundColor = indicatorBackgroundColor, iconColor = iconColor, selectedIconColor = selectedIconColor, labelColor = labelColor, selectedLabelColor = selectedLabelColor, ) } Loading
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/spatialaudio/ui/composable/SpatialAudioPopup.kt +3 −8 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.volume.panel.component.spatialaudio.ui.composable import androidx.compose.foundation.basicMarquee import androidx.compose.material3.LocalContentColor import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable Loading @@ -29,7 +30,6 @@ import androidx.compose.ui.text.style.TextAlign import com.android.internal.logging.UiEventLogger import com.android.systemui.animation.Expandable import com.android.systemui.common.ui.compose.Icon import com.android.systemui.common.ui.compose.toColor import com.android.systemui.res.R import com.android.systemui.statusbar.phone.SystemUIDialog import com.android.systemui.volume.panel.component.popup.ui.composable.VolumePanelPopup Loading Loading @@ -88,18 +88,13 @@ constructor( isSelected = buttonViewModel.button.isChecked, onItemSelected = { viewModel.setEnabled(buttonViewModel.model) }, contentDescription = label, icon = { Icon( icon = buttonViewModel.button.icon, tint = buttonViewModel.iconColor.toColor(), ) }, icon = { Icon(icon = buttonViewModel.button.icon) }, label = { Text( modifier = Modifier.basicMarquee(), text = label, style = MaterialTheme.typography.labelMedium, color = buttonViewModel.labelColor.toColor(), color = LocalContentColor.current, textAlign = TextAlign.Center, maxLines = 2 ) Loading
packages/SystemUI/src/com/android/systemui/volume/panel/component/spatial/ui/viewmodel/SpatialAudioButtonViewModel.kt +0 −3 Original line number Diff line number Diff line Loading @@ -16,13 +16,10 @@ package com.android.systemui.volume.panel.component.spatial.ui.viewmodel import com.android.systemui.common.shared.model.Color import com.android.systemui.volume.panel.component.button.ui.viewmodel.ToggleButtonViewModel import com.android.systemui.volume.panel.component.spatial.domain.model.SpatialAudioEnabledModel data class SpatialAudioButtonViewModel( val model: SpatialAudioEnabledModel, val button: ToggleButtonViewModel, val iconColor: Color, val labelColor: Color, )