mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
a11y: improve reaction behavior on message action list.
This commit is contained in:
+8
-3
@@ -39,7 +39,7 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.semantics.clearAndSetSemantics
|
import androidx.compose.ui.semantics.clearAndSetSemantics
|
||||||
import androidx.compose.ui.semantics.contentDescription
|
import androidx.compose.ui.semantics.onClick
|
||||||
import androidx.compose.ui.semantics.semantics
|
import androidx.compose.ui.semantics.semantics
|
||||||
import androidx.compose.ui.semantics.traversalIndex
|
import androidx.compose.ui.semantics.traversalIndex
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
@@ -438,7 +438,7 @@ private fun EmojiButton(
|
|||||||
} else {
|
} else {
|
||||||
Color.Transparent
|
Color.Transparent
|
||||||
}
|
}
|
||||||
val description = if (isHighlighted) {
|
val a11yClickLabel = if (isHighlighted) {
|
||||||
stringResource(id = CommonStrings.a11y_remove_reaction_with, emoji)
|
stringResource(id = CommonStrings.a11y_remove_reaction_with, emoji)
|
||||||
} else {
|
} else {
|
||||||
stringResource(id = CommonStrings.a11y_react_with, emoji)
|
stringResource(id = CommonStrings.a11y_react_with, emoji)
|
||||||
@@ -454,7 +454,12 @@ private fun EmojiButton(
|
|||||||
interactionSource = remember { MutableInteractionSource() }
|
interactionSource = remember { MutableInteractionSource() }
|
||||||
)
|
)
|
||||||
.semantics {
|
.semantics {
|
||||||
contentDescription = description
|
onClick(
|
||||||
|
label = a11yClickLabel,
|
||||||
|
) {
|
||||||
|
onClick(emoji)
|
||||||
|
true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user