Add accessibility descriptions to voice note player view.

Fixes #11518
This commit is contained in:
Alex Hart
2021-08-03 09:57:44 -03:00
parent 2830132b24
commit 2d5492ffac
3 changed files with 16 additions and 0 deletions

View File

@@ -99,6 +99,7 @@ class VoiceNotePlayerView @JvmOverloads constructor(
background.colorFilter = SimpleColorFilter(ContextCompat.getColor(context, R.color.voice_note_player_view_background))
}
contentDescription = context.getString(R.string.VoiceNotePlayerView__navigate_to_voice_message)
setOnClickListener {
lastState?.let {
listener?.onNavigateToMessage(it.threadId, it.threadRecipientId, it.senderId, it.messageTimestamp, it.messagePositionInThread)
@@ -171,6 +172,12 @@ class VoiceNotePlayerView @JvmOverloads constructor(
}
lottieDirection = direction
playPauseToggleView.contentDescription = if (direction == TO_PLAY) {
context.getString(R.string.VoiceNotePlayerView__play_voice_message)
} else {
context.getString(R.string.VoiceNotePlayerView__pause_voice_message)
}
playPauseToggleView.pauseAnimation()
playPauseToggleView.speed = (direction * 2).toFloat()
playPauseToggleView.resumeAnimation()