From bf1db5dcf9af1f8591627e4495ec8927aa8eee3e Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Tue, 10 Aug 2021 14:36:01 +0300 Subject: [PATCH] Remove content description of mic button if it is not visible. --- .../room/detail/composer/VoiceMessageRecorderView.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt index 50d8d8e867..033020bbce 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt @@ -20,6 +20,7 @@ import android.content.Context import android.text.format.DateUtils import android.util.AttributeSet import android.view.MotionEvent +import android.view.View import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.view.isInvisible import androidx.core.view.isVisible @@ -87,6 +88,15 @@ class VoiceMessageRecorderView @JvmOverloads constructor( initListeners() } + override fun onVisibilityChanged(changedView: View, visibility: Int) { + super.onVisibilityChanged(changedView, visibility) + if (changedView == this && visibility == VISIBLE) { + views.voiceMessageMicButton.contentDescription = context.getString(R.string.a11y_start_voice_message) + } else { + views.voiceMessageMicButton.contentDescription = "" + } + } + fun initVoiceRecordingViews() { recordingState = RecordingState.NONE