feat #1632: Accessibility updates (#1705)

* Add description for node sort option button

* Add description for location view button

* Update description for channel url copy button

* appease detekt

---------

Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
todd2982 2025-03-23 20:26:28 -05:00 committed by GitHub
parent 3bc4454c0e
commit 7902e21a4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 26 deletions

View file

@ -471,9 +471,9 @@ private fun EditChannelUrl(
else -> Icons.TwoTone.ContentCopy
},
contentDescription = when {
isError -> stringResource(R.string.share)
isError -> stringResource(R.string.copy)
!isUrlEqual -> stringResource(R.string.send)
else -> stringResource(R.string.share)
else -> stringResource(R.string.copy)
},
tint = if (isError) {
MaterialTheme.colors.error

View file

@ -162,7 +162,7 @@ private fun NodeSortButton(
IconButton(onClick = { expanded = true }) {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_twotone_sort_24),
contentDescription = null,
contentDescription = stringResource(R.string.node_sort_button),
modifier = Modifier.heightIn(max = 48.dp),
tint = MaterialTheme.colors.onSurface
)

View file

@ -50,6 +50,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalHapticFeedback
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.fragment.app.activityViewModels
@ -619,30 +620,32 @@ fun MapView(
map.invalidate()
},
modifier = Modifier.align(Alignment.BottomCenter)
) else Column(
modifier = Modifier
.padding(top = 16.dp, end = 16.dp)
.align(Alignment.TopEnd),
verticalArrangement = Arrangement.spacedBy(8.dp),
) {
MapButton(
onClick = ::showMapStyleDialog,
icon = Icons.Outlined.Layers,
contentDescription = R.string.map_style_selection,
)
MapButton(
enabled = hasGps,
icon = if (myLocationOverlay == null) {
Icons.Outlined.MyLocation
} else {
Icons.Default.LocationDisabled
},
contentDescription = null,
) else {
Column(
modifier = Modifier
.padding(top = 16.dp, end = 16.dp)
.align(Alignment.TopEnd),
verticalArrangement = Arrangement.spacedBy(8.dp),
) {
if (context.hasLocationPermission()) {
map.toggleMyLocation()
} else {
requestPermissionAndToggleLauncher.launch(context.getLocationPermissions())
MapButton(
onClick = ::showMapStyleDialog,
icon = Icons.Outlined.Layers,
contentDescription = R.string.map_style_selection,
)
MapButton(
enabled = hasGps,
icon = if (myLocationOverlay == null) {
Icons.Outlined.MyLocation
} else {
Icons.Default.LocationDisabled
},
contentDescription = stringResource(R.string.toggle_my_position),
) {
if (context.hasLocationPermission()) {
map.toggleMyLocation()
} else {
requestPermissionAndToggleLauncher.launch(context.getLocationPermissions())
}
}
}
}