Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.hideFromAccessibility
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
Expand Down Expand Up @@ -253,7 +255,9 @@ private fun StackedGroupAvatar(
text = stringResource(R.string.stream_compose_avatar_overflow_count, count),
size = dimensions.badgeSize,
fixedFontSize = true,
modifier = Modifier.align(Alignment.BottomCenter),
modifier = Modifier
.align(Alignment.BottomCenter)
.semantics { hideFromAccessibility() },
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.heading
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -197,12 +200,15 @@ internal fun DefaultChannelHeaderCenterContent(
onClickLabel = onHeaderTitleClickLabel,
role = Role.Button,
) { callback(channel) }
.semantics(mergeDescendants = true) {}
},
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
Text(
modifier = Modifier.testTag("Stream_ChannelName"),
modifier = Modifier
.testTag("Stream_ChannelName")
.semantics { heading() },
text = title,
style = ChatTheme.typography.headingSmall,
maxLines = 1,
Expand Down Expand Up @@ -274,6 +280,7 @@ internal fun DefaultChannelHeaderTrailingContent(
onClick: ((Channel) -> Unit)?,
onClickLabel: String? = null,
) {
val avatarLabel = ChatTheme.channelNameFormatter.formatChannelName(channel, currentUser)
ChatTheme.componentFactory.ChannelAvatar(
params = ChannelAvatarParams(
modifier = Modifier
Expand All @@ -284,6 +291,9 @@ internal fun DefaultChannelHeaderTrailingContent(
onClickLabel = onClickLabel,
role = Role.Button,
) { callback(channel) }
.semantics(mergeDescendants = true) {
contentDescription = avatarLabel
}
},
channel = channel,
currentUser = currentUser,
Expand Down
Loading