diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index 423dd7dc5d..ea5dc83997 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -260,9 +260,9 @@ class RoomDetailFragment : roomDetailViewModel.selectSubscribe(RoomDetailViewState::sendMode) { mode -> when (mode) { is SendMode.REGULAR -> renderRegularMode(mode.text) - is SendMode.EDIT -> renderSpecialMode(mode.timelineEvent, R.drawable.ic_edit, mode.text) - is SendMode.QUOTE -> renderSpecialMode(mode.timelineEvent, R.drawable.ic_quote, mode.text) - is SendMode.REPLY -> renderSpecialMode(mode.timelineEvent, R.drawable.ic_reply, mode.text) + is SendMode.EDIT -> renderSpecialMode(mode.timelineEvent, R.drawable.ic_edit, R.string.edit, mode.text) + is SendMode.QUOTE -> renderSpecialMode(mode.timelineEvent, R.drawable.ic_quote, R.string.quote, mode.text) + is SendMode.REPLY -> renderSpecialMode(mode.timelineEvent, R.drawable.ic_reply, R.string.reply, mode.text) } } @@ -357,10 +357,12 @@ class RoomDetailFragment : composerLayout.collapse() updateComposerText(text) + composerLayout.sendButton.setContentDescription(getString(R.string.send)) } private fun renderSpecialMode(event: TimelineEvent, @DrawableRes iconRes: Int, + descriptionRes: Int, defaultContent: String) { commandAutocompletePolicy.enabled = false //switch to expanded bar @@ -384,6 +386,8 @@ class RoomDetailFragment : updateComposerText(defaultContent) composerLayout.composerRelatedMessageActionIcon.setImageDrawable(ContextCompat.getDrawable(requireContext(), iconRes)) + composerLayout.sendButton.setContentDescription(getString(descriptionRes)) + avatarRenderer.render(event.senderAvatar, event.root.senderId ?: "", event.senderName, composerLayout.composerRelatedMessageAvatar) @@ -592,6 +596,7 @@ class RoomDetailFragment : Timber.w("Send button is locked") return@setOnClickListener } + composerLayout.sendButton.setContentDescription(getString(R.string.send)) val textMessage = composerLayout.composerEditText.text.toString() if (textMessage.isNotBlank()) { lockSendButton = true diff --git a/vector/src/main/res/layout/merge_composer_layout.xml b/vector/src/main/res/layout/merge_composer_layout.xml index 641ce666ca..0142f65a3e 100644 --- a/vector/src/main/res/layout/merge_composer_layout.xml +++ b/vector/src/main/res/layout/merge_composer_layout.xml @@ -73,6 +73,7 @@ android:background="?android:attr/selectableItemBackground" android:contentDescription="@string/action_close" android:src="@drawable/ic_close_round" + android:contentDescription="@string/action_close" android:tint="@color/riotx_notice" tools:ignore="MissingConstraints" /> @@ -91,6 +92,7 @@ android:background="?android:attr/selectableItemBackground" android:contentDescription="@string/send_attachment" android:src="@drawable/ic_attachment" + android:contentDescription="@string/option_send_files" android:tint="?attr/colorAccent" tools:ignore="MissingConstraints" /> @@ -111,6 +113,7 @@ android:background="?android:attr/selectableItemBackground" android:contentDescription="@string/send" android:src="@drawable/ic_send" + android:contentDescription="@string/send" android:tint="?attr/colorAccent" tools:ignore="MissingConstraints" /> @@ -128,4 +131,4 @@ tools:hint="@string/room_message_placeholder_not_encrypted" tools:ignore="MissingConstraints" /> - \ No newline at end of file +