a11y: improve reaction behavior on message action list.
This commit is contained in:
parent
4fb73497f1
commit
ca00f71e74
1 changed files with 8 additions and 3 deletions
|
|
@ -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
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue