Loading packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/button/ui/composable/ButtonComponent.kt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -108,6 +108,7 @@ class ButtonComponent( } else { } else { MaterialTheme.colorScheme.onSurface MaterialTheme.colorScheme.onSurface }, }, useModifierBasedImplementation = true, onClick = { onClick(it, gravity) }, onClick = { onClick(it, gravity) }, ) { ) { Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Loading packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/mediaoutput/ui/composable/MediaOutputComponent.kt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -103,6 +103,7 @@ class MediaOutputComponent @Inject constructor(private val viewModel: MediaOutpu MaterialTheme.colorScheme.surfaceContainerHighest MaterialTheme.colorScheme.surfaceContainerHighest }, }, shape = RoundedCornerShape(28.dp), shape = RoundedCornerShape(28.dp), useModifierBasedImplementation = true, onClick = onClick = if (enabled) { if (enabled) { { viewModel.onBarClick(it) } { viewModel.onBarClick(it) } Loading packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/popup/ui/composable/VolumePanelPopup.kt +5 −8 Original line number Original line Diff line number Diff line Loading @@ -68,10 +68,7 @@ constructor( content: @Composable (SystemUIDialog) -> Unit, content: @Composable (SystemUIDialog) -> Unit, ) { ) { val dialog = val dialog = dialogFactory.create( dialogFactory.create(theme = R.style.Theme_VolumePanel_Popup, dialogGravity = gravity) { theme = R.style.Theme_VolumePanel_Popup, dialogGravity = gravity, ) { PopupComposable(it, title, content) PopupComposable(it, title, content) } } val controller = expandable?.dialogTransitionController() val controller = expandable?.dialogTransitionController() Loading @@ -97,7 +94,7 @@ constructor( Box( Box( modifier = modifier = Modifier.padding(horizontal = 80.dp).fillMaxWidth().wrapContentHeight(), Modifier.padding(horizontal = 80.dp).fillMaxWidth().wrapContentHeight(), contentAlignment = Alignment.Center contentAlignment = Alignment.Center, ) { ) { title(dialog) title(dialog) } } Loading @@ -105,7 +102,7 @@ constructor( Box( Box( modifier = modifier = Modifier.padding(horizontal = 16.dp).fillMaxWidth().wrapContentHeight(), Modifier.padding(horizontal = 16.dp).fillMaxWidth().wrapContentHeight(), contentAlignment = Alignment.Center contentAlignment = Alignment.Center, ) { ) { content(dialog) content(dialog) } } Loading @@ -116,8 +113,8 @@ constructor( onClick = { dialog.dismiss() }, onClick = { dialog.dismiss() }, colors = colors = IconButtonDefaults.iconButtonColors( IconButtonDefaults.iconButtonColors( contentColor = MaterialTheme.colorScheme.outline contentColor = MaterialTheme.colorScheme.onSurfaceVariant ) ), ) { ) { Icon( Icon( painterResource(R.drawable.ic_close), painterResource(R.drawable.ic_close), Loading packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/selector/ui/composable/VolumePanelRadioButtons.kt +9 −12 Original line number Original line Diff line number Diff line Loading @@ -82,7 +82,7 @@ fun VolumePanelRadioButtonBar( indicatorBackgroundCornerSize: CornerSize = indicatorBackgroundCornerSize: CornerSize = CornerSize(VolumePanelRadioButtonBarDefaults.DefaultIndicatorBackgroundCornerRadius), CornerSize(VolumePanelRadioButtonBarDefaults.DefaultIndicatorBackgroundCornerRadius), colors: VolumePanelRadioButtonBarColors = VolumePanelRadioButtonBarDefaults.defaultColors(), colors: VolumePanelRadioButtonBarColors = VolumePanelRadioButtonBarDefaults.defaultColors(), content: VolumePanelRadioButtonBarScope.() -> Unit content: VolumePanelRadioButtonBarScope.() -> Unit, ) { ) { val scope = val scope = VolumePanelRadioButtonBarScopeImpl().apply(content).apply { VolumePanelRadioButtonBarScopeImpl().apply(content).apply { Loading @@ -108,16 +108,13 @@ fun VolumePanelRadioButtonBar( Modifier.layoutId(RadioButtonBarComponent.Indicator) Modifier.layoutId(RadioButtonBarComponent.Indicator) .offset { IntOffset(offsetAnimatable.value, 0) } .offset { IntOffset(offsetAnimatable.value, 0) } .padding(indicatorBackgroundPadding) .padding(indicatorBackgroundPadding) .background( .background(colors.indicatorColor, RoundedCornerShape(indicatorCornerSize)) colors.indicatorColor, RoundedCornerShape(indicatorCornerSize), ) ) ) Row( Row( modifier = modifier = Modifier.layoutId(RadioButtonBarComponent.Buttons) Modifier.layoutId(RadioButtonBarComponent.Buttons) .padding(indicatorBackgroundPadding), .padding(indicatorBackgroundPadding), horizontalArrangement = Arrangement.spacedBy(spacing) horizontalArrangement = Arrangement.spacedBy(spacing), ) { ) { for (itemIndex in items.indices) { for (itemIndex in items.indices) { val item = items[itemIndex] val item = items[itemIndex] Loading @@ -134,7 +131,7 @@ fun VolumePanelRadioButtonBar( .clickable( .clickable( interactionSource = null, interactionSource = null, indication = null, indication = null, onClick = { items[itemIndex].onItemSelected() } onClick = { items[itemIndex].onItemSelected() }, ), ), horizontalArrangement = Arrangement.Center, horizontalArrangement = Arrangement.Center, verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically, Loading @@ -155,7 +152,7 @@ fun VolumePanelRadioButtonBar( .padding( .padding( start = indicatorBackgroundPadding, start = indicatorBackgroundPadding, top = labelIndicatorBackgroundSpacing, top = labelIndicatorBackgroundSpacing, end = indicatorBackgroundPadding end = indicatorBackgroundPadding, ) ) .clearAndSetSemantics {}, .clearAndSetSemantics {}, horizontalArrangement = Arrangement.spacedBy(spacing), horizontalArrangement = Arrangement.spacedBy(spacing), Loading @@ -166,7 +163,7 @@ fun VolumePanelRadioButtonBar( modifier = Modifier.weight(1f), modifier = Modifier.weight(1f), onClick = { items[itemIndex].onItemSelected() }, onClick = { items[itemIndex].onItemSelected() }, shape = RoundedCornerShape(cornersRadius), shape = RoundedCornerShape(cornersRadius), contentPadding = PaddingValues(cornersRadius) contentPadding = PaddingValues(cornersRadius), ) { ) { val item = items[itemIndex] val item = items[itemIndex] if (item.icon !== Empty) { if (item.icon !== Empty) { Loading Loading @@ -210,7 +207,7 @@ private class BarMeasurePolicy( override fun MeasureScope.measure( override fun MeasureScope.measure( measurables: List<Measurable>, measurables: List<Measurable>, constraints: Constraints constraints: Constraints, ): MeasureResult { ): MeasureResult { val fillWidthConstraints = constraints.copy(minWidth = constraints.maxWidth) val fillWidthConstraints = constraints.copy(minWidth = constraints.maxWidth) val buttonsPlaceable: Placeable = val buttonsPlaceable: Placeable = Loading Loading @@ -307,10 +304,10 @@ object VolumePanelRadioButtonBarDefaults { */ */ @Composable @Composable fun defaultColors( fun defaultColors( indicatorColor: Color = MaterialTheme.colorScheme.tertiaryContainer, indicatorColor: Color = MaterialTheme.colorScheme.tertiary, indicatorBackgroundColor: Color = MaterialTheme.colorScheme.surface, indicatorBackgroundColor: Color = MaterialTheme.colorScheme.surface, iconColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, iconColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, selectedIconColor: Color = MaterialTheme.colorScheme.onTertiaryContainer, selectedIconColor: Color = MaterialTheme.colorScheme.onTertiary, labelColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, labelColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, selectedLabelColor: Color = MaterialTheme.colorScheme.onSurface, selectedLabelColor: Color = MaterialTheme.colorScheme.onSurface, ): VolumePanelRadioButtonBarColors = ): VolumePanelRadioButtonBarColors = Loading packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/spatialaudio/ui/composable/SpatialAudioPopup.kt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -68,6 +68,7 @@ constructor( text = stringResource(R.string.volume_panel_spatial_audio_title), text = stringResource(R.string.volume_panel_spatial_audio_title), style = MaterialTheme.typography.titleMedium, style = MaterialTheme.typography.titleMedium, textAlign = TextAlign.Center, textAlign = TextAlign.Center, color = MaterialTheme.colorScheme.onSurface, maxLines = 1, maxLines = 1, ) ) } } Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/button/ui/composable/ButtonComponent.kt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -108,6 +108,7 @@ class ButtonComponent( } else { } else { MaterialTheme.colorScheme.onSurface MaterialTheme.colorScheme.onSurface }, }, useModifierBasedImplementation = true, onClick = { onClick(it, gravity) }, onClick = { onClick(it, gravity) }, ) { ) { Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Loading
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/mediaoutput/ui/composable/MediaOutputComponent.kt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -103,6 +103,7 @@ class MediaOutputComponent @Inject constructor(private val viewModel: MediaOutpu MaterialTheme.colorScheme.surfaceContainerHighest MaterialTheme.colorScheme.surfaceContainerHighest }, }, shape = RoundedCornerShape(28.dp), shape = RoundedCornerShape(28.dp), useModifierBasedImplementation = true, onClick = onClick = if (enabled) { if (enabled) { { viewModel.onBarClick(it) } { viewModel.onBarClick(it) } Loading
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/popup/ui/composable/VolumePanelPopup.kt +5 −8 Original line number Original line Diff line number Diff line Loading @@ -68,10 +68,7 @@ constructor( content: @Composable (SystemUIDialog) -> Unit, content: @Composable (SystemUIDialog) -> Unit, ) { ) { val dialog = val dialog = dialogFactory.create( dialogFactory.create(theme = R.style.Theme_VolumePanel_Popup, dialogGravity = gravity) { theme = R.style.Theme_VolumePanel_Popup, dialogGravity = gravity, ) { PopupComposable(it, title, content) PopupComposable(it, title, content) } } val controller = expandable?.dialogTransitionController() val controller = expandable?.dialogTransitionController() Loading @@ -97,7 +94,7 @@ constructor( Box( Box( modifier = modifier = Modifier.padding(horizontal = 80.dp).fillMaxWidth().wrapContentHeight(), Modifier.padding(horizontal = 80.dp).fillMaxWidth().wrapContentHeight(), contentAlignment = Alignment.Center contentAlignment = Alignment.Center, ) { ) { title(dialog) title(dialog) } } Loading @@ -105,7 +102,7 @@ constructor( Box( Box( modifier = modifier = Modifier.padding(horizontal = 16.dp).fillMaxWidth().wrapContentHeight(), Modifier.padding(horizontal = 16.dp).fillMaxWidth().wrapContentHeight(), contentAlignment = Alignment.Center contentAlignment = Alignment.Center, ) { ) { content(dialog) content(dialog) } } Loading @@ -116,8 +113,8 @@ constructor( onClick = { dialog.dismiss() }, onClick = { dialog.dismiss() }, colors = colors = IconButtonDefaults.iconButtonColors( IconButtonDefaults.iconButtonColors( contentColor = MaterialTheme.colorScheme.outline contentColor = MaterialTheme.colorScheme.onSurfaceVariant ) ), ) { ) { Icon( Icon( painterResource(R.drawable.ic_close), painterResource(R.drawable.ic_close), Loading
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/selector/ui/composable/VolumePanelRadioButtons.kt +9 −12 Original line number Original line Diff line number Diff line Loading @@ -82,7 +82,7 @@ fun VolumePanelRadioButtonBar( indicatorBackgroundCornerSize: CornerSize = indicatorBackgroundCornerSize: CornerSize = CornerSize(VolumePanelRadioButtonBarDefaults.DefaultIndicatorBackgroundCornerRadius), CornerSize(VolumePanelRadioButtonBarDefaults.DefaultIndicatorBackgroundCornerRadius), colors: VolumePanelRadioButtonBarColors = VolumePanelRadioButtonBarDefaults.defaultColors(), colors: VolumePanelRadioButtonBarColors = VolumePanelRadioButtonBarDefaults.defaultColors(), content: VolumePanelRadioButtonBarScope.() -> Unit content: VolumePanelRadioButtonBarScope.() -> Unit, ) { ) { val scope = val scope = VolumePanelRadioButtonBarScopeImpl().apply(content).apply { VolumePanelRadioButtonBarScopeImpl().apply(content).apply { Loading @@ -108,16 +108,13 @@ fun VolumePanelRadioButtonBar( Modifier.layoutId(RadioButtonBarComponent.Indicator) Modifier.layoutId(RadioButtonBarComponent.Indicator) .offset { IntOffset(offsetAnimatable.value, 0) } .offset { IntOffset(offsetAnimatable.value, 0) } .padding(indicatorBackgroundPadding) .padding(indicatorBackgroundPadding) .background( .background(colors.indicatorColor, RoundedCornerShape(indicatorCornerSize)) colors.indicatorColor, RoundedCornerShape(indicatorCornerSize), ) ) ) Row( Row( modifier = modifier = Modifier.layoutId(RadioButtonBarComponent.Buttons) Modifier.layoutId(RadioButtonBarComponent.Buttons) .padding(indicatorBackgroundPadding), .padding(indicatorBackgroundPadding), horizontalArrangement = Arrangement.spacedBy(spacing) horizontalArrangement = Arrangement.spacedBy(spacing), ) { ) { for (itemIndex in items.indices) { for (itemIndex in items.indices) { val item = items[itemIndex] val item = items[itemIndex] Loading @@ -134,7 +131,7 @@ fun VolumePanelRadioButtonBar( .clickable( .clickable( interactionSource = null, interactionSource = null, indication = null, indication = null, onClick = { items[itemIndex].onItemSelected() } onClick = { items[itemIndex].onItemSelected() }, ), ), horizontalArrangement = Arrangement.Center, horizontalArrangement = Arrangement.Center, verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically, Loading @@ -155,7 +152,7 @@ fun VolumePanelRadioButtonBar( .padding( .padding( start = indicatorBackgroundPadding, start = indicatorBackgroundPadding, top = labelIndicatorBackgroundSpacing, top = labelIndicatorBackgroundSpacing, end = indicatorBackgroundPadding end = indicatorBackgroundPadding, ) ) .clearAndSetSemantics {}, .clearAndSetSemantics {}, horizontalArrangement = Arrangement.spacedBy(spacing), horizontalArrangement = Arrangement.spacedBy(spacing), Loading @@ -166,7 +163,7 @@ fun VolumePanelRadioButtonBar( modifier = Modifier.weight(1f), modifier = Modifier.weight(1f), onClick = { items[itemIndex].onItemSelected() }, onClick = { items[itemIndex].onItemSelected() }, shape = RoundedCornerShape(cornersRadius), shape = RoundedCornerShape(cornersRadius), contentPadding = PaddingValues(cornersRadius) contentPadding = PaddingValues(cornersRadius), ) { ) { val item = items[itemIndex] val item = items[itemIndex] if (item.icon !== Empty) { if (item.icon !== Empty) { Loading Loading @@ -210,7 +207,7 @@ private class BarMeasurePolicy( override fun MeasureScope.measure( override fun MeasureScope.measure( measurables: List<Measurable>, measurables: List<Measurable>, constraints: Constraints constraints: Constraints, ): MeasureResult { ): MeasureResult { val fillWidthConstraints = constraints.copy(minWidth = constraints.maxWidth) val fillWidthConstraints = constraints.copy(minWidth = constraints.maxWidth) val buttonsPlaceable: Placeable = val buttonsPlaceable: Placeable = Loading Loading @@ -307,10 +304,10 @@ object VolumePanelRadioButtonBarDefaults { */ */ @Composable @Composable fun defaultColors( fun defaultColors( indicatorColor: Color = MaterialTheme.colorScheme.tertiaryContainer, indicatorColor: Color = MaterialTheme.colorScheme.tertiary, indicatorBackgroundColor: Color = MaterialTheme.colorScheme.surface, indicatorBackgroundColor: Color = MaterialTheme.colorScheme.surface, iconColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, iconColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, selectedIconColor: Color = MaterialTheme.colorScheme.onTertiaryContainer, selectedIconColor: Color = MaterialTheme.colorScheme.onTertiary, labelColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, labelColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, selectedLabelColor: Color = MaterialTheme.colorScheme.onSurface, selectedLabelColor: Color = MaterialTheme.colorScheme.onSurface, ): VolumePanelRadioButtonBarColors = ): VolumePanelRadioButtonBarColors = Loading
packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/spatialaudio/ui/composable/SpatialAudioPopup.kt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -68,6 +68,7 @@ constructor( text = stringResource(R.string.volume_panel_spatial_audio_title), text = stringResource(R.string.volume_panel_spatial_audio_title), style = MaterialTheme.typography.titleMedium, style = MaterialTheme.typography.titleMedium, textAlign = TextAlign.Center, textAlign = TextAlign.Center, color = MaterialTheme.colorScheme.onSurface, maxLines = 1, maxLines = 1, ) ) } } Loading