Skip to content

Commit 27c1012

Browse files
committed
[a11y] Ensure that the loading state is read out.
1 parent b262c4f commit 27c1012

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/incoming/IncomingVerificationView.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ import androidx.compose.ui.Alignment
2020
import androidx.compose.ui.Modifier
2121
import androidx.compose.ui.graphics.Color
2222
import androidx.compose.ui.res.stringResource
23+
import androidx.compose.ui.semantics.ProgressBarRangeInfo
2324
import androidx.compose.ui.semantics.contentDescription
2425
import androidx.compose.ui.semantics.focused
26+
import androidx.compose.ui.semantics.progressBarRangeInfo
2527
import androidx.compose.ui.semantics.semantics
2628
import androidx.compose.ui.text.style.TextAlign
2729
import androidx.compose.ui.tooling.preview.PreviewParameter
@@ -155,6 +157,10 @@ private fun IncomingVerificationHeader(step: Step, request: VerificationRequest.
155157
.semantics(mergeDescendants = true) {
156158
contentDescription = timeLimitMessage
157159
focused = true
160+
if (iconStyle == BigIcon.Style.Loading) {
161+
// Same code than Modifier.progressSemantics()
162+
progressBarRangeInfo = ProgressBarRangeInfo.Indeterminate
163+
}
158164
}
159165
.focusable(),
160166
iconStyle = iconStyle,

features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/outgoing/OutgoingVerificationView.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ import androidx.compose.ui.Alignment
2323
import androidx.compose.ui.Modifier
2424
import androidx.compose.ui.graphics.Color
2525
import androidx.compose.ui.res.stringResource
26+
import androidx.compose.ui.semantics.ProgressBarRangeInfo
2627
import androidx.compose.ui.semantics.contentDescription
2728
import androidx.compose.ui.semantics.focused
29+
import androidx.compose.ui.semantics.progressBarRangeInfo
2830
import androidx.compose.ui.semantics.semantics
2931
import androidx.compose.ui.tooling.preview.PreviewParameter
3032
import androidx.compose.ui.unit.dp
@@ -195,6 +197,10 @@ private fun OutgoingVerificationHeader(step: Step, request: VerificationRequest.
195197
.semantics(mergeDescendants = true) {
196198
contentDescription = timeLimitMessage
197199
focused = true
200+
if (iconStyle == BigIcon.Style.Loading) {
201+
// Same code than Modifier.progressSemantics()
202+
progressBarRangeInfo = ProgressBarRangeInfo.Indeterminate
203+
}
198204
}
199205
.focusable(),
200206
iconStyle = iconStyle,

0 commit comments

Comments
 (0)