Merge pull request #1739 from davotoula/acessibility-issues
Fix minor accessibility issues
This commit is contained in:
+3
-3
@@ -97,18 +97,18 @@ class FavoriteRelayListState(
|
||||
return saveRelayList(current)
|
||||
}
|
||||
|
||||
suspend fun saveRelayList(FavoriteRelays: List<NormalizedRelayUrl>): FavoriteRelayListEvent {
|
||||
suspend fun saveRelayList(favoriteRelays: List<NormalizedRelayUrl>): FavoriteRelayListEvent {
|
||||
val relayListForFavorite = getFavoriteRelayList()
|
||||
|
||||
return if (relayListForFavorite != null && relayListForFavorite.tags.isNotEmpty()) {
|
||||
FavoriteRelayListEvent.updateRelayList(
|
||||
earlierVersion = relayListForFavorite,
|
||||
relays = FavoriteRelays,
|
||||
relays = favoriteRelays,
|
||||
signer = signer,
|
||||
)
|
||||
} else {
|
||||
FavoriteRelayListEvent.create(
|
||||
relays = FavoriteRelays,
|
||||
relays = favoriteRelays,
|
||||
signer = signer,
|
||||
)
|
||||
}
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ fun PlayPauseButton(
|
||||
Icon(
|
||||
imageVector = Icons.Default.Pause,
|
||||
modifier = Size50Modifier,
|
||||
contentDescription = stringRes(R.string.play),
|
||||
contentDescription = stringRes(R.string.pause),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ fun PollDeadlinePicker(model: ShortNotePostViewModel) {
|
||||
modifier = Modifier.padding(16.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Icon(Icons.Default.DateRange, contentDescription = null)
|
||||
Icon(Icons.Default.DateRange, contentDescription = stringResource(R.string.accessibility_select_date))
|
||||
Spacer(Modifier.width(12.dp))
|
||||
|
||||
if (model.closedAt < TimeUtils.oneMinuteFromNow()) {
|
||||
|
||||
@@ -1375,6 +1375,7 @@
|
||||
<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="accessibility_select_date">Select date</string>
|
||||
<string name="it_s_not_possible_to_reply_to_a_draft_note">It\'s not possible to reply a draft note</string>
|
||||
<string name="it_s_not_possible_to_quote_to_a_draft_note">It\'s not possible to quote a draft note</string>
|
||||
<string name="it_s_not_possible_to_react_to_a_draft_note">It\'s not possible to react a draft note</string>
|
||||
|
||||
@@ -50,4 +50,8 @@
|
||||
<string name="screen_messages_description">Your encrypted direct messages will appear here.</string>
|
||||
<string name="screen_notifications_title">Notifications</string>
|
||||
<string name="screen_notifications_description">Mentions, replies, and reactions will appear here.</string>
|
||||
|
||||
<!-- Accessibility -->
|
||||
<string name="accessibility_user_avatar">User avatar</string>
|
||||
<string name="accessibility_navigate">Navigate</string>
|
||||
</resources>
|
||||
|
||||
+5
@@ -35,9 +35,12 @@ import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.vitorpamplona.amethyst.commons.model.User
|
||||
import com.vitorpamplona.amethyst.commons.resources.Res
|
||||
import com.vitorpamplona.amethyst.commons.resources.accessibility_user_avatar
|
||||
import com.vitorpamplona.amethyst.commons.ui.components.UserAvatar
|
||||
import com.vitorpamplona.amethyst.commons.ui.theme.ChatSize34dp
|
||||
import com.vitorpamplona.amethyst.commons.ui.theme.ChatStdPadding
|
||||
import org.jetbrains.compose.resources.stringResource
|
||||
|
||||
/**
|
||||
* Shared chatroom header for a single-user conversation.
|
||||
@@ -67,6 +70,7 @@ fun ChatroomHeader(
|
||||
userHex = user.pubkeyHex,
|
||||
pictureUrl = user.profilePicture(),
|
||||
size = ChatSize34dp,
|
||||
contentDescription = stringResource(Res.string.accessibility_user_avatar),
|
||||
)
|
||||
|
||||
Column(modifier = Modifier.padding(start = 10.dp)) {
|
||||
@@ -114,6 +118,7 @@ fun GroupChatroomHeader(
|
||||
userHex = firstUser.pubkeyHex,
|
||||
pictureUrl = firstUser.profilePicture(),
|
||||
size = ChatSize34dp,
|
||||
contentDescription = stringResource(Res.string.accessibility_user_avatar),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+6
-2
@@ -39,6 +39,10 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.vitorpamplona.amethyst.commons.model.User
|
||||
import com.vitorpamplona.amethyst.commons.resources.Res
|
||||
import com.vitorpamplona.amethyst.commons.resources.accessibility_navigate
|
||||
import com.vitorpamplona.amethyst.commons.resources.accessibility_user_avatar
|
||||
import org.jetbrains.compose.resources.stringResource
|
||||
|
||||
/**
|
||||
* A card displaying user search result with avatar, name, and nip05/pubkey.
|
||||
@@ -69,7 +73,7 @@ fun UserSearchCard(
|
||||
userHex = user.pubkeyHex,
|
||||
pictureUrl = user.profilePicture(),
|
||||
size = 40.dp,
|
||||
contentDescription = "Profile picture",
|
||||
contentDescription = stringResource(Res.string.accessibility_user_avatar),
|
||||
)
|
||||
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
@@ -97,7 +101,7 @@ fun UserSearchCard(
|
||||
|
||||
Icon(
|
||||
Icons.AutoMirrored.Filled.ArrowForward,
|
||||
contentDescription = "Navigate",
|
||||
contentDescription = stringResource(Res.string.accessibility_navigate),
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user