File tree 3 files changed +19
-10
lines changed
java/com/example/jetcaster
3 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -208,15 +208,17 @@ fun EpisodeListItem(
208
208
contentDescription = stringResource(R .string.cd_play),
209
209
contentScale = ContentScale .Fit ,
210
210
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)
216
218
.constrainAs(playIcon) {
217
219
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)
220
222
}
221
223
)
222
224
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ import androidx.compose.ui.Modifier
33
33
import androidx.compose.ui.draw.shadow
34
34
import androidx.compose.ui.graphics.Color
35
35
import androidx.compose.ui.res.stringResource
36
+ import androidx.compose.ui.semantics.onClick
37
+ import androidx.compose.ui.semantics.semantics
36
38
import androidx.compose.ui.unit.dp
37
39
import com.example.jetcaster.R
38
40
@@ -42,9 +44,12 @@ fun ToggleFollowPodcastIconButton(
42
44
onClick : () -> Unit ,
43
45
modifier : Modifier = Modifier
44
46
) {
47
+ val clickLabel = stringResource(if (isFollowed) R .string.cd_unfollow else R .string.cd_follow)
45
48
IconButton (
46
49
onClick = onClick,
47
- modifier = modifier
50
+ modifier = modifier.semantics {
51
+ onClick(label = clickLabel, action = null )
52
+ }
48
53
) {
49
54
Icon (
50
55
// TODO: think about animating these icons
@@ -53,8 +58,8 @@ fun ToggleFollowPodcastIconButton(
53
58
else -> Icons .Default .Add
54
59
},
55
60
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 )
58
63
},
59
64
tint = animateColorAsState(
60
65
when {
Original file line number Diff line number Diff line change 47
47
<string name =" cd_play" >Play</string >
48
48
<string name =" cd_unfollow" >Unfollow</string >
49
49
<string name =" cd_follow" >Follow</string >
50
+ <string name =" cd_following" >Following</string >
51
+ <string name =" cd_not_following" >Not following</string >
50
52
51
53
</resources >
You can’t perform that action at this time.
0 commit comments