diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/JoinButton.kt b/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/JoinButton.kt index c809cfaeb89..9ab35dea3bd 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/JoinButton.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/JoinButton.kt @@ -67,7 +67,8 @@ fun JoinButton( contentPadding = PaddingValues( horizontal = dimensions().spacing8x, vertical = dimensions().spacing4x - ) + ), + onClickDescription = stringResource(R.string.content_description_join_call_label) ) } diff --git a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt index 3892f3b2899..a5603942fd8 100644 --- a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt +++ b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt @@ -123,7 +123,7 @@ fun ConnectionActionButton( leadingIcon = { Icon( painter = painterResource(id = R.drawable.ic_check_tick), - contentDescription = stringResource(R.string.content_description_right_arrow), + contentDescription = null, modifier = Modifier.padding(dimensions().spacing8x) ) }, @@ -139,7 +139,7 @@ fun ConnectionActionButton( leadingIcon = { Icon( painter = painterResource(id = R.drawable.ic_check_tick), - contentDescription = stringResource(R.string.content_description_right_arrow), + contentDescription = null, modifier = Modifier.padding(dimensions().spacing8x) ) }, @@ -159,7 +159,7 @@ fun ConnectionActionButton( leadingIcon = { Icon( painter = painterResource(id = R.drawable.ic_close), - contentDescription = stringResource(R.string.content_description_right_arrow), + contentDescription = null, modifier = Modifier.padding(dimensions().spacing8x) ) }, @@ -194,7 +194,7 @@ fun ConnectionActionButton( leadingIcon = { Icon( painter = painterResource(id = R.drawable.ic_add_contact), - contentDescription = stringResource(R.string.content_description_right_arrow), + contentDescription = null, modifier = Modifier.padding(dimensions().spacing8x) ) }, diff --git a/app/src/main/kotlin/com/wire/android/ui/home/HomeTopBar.kt b/app/src/main/kotlin/com/wire/android/ui/home/HomeTopBar.kt index a50d4ccc15c..f2ab8d539ad 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/HomeTopBar.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/HomeTopBar.kt @@ -68,11 +68,15 @@ fun HomeTopBar( onButtonClicked = { onOpenConversationFilter(navigationItem.currentFilter()) } ) } + val openLabel = stringResource(R.string.content_description_open_label) UserProfileAvatar( avatarData = userAvatarData, - clickable = remember { Clickable(enabled = true) { onNavigateToSelfUserProfile() } }, + clickable = remember { + Clickable(enabled = true, onClickDescription = openLabel) { onNavigateToSelfUserProfile() } + }, type = UserProfileAvatarType.WithIndicators.RegularUser(legalHoldIndicatorVisible = withLegalHoldIndicator), - shouldShowCreateTeamUnreadIndicator = shouldShowCreateTeamUnreadIndicator + shouldShowCreateTeamUnreadIndicator = shouldShowCreateTeamUnreadIndicator, + contentDescription = stringResource(R.string.content_description_home_profile_btn) ) }, elevation = elevation, diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt index d1634891bb2..a6d19e62bc7 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt @@ -337,8 +337,7 @@ private fun GroupConversationDetailsContent( WireTopAppBarTitle( title = stringResource(R.string.conversation_details_title), style = MaterialTheme.wireTypography.title01, - maxLines = 2, - contentDescription = stringResource(id = R.string.content_description_conversation_details_header) + maxLines = 2 ) VerificationInfo(conversationSheetContent) }, diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/EditGuestAccessScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/EditGuestAccessScreen.kt index 31f7a44653e..3b868e3c109 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/EditGuestAccessScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/EditGuestAccessScreen.kt @@ -102,12 +102,12 @@ fun EditGuestAccessScreen( WireScaffold( modifier = modifier, topBar = { + val title = stringResource(id = R.string.conversation_options_guests_label) WireCenterAlignedTopAppBar( elevation = scrollState.rememberTopBarElevationState().value, navigationIconType = NavigationIconType.Back(R.string.content_description_edit_guests_option_back_btn), onNavigationPressed = navigator::navigateBack, - title = stringResource(id = R.string.conversation_options_guests_label), - titleContentDescription = stringResource(id = R.string.content_description_edit_guests_option_title) + title = title ) } ) { internalPadding -> diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editselfdeletingmessages/EditSelfDeletingMessagesScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editselfdeletingmessages/EditSelfDeletingMessagesScreen.kt index e83ce0ce926..e94f82aacd3 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editselfdeletingmessages/EditSelfDeletingMessagesScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editselfdeletingmessages/EditSelfDeletingMessagesScreen.kt @@ -73,11 +73,11 @@ fun EditSelfDeletingMessagesScreen( WireScaffold( topBar = { + val title = stringResource(id = R.string.self_deleting_messages_title) WireCenterAlignedTopAppBar( elevation = scrollState.rememberTopBarElevationState().value, onNavigationPressed = navigator::navigateBack, - title = stringResource(id = R.string.self_deleting_messages_title), - titleContentDescription = stringResource(id = R.string.content_description_edit_self_delete_title), + title = title, navigationIconType = NavigationIconType.Back(R.string.content_description_edit_self_delete_back_btn) ) } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/ConversationItemFactory.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/ConversationItemFactory.kt index 00af94244ad..44ac89e3f7a 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/ConversationItemFactory.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/ConversationItemFactory.kt @@ -73,23 +73,29 @@ fun ConversationItemFactory( joinCall: (ConversationId) -> Unit = {}, onAudioPermissionPermanentlyDenied: () -> Unit = {} ) { + val openConversationOptionDescription = stringResource(R.string.content_description_conversation_details_more_btn) + val openUserProfileDescription = stringResource(R.string.content_description_open_user_profile_label) + val openConversationDescription = stringResource(R.string.content_description_open_conversation_label) val onConversationItemClick = remember(conversation) { - Clickable( - enabled = true, - onClick = { - when (val lastEvent = conversation.lastMessageContent) { - is UILastMessageContent.Connection -> openUserProfile(lastEvent.userId) - else -> openConversation(conversation) - } - }, - onLongClick = { - when (conversation.lastMessageContent) { - is UILastMessageContent.Connection -> {} - else -> openMenu(conversation) - } - } - ) + when (val lastEvent = conversation.lastMessageContent) { + is UILastMessageContent.Connection -> Clickable( + enabled = true, + onClick = { openUserProfile(lastEvent.userId) }, + onLongClick = null, + onClickDescription = openUserProfileDescription, + onLongClickDescription = null + ) + + else -> Clickable( + enabled = true, + onClick = { openConversation(conversation) }, + onLongClick = { openMenu(conversation) }, + onClickDescription = openConversationDescription, + onLongClickDescription = openConversationOptionDescription, + ) + } } + GeneralConversationItem( modifier = modifier, conversation = conversation, diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/EventBadge.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/EventBadge.kt index 9af701408d0..62ddaa0bdcf 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/EventBadge.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/EventBadge.kt @@ -149,6 +149,7 @@ fun ConnectRequestBadge(modifier: Modifier = Modifier) { fun ConnectPendingRequestBadge(modifier: Modifier = Modifier) { WireItemLabel( text = stringResource(id = R.string.connection_pending_label), + contentDescription = stringResource(R.string.content_description_pending_connection_badge), modifier = modifier ) } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/common/UserProfileInfo.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/common/UserProfileInfo.kt index bfea0ba8b60..63ae5a9624a 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/common/UserProfileInfo.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/common/UserProfileInfo.kt @@ -340,11 +340,13 @@ fun QRCodeIcon( modifier: Modifier = Modifier, ) { val contentDescription = stringResource(id = R.string.user_profile_qr_code_share_link) + val clickDescription = stringResource(id = R.string.content_description_share_label) WireSecondaryButton( modifier = modifier.semantics { this.contentDescription = contentDescription }, leadingIcon = Icons.Filled.QrCode.Icon(), contentPadding = PaddingValues(0.dp), onClick = onQrCodeClick, + onClickDescription = clickDescription, fillMaxWidth = false, minSize = MaterialTheme.wireDimensions.buttonSmallMinSize, minClickableSize = MaterialTheme.wireDimensions.buttonMinClickableSize, diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt index ce8ea215c78..a23a0eaaa8d 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt @@ -396,10 +396,12 @@ private fun TopBarHeader( onNavigateBack: () -> Unit, openConversationBottomSheet: () -> Unit ) { - val navigationIconType = if (state.groupState == null) { - NavigationIconType.Close() - } else { + val navigationIconType = if (state.groupState != null) { NavigationIconType.Close(R.string.content_description_user_profile_close_btn) + } else if (state.connectionState == ConnectionState.PENDING || state.connectionState == ConnectionState.IGNORED) { + NavigationIconType.Close(R.string.content_description_connection_request_close_btn) + } else { + NavigationIconType.Close() } WireCenterAlignedTopAppBar( @@ -409,8 +411,7 @@ private fun TopBarHeader( WireTopAppBarTitle( title = stringResource(id = R.string.user_profile_title), style = MaterialTheme.wireTypography.title01, - maxLines = 2, - contentDescription = stringResource(id = R.string.content_description_user_profile_heading) + maxLines = 2 ) }, elevation = elevation, diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index adbfb81c2a5..17905b18ed7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -118,7 +118,7 @@ Send GIF button Mention someone Go back to conversation list - Start a new conversation + Search for people or create a new group Back button Send Self-deleting messages, button @@ -180,7 +180,6 @@ All of all participants are verified (Proteus) Scroll to end of conversation Location item - Conversation details, heading Open conversation options Options Participants @@ -194,24 +193,29 @@ Copy phone Copy email open device details + Close connection request view Search text messages Open overview of pictures and files Add participant, heading Close add partipants view Search people by name or username Go back to add participants view + Your profile + open + join a call + share collapse expand edit select unselect selected + %s, heading toggle setting - Guests, heading Go back to conversation details - Self-deleting messages, heading Go back to conversation details open profile + open conversation open service open notification settings Go back to new conversation view @@ -219,6 +223,7 @@ Type group name Conversation options, heading Go back to new group creation + pending approval of connection request https://medium.com/wire-news/android-updates/home diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireItemLabel.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireItemLabel.kt index a0803d63fe3..8a5ae5ec23b 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireItemLabel.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireItemLabel.kt @@ -33,6 +33,8 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Shape +import androidx.compose.ui.semantics.contentDescription +import androidx.compose.ui.semantics.semantics import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp @@ -43,15 +45,17 @@ import com.wire.android.ui.theme.wireTypography @Composable fun WireItemLabel( text: String, + modifier: Modifier = Modifier, minHeight: Dp = dimensions().badgeSmallMinSize.height, minWidth: Dp = dimensions().badgeSmallMinSize.height, contentPadding: PaddingValues = PaddingValues(horizontal = dimensions().spacing6x, vertical = dimensions().spacing2x), shape: Shape = RoundedCornerShape(dimensions().spacing6x), - modifier: Modifier = Modifier + contentDescription: String = text ) = Box( modifier = modifier .border(width = 1.dp, color = MaterialTheme.wireColorScheme.divider, shape = shape) .padding(contentPadding) + .semantics(mergeDescendants = true) { this.contentDescription = contentDescription } .wrapContentWidth() .wrapContentHeight(), ) { diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/topappbar/WireCenterAlignedTopAppBar.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/topappbar/WireCenterAlignedTopAppBar.kt index a0fd6deef5d..f36138ac40f 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/topappbar/WireCenterAlignedTopAppBar.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/topappbar/WireCenterAlignedTopAppBar.kt @@ -34,6 +34,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.TextLayoutResult @@ -43,6 +44,7 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.Constraints import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp +import com.wire.android.ui.common.R import com.wire.android.ui.common.dimensions import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireDimensions @@ -60,7 +62,7 @@ fun WireCenterAlignedTopAppBar( onNavigationPressed: () -> Unit = {}, navigationIconType: NavigationIconType? = NavigationIconType.Back(), elevation: Dp = MaterialTheme.wireDimensions.topBarShadowElevation, - titleContentDescription: String? = null, + titleContentDescription: String? = stringResource(id = R.string.content_description_heading_suffix, title), actions: @Composable RowScope.() -> Unit = {}, bottomContent: @Composable ColumnScope.() -> Unit = {} ) { @@ -123,7 +125,7 @@ fun WireTopAppBarTitle( style: TextStyle, modifier: Modifier = Modifier, maxLines: Int = 2, - contentDescription: String? = null + contentDescription: String? = stringResource(id = R.string.content_description_heading_suffix, title) ) { // There's an ongoing issue about multiline text taking all width available instead of wrapping visible text. // https://issuetracker.google.com/issues/206039942 diff --git a/core/ui-common/src/main/res/values/strings.xml b/core/ui-common/src/main/res/values/strings.xml index addc62f156d..80d27d1eb5d 100644 --- a/core/ui-common/src/main/res/values/strings.xml +++ b/core/ui-common/src/main/res/values/strings.xml @@ -23,4 +23,6 @@ Close button Main navigation Drop down arrow + %s, heading + pending approval of connection request