Skip to content

Commit 673ffa6

Browse files
Merge pull request #606 from android/jv/jc_touch_target
[Jetcaster] A11y improvements
2 parents 4b879d3 + 6a6aa57 commit 673ffa6

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

Jetcaster/app/src/main/java/com/example/jetcaster/ui/home/category/PodcastCategory.kt

+9-7
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,17 @@ fun EpisodeListItem(
208208
contentDescription = stringResource(R.string.cd_play),
209209
contentScale = ContentScale.Fit,
210210
colorFilter = ColorFilter.tint(LocalContentColor.current),
211-
modifier = Modifier.clickable(
212-
interactionSource = remember { MutableInteractionSource() },
213-
indication = rememberRipple(bounded = false, radius = 24.dp)
214-
) { /* TODO */ }
215-
.size(36.dp)
211+
modifier = Modifier
212+
.clickable(
213+
interactionSource = remember { MutableInteractionSource() },
214+
indication = rememberRipple(bounded = false, radius = 24.dp)
215+
) { /* TODO */ }
216+
.size(48.dp)
217+
.padding(6.dp)
216218
.constrainAs(playIcon) {
217219
start.linkTo(parent.start, Keyline1)
218-
top.linkTo(titleImageBarrier, margin = 16.dp)
219-
bottom.linkTo(parent.bottom, 16.dp)
220+
top.linkTo(titleImageBarrier, margin = 10.dp)
221+
bottom.linkTo(parent.bottom, 10.dp)
220222
}
221223
)
222224

Jetcaster/app/src/main/java/com/example/jetcaster/util/Buttons.kt

+8-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import androidx.compose.ui.Modifier
3333
import androidx.compose.ui.draw.shadow
3434
import androidx.compose.ui.graphics.Color
3535
import androidx.compose.ui.res.stringResource
36+
import androidx.compose.ui.semantics.onClick
37+
import androidx.compose.ui.semantics.semantics
3638
import androidx.compose.ui.unit.dp
3739
import com.example.jetcaster.R
3840

@@ -42,9 +44,12 @@ fun ToggleFollowPodcastIconButton(
4244
onClick: () -> Unit,
4345
modifier: Modifier = Modifier
4446
) {
47+
val clickLabel = stringResource(if (isFollowed) R.string.cd_unfollow else R.string.cd_follow)
4548
IconButton(
4649
onClick = onClick,
47-
modifier = modifier
50+
modifier = modifier.semantics {
51+
onClick(label = clickLabel, action = null)
52+
}
4853
) {
4954
Icon(
5055
// TODO: think about animating these icons
@@ -53,8 +58,8 @@ fun ToggleFollowPodcastIconButton(
5358
else -> Icons.Default.Add
5459
},
5560
contentDescription = when {
56-
isFollowed -> stringResource(R.string.cd_unfollow)
57-
else -> stringResource(R.string.cd_follow)
61+
isFollowed -> stringResource(R.string.cd_following)
62+
else -> stringResource(R.string.cd_not_following)
5863
},
5964
tint = animateColorAsState(
6065
when {

Jetcaster/app/src/main/res/values/strings.xml

+2
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,7 @@
4747
<string name="cd_play">Play</string>
4848
<string name="cd_unfollow">Unfollow</string>
4949
<string name="cd_follow">Follow</string>
50+
<string name="cd_following">Following</string>
51+
<string name="cd_not_following">Not following</string>
5052

5153
</resources>

0 commit comments

Comments
 (0)