Add accessibility labels to navigate up button in ConversationFragment.

Addresses #12951.
This commit is contained in:
Nicholas Tinsley 2023-05-23 12:03:37 -04:00 committed by Nicholas
parent bc88887195
commit 145377b05f
3 changed files with 9 additions and 1 deletions

View file

@ -2102,7 +2102,7 @@ public class ConversationParentFragment extends Fragment
protected void initializeActionBar() {
invalidateOptionsMenu();
toolbar.setOnMenuItemClickListener(menuProvider::onMenuItemSelected);
toolbar.setNavigationContentDescription(R.string.ConversationFragment__content_description_back_button);
if (isInBubble()) {
toolbar.setNavigationIcon(DrawableUtil.tint(ContextUtil.requireDrawable(requireContext(), R.drawable.ic_notification),
ContextCompat.getColor(requireContext(), R.color.signal_accent_primary)));

View file

@ -497,6 +497,7 @@ class ConversationFragment : LoggingFragment(R.layout.v2_conversation_fragment)
private fun presentNavigationIconForNormal() {
binding.toolbar.setNavigationIcon(R.drawable.ic_arrow_left_24)
binding.toolbar.setNavigationContentDescription(R.string.ConversationFragment__content_description_back_button)
binding.toolbar.setNavigationOnClickListener {
requireActivity().finishAfterTransition()
}
@ -508,6 +509,8 @@ class ConversationFragment : LoggingFragment(R.layout.v2_conversation_fragment)
ContextCompat.getColor(requireContext(), R.color.signal_accent_primary)
)
binding.toolbar.setNavigationContentDescription(R.string.ConversationFragment__content_description_launch_signal_button)
binding.toolbar.setNavigationOnClickListener {
startActivity(MainActivity.clearTop(requireContext()))
}

View file

@ -499,6 +499,10 @@
<string name="ConversationFragment__update_build">Update Signal</string>
<!-- Action shown to allow a user to re-register as they are no longer registered -->
<string name="ConversationFragment__reregister_signal">Re-register Signal</string>
<!-- Label for a button displayed in the conversation toolbar to return to the previous screen. -->
<string name="ConversationFragment__content_description_back_button">Navigate back.</string>
<!-- Label for a button displayed in the conversation toolbar to open the main screen of the app. -->
<string name="ConversationFragment__content_description_launch_signal_button">Open Signal</string>
<!-- Label for a button displayed in conversation list to clear the chat filter -->
<string name="ConversationListFragment__clear_filter">Clear filter</string>
<!-- Notice on chat list when no unread chats are available, centered on display -->
@ -6114,5 +6118,6 @@
<!-- Body of a dialog that is displayed when we experienced a network error when looking up a username. -->
<string name="UsernameLinkSettings_qr_result_network_error">Experienced a network error. Please try again.</string>
<!-- EOF -->
</resources>