mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
[a11y] Add content descriptions to room list item indicators (#5236)
* [a11y] Add content descriptions to room list item indicators. These can now be read aloud as 'ongoing call', 'new messages', 'new mentions'. * Add `contentDescription` to `UnreadIndicatorAtom` as an optional value * Make the 'ongoing call', 'new messages', etc. indicators be read aloud before the latest event of the room summary --------- Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
committed by
GitHub
parent
da03a50500
commit
cc3d04ad84
+6
@@ -15,6 +15,8 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.semantics.contentDescription
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import io.element.android.compound.theme.ElementTheme
|
||||
@@ -28,9 +30,13 @@ fun UnreadIndicatorAtom(
|
||||
size: Dp = 12.dp,
|
||||
color: Color = ElementTheme.colors.unreadIndicator,
|
||||
isVisible: Boolean = true,
|
||||
contentDescription: String? = null,
|
||||
) {
|
||||
Box(
|
||||
modifier = modifier
|
||||
.semantics {
|
||||
contentDescription?.let { this.contentDescription = it }
|
||||
}
|
||||
.size(size)
|
||||
.clip(CircleShape)
|
||||
.background(if (isVisible) color else Color.Transparent)
|
||||
|
||||
Reference in New Issue
Block a user