Skip to content

Commit

Permalink
Added heading semantics for a11y Nothing Playing message. (#2246)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpaikena authored May 29, 2024
1 parent a4e24de commit bef6f97
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.heading
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.wear.compose.material.MaterialTheme
Expand All @@ -40,7 +42,9 @@ public fun MessageMediaDisplay(
val style = MaterialTheme.typography.body2
Text(
text = message.orEmpty(),
modifier = Modifier.fillMaxWidth(0.7f),
modifier = Modifier
.fillMaxWidth(0.7f)
.semantics { heading() },
color = MaterialTheme.colors.onBackground,
textAlign = TextAlign.Center,
overflow = TextOverflow.Ellipsis,
Expand Down

0 comments on commit bef6f97

Please sign in to comment.