mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 13:38:49 +03:00
Improves accessibility talkback on MessageAudioItem
This commit is contained in:
parent
8aaaf80262
commit
931c0e9826
2 changed files with 11 additions and 7 deletions
|
@ -76,7 +76,8 @@ abstract class MessageAudioItem : AbsMessageItem<MessageAudioItem.Holder>() {
|
|||
contentUploadStateTrackerBinder.bind(attributes.informationData.eventId, isLocalFile, holder.progressLayout)
|
||||
} else {
|
||||
holder.audioPlaybackControlButton.setImageResource(R.drawable.ic_cross)
|
||||
holder.audioPlaybackControlButton.contentDescription = holder.view.context.getString(R.string.error_audio_message_unable_to_play)
|
||||
holder.audioPlaybackControlButton.contentDescription =
|
||||
holder.view.context.getString(R.string.error_audio_message_unable_to_play, filename)
|
||||
holder.progressLayout.isVisible = false
|
||||
}
|
||||
}
|
||||
|
@ -105,19 +106,22 @@ abstract class MessageAudioItem : AbsMessageItem<MessageAudioItem.Holder>() {
|
|||
|
||||
private fun renderIdleState(holder: Holder) {
|
||||
holder.audioPlaybackControlButton.setImageResource(R.drawable.ic_play_pause_play)
|
||||
holder.audioPlaybackControlButton.contentDescription = holder.view.context.getString(R.string.a11y_play_audio_message)
|
||||
holder.audioPlaybackControlButton.contentDescription =
|
||||
holder.view.context.getString(R.string.a11y_play_audio_message, filename)
|
||||
holder.audioPlaybackTime.text = formatPlaybackTime(duration)
|
||||
}
|
||||
|
||||
private fun renderPlayingState(holder: Holder, state: AudioMessagePlaybackTracker.Listener.State.Playing) {
|
||||
holder.audioPlaybackControlButton.setImageResource(R.drawable.ic_play_pause_pause)
|
||||
holder.audioPlaybackControlButton.contentDescription = holder.view.context.getString(R.string.a11y_pause_audio_message)
|
||||
holder.audioPlaybackControlButton.contentDescription =
|
||||
holder.view.context.getString(R.string.a11y_pause_audio_message, filename)
|
||||
holder.audioPlaybackTime.text = formatPlaybackTime(state.playbackTime)
|
||||
}
|
||||
|
||||
private fun renderPausedState(holder: Holder, state: AudioMessagePlaybackTracker.Listener.State.Paused) {
|
||||
holder.audioPlaybackControlButton.setImageResource(R.drawable.ic_play_pause_play)
|
||||
holder.audioPlaybackControlButton.contentDescription = holder.view.context.getString(R.string.a11y_play_audio_message)
|
||||
holder.audioPlaybackControlButton.contentDescription =
|
||||
holder.view.context.getString(R.string.a11y_play_audio_message, filename)
|
||||
holder.audioPlaybackTime.text = formatPlaybackTime(state.playbackTime)
|
||||
}
|
||||
|
||||
|
|
|
@ -2860,9 +2860,9 @@
|
|||
<string name="error_voice_message_cannot_reply_or_edit">Cannot reply or edit while voice message is active</string>
|
||||
<string name="voice_message_reply_content">Voice Message (%1$s)</string>
|
||||
|
||||
<string name="a11y_play_audio_message">Play Audio Message</string>
|
||||
<string name="a11y_pause_audio_message">Pause Audio Message</string>
|
||||
<string name="error_audio_message_unable_to_play">Pause Audio Message</string>
|
||||
<string name="a11y_play_audio_message">Play %1$s</string>
|
||||
<string name="a11y_pause_audio_message">Pause %1$s</string>
|
||||
<string name="error_audio_message_unable_to_play">Unable to play %1$s</string>
|
||||
<string name="audio_message_reply_content">%1$s (%2$s)</string>
|
||||
|
||||
<string name="upgrade_room_for_restricted">Anyone in %s will be able to find and join this room - no need to manually invite everyone. You’ll be able to change this in room settings anytime.</string>
|
||||
|
|
Loading…
Reference in a new issue