diff --git a/gradle.properties b/gradle.properties index ca2a3be9c8..27f4377cd1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -72,3 +72,6 @@ strict.build=false # media3 checkout media3Checkout= + +# Enabled parallel sync for Gradle 9.4+ +org.gradle.tooling.parallel=true diff --git a/media/audio-ui-material3/src/main/java/com/google/android/horologist/audio/ui/material3/VolumeScreen.kt b/media/audio-ui-material3/src/main/java/com/google/android/horologist/audio/ui/material3/VolumeScreen.kt index b1347d60a9..a1c80742ec 100644 --- a/media/audio-ui-material3/src/main/java/com/google/android/horologist/audio/ui/material3/VolumeScreen.kt +++ b/media/audio-ui-material3/src/main/java/com/google/android/horologist/audio/ui/material3/VolumeScreen.kt @@ -38,6 +38,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.LiveRegionMode +import androidx.compose.ui.semantics.clearAndSetSemantics import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.liveRegion import androidx.compose.ui.semantics.semantics @@ -292,6 +293,10 @@ public fun VolumeScreen( if (showVolumeIndicator) { VolumeLevelIndicator(volumeUiState = volume, colorScheme = colorScheme) } + val increaseContentDesc = + stringResource(id = R.string.horologist_volume_screen_volume_up_content_description) + val decreaseContentDesc = + stringResource(id = R.string.horologist_volume_screen_volume_down_content_description) Stepper( modifier = modifier.semantics { @@ -301,8 +306,26 @@ public fun VolumeScreen( value = currentValue, onValueChange = { if (it > volumeState.current) increaseVolume() else decreaseVolume() }, steps = volumeState.max - 1, - increaseIcon = { increaseIcon() }, - decreaseIcon = { decreaseIcon() }, + increaseIcon = { + Box( + modifier = + Modifier.clearAndSetSemantics { + contentDescription = increaseContentDesc + } + ) { + increaseIcon() + } + }, + decreaseIcon = { + Box( + modifier = + Modifier.clearAndSetSemantics { + contentDescription = decreaseContentDesc + } + ) { + decreaseIcon() + } + }, colors = StepperDefaults.colors( contentColor = colorScheme.onSurface, diff --git a/media/audio-ui/src/main/java/com/google/android/horologist/audio/ui/VolumeScreen.kt b/media/audio-ui/src/main/java/com/google/android/horologist/audio/ui/VolumeScreen.kt index 8315439549..7eaa3876cb 100644 --- a/media/audio-ui/src/main/java/com/google/android/horologist/audio/ui/VolumeScreen.kt +++ b/media/audio-ui/src/main/java/com/google/android/horologist/audio/ui/VolumeScreen.kt @@ -19,6 +19,7 @@ package com.google.android.horologist.audio.ui import android.media.AudioManager +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material.icons.Icons @@ -33,10 +34,9 @@ import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.LiveRegionMode -import androidx.compose.ui.semantics.Role +import androidx.compose.ui.semantics.clearAndSetSemantics import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.liveRegion -import androidx.compose.ui.semantics.role import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow @@ -206,6 +206,10 @@ internal fun VolumeScreen( } else { stringResource(id = R.string.horologist_volume_screen_volume_percent, volumePercent) } + val increaseContentDesc = + stringResource(id = R.string.horologist_volume_screen_volume_up_content_description) + val decreaseContentDesc = + stringResource(id = R.string.horologist_volume_screen_volume_down_content_description) Stepper( modifier = modifier.semantics { liveRegion = LiveRegionMode.Assertive @@ -216,10 +220,24 @@ internal fun VolumeScreen( steps = volumeState.max - 1, valueRange = (0f..volumeState.max.toFloat()), increaseIcon = { + Box( + modifier = + Modifier.clearAndSetSemantics { + contentDescription = increaseContentDesc + } + ) { increaseIcon() + } }, decreaseIcon = { + Box( + modifier = + Modifier.clearAndSetSemantics { + contentDescription = decreaseContentDesc + } + ) { decreaseIcon() + } }, enableRangeSemantics = false, ) { @@ -237,7 +255,7 @@ public object VolumeScreenDefaults { @Composable public fun IncreaseIcon() { Icon( - modifier = Modifier.size(26.dp).semantics { role = Role.Button }, + modifier = Modifier.size(26.dp), paintable = Icons.AutoMirrored.Outlined.VolumeUp.asPaintable(), contentDescription = stringResource(id = R.string.horologist_volume_screen_volume_up_content_description), ) @@ -246,7 +264,7 @@ public object VolumeScreenDefaults { @Composable public fun DecreaseIcon() { Icon( - modifier = Modifier.size(26.dp).semantics { role = Role.Button }, + modifier = Modifier.size(26.dp), paintable = Icons.AutoMirrored.Outlined.VolumeDown.asPaintable(), contentDescription = stringResource(id = R.string.horologist_volume_screen_volume_down_content_description), )