Skip to content

Commit

Permalink
Merge pull request #1215 from davotoula/improve-accessibility-add-con…
Browse files Browse the repository at this point in the history
…tent-descriptions

Improve accessibility add content descriptions
  • Loading branch information
vitorpamplona authored Dec 7, 2024
2 parents 15b527c + 1b0ff52 commit 54ab8f1
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ fun NewMediaView(
) {
Icon(
painter = painterResource(R.drawable.relays),
contentDescription = null,
contentDescription = stringRes(id = R.string.relay_list_selector),
modifier = Modifier.height(25.dp),
tint = MaterialTheme.colorScheme.onBackground,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.OpenInNew
import androidx.compose.material.icons.automirrored.filled.VolumeOff
import androidx.compose.material.icons.automirrored.filled.VolumeUp
import androidx.compose.material.icons.filled.AddReaction
import androidx.compose.material.icons.automirrored.outlined.ArrowForwardIos
import androidx.compose.material.icons.filled.Bolt
import androidx.compose.material.icons.filled.Cancel
import androidx.compose.material.icons.filled.Clear
Expand All @@ -46,7 +46,6 @@ import androidx.compose.material.icons.filled.PushPin
import androidx.compose.material.icons.filled.Report
import androidx.compose.material.icons.filled.Share
import androidx.compose.material.icons.outlined.AddReaction
import androidx.compose.material.icons.outlined.ArrowForwardIos
import androidx.compose.material.icons.outlined.Bolt
import androidx.compose.material.icons.outlined.PlayCircle
import androidx.compose.material3.Icon
Expand Down Expand Up @@ -469,7 +468,7 @@ fun PinIcon(
) {
Icon(
imageVector = Icons.Default.PushPin,
contentDescription = null,
contentDescription = stringRes(id = R.string.accessibility_pushpin),
modifier = modifier,
tint = tint,
)
Expand Down Expand Up @@ -620,7 +619,7 @@ fun ZapSplitPreview() {
tint = BitcoinOrange,
)
Icon(
imageVector = Icons.Outlined.ArrowForwardIos,
imageVector = Icons.AutoMirrored.Outlined.ArrowForwardIos,
contentDescription = stringRes(id = R.string.zaps),
modifier =
Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ fun RenderAppDefinition(
var zoomImageDialogOpen by remember { mutableStateOf(false) }

Box(Modifier.size(100.dp)) {
it.picture?.let {
it.picture?.let { picture ->
AsyncImage(
model = it,
contentDescription = null,
model = picture,
contentDescription = it.name,
contentScale = ContentScale.FillWidth,
modifier =
Modifier
Expand All @@ -163,7 +163,7 @@ fun RenderAppDefinition(
.background(MaterialTheme.colorScheme.background)
.combinedClickable(
onClick = { zoomImageDialogOpen = true },
onLongClick = { clipboardManager.setText(AnnotatedString(it)) },
onLongClick = { clipboardManager.setText(AnnotatedString(picture)) },
),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public fun RenderEmojiPack(
IconButton(onClick = { onClick(emoji) }, modifier = Size35Modifier) {
AsyncImage(
model = emoji.url,
contentDescription = null,
contentDescription = emoji.code,
modifier = Size35Modifier,
)
}
Expand All @@ -148,7 +148,7 @@ public fun RenderEmojiPack(
) {
AsyncImage(
model = emoji.url,
contentDescription = null,
contentDescription = emoji.code,
modifier = Size35Modifier,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1300,13 +1300,17 @@ private fun WatchApp(
val appState by baseApp.live().metadata.observeAsState()

var appLogo by remember(baseApp) { mutableStateOf<String?>(null) }
var appName by remember(baseApp) { mutableStateOf<String?>(null) }

LaunchedEffect(key1 = appState) {
withContext(Dispatchers.Default) {
val newAppLogo =
(appState?.note?.event as? AppDefinitionEvent)?.appMetaData()?.picture?.ifBlank { null }
if (newAppLogo != appLogo) {
appLogo = newAppLogo
(appState?.note?.event as? AppDefinitionEvent)?.appMetaData()?.let { metaData ->
metaData.picture?.ifBlank { null }?.let { newLogo ->
if (newLogo != appLogo) appLogo = newLogo
}
metaData.name?.ifBlank { null }?.let { newName ->
if (newName != appName) appName = newName
}
}
}
}
Expand All @@ -1321,7 +1325,7 @@ private fun WatchApp(
) {
AsyncImage(
model = appLogo,
contentDescription = null,
contentDescription = appName,
modifier =
remember {
Modifier
Expand Down
1 change: 1 addition & 0 deletions amethyst/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,7 @@
<string name="accessibility_play_username">Přehrát uživatelské jméno jako audio</string>
<string name="accessibility_scan_qr_code">Skenovat QR kód</string>
<string name="accessibility_navigate_to_alby">Přejít na poskytovatele peněženky třetí strany Alby</string>
<string name="accessibility_pushpin">Připínáček</string>
<string name="it_s_not_possible_to_reply_to_a_draft_note">Není možné odpovědět na koncept</string>
<string name="it_s_not_possible_to_quote_to_a_draft_note">Není možné citovat koncept</string>
<string name="it_s_not_possible_to_react_to_a_draft_note">Není možné reagovat na koncept</string>
Expand Down
1 change: 1 addition & 0 deletions amethyst/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ anz der Bedingungen ist erforderlich</string>
<string name="accessibility_play_username">Benutzernamen als Audio abspielen</string>
<string name="accessibility_scan_qr_code">QR-Code scannen</string>
<string name="accessibility_navigate_to_alby">Navigieren Sie zum Drittanbieter-Wallet-Anbieter Alby</string>
<string name="accessibility_pushpin">Reißzwecke</string>
<string name="it_s_not_possible_to_reply_to_a_draft_note">Es ist nicht möglich, auf einen Entwurf zu antworten</string>
<string name="it_s_not_possible_to_quote_to_a_draft_note">Es ist nicht möglich, einen Entwurf zu zitieren</string>
<string name="it_s_not_possible_to_react_to_a_draft_note">Es ist nicht möglich, auf einen Entwurf zu reagieren</string>
Expand Down
1 change: 1 addition & 0 deletions amethyst/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,7 @@
<string name="accessibility_play_username">Reproduzir nome de usuário como áudio</string>
<string name="accessibility_scan_qr_code">Escanear código QR</string>
<string name="accessibility_navigate_to_alby">Navegar para o provedor de carteira de terceiros Alby</string>
<string name="accessibility_pushpin">Piones</string>
<string name="it_s_not_possible_to_reply_to_a_draft_note">Não é possível responder uma nota em rascunho</string>
<string name="it_s_not_possible_to_quote_to_a_draft_note">Não é possível citar uma nota em rascunho</string>
<string name="it_s_not_possible_to_react_to_a_draft_note">Não é possível reagir uma nota em rascunho</string>
Expand Down
1 change: 1 addition & 0 deletions amethyst/src/main/res/values-sv-rSE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@
<string name="accessibility_play_username">Spela upp användarnamn som ljud</string>
<string name="accessibility_scan_qr_code">Skanna QR-kod</string>
<string name="accessibility_navigate_to_alby">Navigera till tredjeparts plånboksleverantören Alby</string>
<string name="accessibility_pushpin">Häftstift</string>
<string name="it_s_not_possible_to_reply_to_a_draft_note">Det går inte att svara på ett utkast</string>
<string name="it_s_not_possible_to_quote_to_a_draft_note">Det går inte att citera ett utkast</string>
<string name="it_s_not_possible_to_react_to_a_draft_note">Det går inte att reagera på ett utkast</string>
Expand Down
1 change: 1 addition & 0 deletions amethyst/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@
<string name="accessibility_turn_off_sealed_message">Sealed message on. Click to turn off sealed message</string>
<string name="accessibility_send">Send</string>
<string name="accessibility_play_username">Play username as audio</string>
<string name="accessibility_pushpin">Pushpin</string>
<string name="accessibility_scan_qr_code">Scan QR code</string>
<string name="accessibility_navigate_to_alby">Navigate to the third-party wallet provider Alby</string>
<string name="it_s_not_possible_to_reply_to_a_draft_note">It\'s not possible to reply a draft note</string>
Expand Down

0 comments on commit 54ab8f1

Please sign in to comment.