diff --git a/AccessibilityCodelab/app/src/main/java/com/example/jetnews/ui/home/PostCards.kt b/AccessibilityCodelab/app/src/main/java/com/example/jetnews/ui/home/PostCards.kt index def1fd0..64be9ae 100644 --- a/AccessibilityCodelab/app/src/main/java/com/example/jetnews/ui/home/PostCards.kt +++ b/AccessibilityCodelab/app/src/main/java/com/example/jetnews/ui/home/PostCards.kt @@ -29,6 +29,8 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.onClick +import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -42,7 +44,9 @@ import com.example.jetnews.ui.theme.JetnewsTheme fun PostCardHistory(post: Post, navigateToArticle: (String) -> Unit) { var openDialog by remember { mutableStateOf(false) } Row( - Modifier.clickable { navigateToArticle(post.id) } + Modifier.clickable( + onClickLabel = stringResource(id = R.string.action_read_article) + ) { navigateToArticle(post.id) } ) { Image( painter = painterResource(post.imageThumbId), @@ -118,9 +122,12 @@ fun PostCardPopular( navigateToArticle: (String) -> Unit, modifier: Modifier = Modifier ) { + val readArticleLabel = stringResource(id = R.string.action_read_article) Card( shape = MaterialTheme.shapes.medium, - modifier = modifier.size(280.dp, 240.dp), + modifier = modifier + .size(280.dp, 240.dp) + .semantics { onClick(label = readArticleLabel, action = null) }, onClick = { navigateToArticle(post.id) } ) { Column {