Skip to content

Commit

Permalink
feat: Add accessibility strings to CreateGroup [WPB-9786] (#3541)
Browse files Browse the repository at this point in the history
  • Loading branch information
borichellow authored Oct 25, 2024
1 parent 504f25e commit 2b1e5cc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import com.wire.android.ui.common.rememberTopBarElevationState
import com.wire.android.ui.common.scaffold.WireScaffold
import com.wire.android.ui.common.textfield.WireTextField
import com.wire.android.ui.common.textfield.WireTextFieldState
import com.wire.android.ui.common.topappbar.NavigationIconType
import com.wire.android.ui.common.topappbar.WireCenterAlignedTopAppBar
import com.wire.android.ui.theme.WireTheme
import com.wire.android.ui.theme.wireColorScheme
Expand All @@ -73,10 +74,14 @@ fun GroupNameScreen(
WireScaffold(
modifier = modifier,
topBar = {
val titleContentDescription =
if (mode == CREATION) stringResource(id = R.string.content_description_new_conversation_name_heading) else null
WireCenterAlignedTopAppBar(
elevation = scrollState.rememberTopBarElevationState().value,
onNavigationPressed = onBackPressed,
title = stringResource(id = if (mode == CREATION) R.string.new_group_title else R.string.group_name_title)
title = stringResource(id = if (mode == CREATION) R.string.new_group_title else R.string.group_name_title),
titleContentDescription = titleContentDescription,
navigationIconType = NavigationIconType.Back(R.string.content_description_new_conversation_name_back_btn)
)
}
) { internalPadding ->
Expand Down Expand Up @@ -116,6 +121,7 @@ fun GroupNameScreen(
state = computeGroupMetadataState(error),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text, imeAction = ImeAction.Done),
onKeyboardAction = { keyboardController?.hide() },
semanticDescription = stringResource(id = R.string.content_description_new_conversation_name_field),
modifier = Modifier.padding(horizontal = MaterialTheme.wireDimensions.spacing16x)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ private fun ConversationScreenTopAppBarContent(
}
},
navigationIcon = {
NavigationIconButton(NavigationIconType.Back(), onBackButtonClick)
NavigationIconButton(
NavigationIconType.Back(R.string.content_description_conversation_back_btn),
onBackButtonClick
)
},
actions = {
Row(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import com.wire.android.ui.common.WireDialogButtonType
import com.wire.android.ui.common.button.WireButtonState
import com.wire.android.ui.common.button.WirePrimaryButton
import com.wire.android.ui.common.dimensions
import com.wire.android.ui.common.topappbar.NavigationIconType
import com.wire.android.ui.common.topappbar.WireCenterAlignedTopAppBar
import com.wire.android.ui.destinations.ConversationScreenDestination
import com.wire.android.ui.destinations.HomeScreenDestination
Expand Down Expand Up @@ -119,7 +120,9 @@ fun GroupOptionScreenContent(
WireCenterAlignedTopAppBar(
onNavigationPressed = onBackPressed,
elevation = dimensions().spacing0x,
title = stringResource(id = R.string.new_group_title)
title = stringResource(id = R.string.new_group_title),
titleContentDescription = stringResource(id = R.string.content_description_new_conversation_options_heading),
navigationIconType = NavigationIconType.Back(R.string.content_description_new_conversation_options_back_btn)
)
}) { internalPadding ->
GroupOptionsScreenMainContent(
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
<string name="content_description_conversation_send_emoticon">Send Emoticon button</string>
<string name="content_description_conversation_send_gif">Send GIF button</string>
<string name="content_description_conversation_mention_someone">Mention someone</string>
<string name="content_description_conversation_back_btn">Go back to conversation list</string>
<string name="content_description_new_conversation">Start a new conversation</string>
<string name="content_description_back_button">Back button</string>
<string name="content_description_send_button">Send</string>
Expand Down Expand Up @@ -213,6 +214,11 @@
<string name="content_description_open_user_profile_label">open profile</string>
<string name="content_description_open_service_label">open service</string>
<string name="content_description_open_notification_settings_label">open notification settings</string>
<string name="content_description_new_conversation_name_back_btn">Go back to new conversation view</string>
<string name="content_description_new_conversation_name_heading">New group, heading</string>
<string name="content_description_new_conversation_name_field">Type group name</string>
<string name="content_description_new_conversation_options_heading">Conversation options, heading</string>
<string name="content_description_new_conversation_options_back_btn">Go back to new group creation</string>
<string name="content_description_empty"> </string>
<!-- Non translatable strings-->
<string name="url_android_release_notes" translatable="false">https://medium.com/wire-news/android-updates/home</string>
Expand Down

0 comments on commit 2b1e5cc

Please sign in to comment.