[a11y] Make more items focusable (#4605)

* Fix settings entry point not available when there is no avatar on the account. Fixes #4599.

* Use Ktx extension `String.toUri()`

* Allow screen reader to focus on the user avatar to allow editing it.

* Fix import order
This commit is contained in:
Benoit Marty 2025-04-22 08:50:50 +02:00 committed by GitHub
parent ec88cbe0e5
commit e2e58749f5
15 changed files with 48 additions and 24 deletions

View file

@ -8,6 +8,7 @@
package io.element.android.features.call.impl.utils
import android.net.Uri
import androidx.core.net.toUri
import javax.inject.Inject
class CallIntentDataParser @Inject constructor() {
@ -17,7 +18,7 @@ class CallIntentDataParser @Inject constructor() {
)
fun parse(data: String?): String? {
val parsedUrl = data?.let { Uri.parse(data) } ?: return null
val parsedUrl = data?.toUri() ?: return null
val scheme = parsedUrl.scheme
return when {
scheme in validHttpSchemes -> parsedUrl
@ -37,7 +38,7 @@ class CallIntentDataParser @Inject constructor() {
private fun Uri.getUrlParameter(): Uri? {
return getQueryParameter("url")
?.let { urlParameter ->
Uri.parse(urlParameter).takeIf { uri ->
urlParameter.toUri().takeIf { uri ->
uri.scheme in validHttpSchemes && !uri.host.isNullOrBlank()
}
}