Legg til tilgjengelegheitsetiketter og skjermlesar-fiksar (Android)
- Legg til contentDescription på tilfluktsrom-listeelement for TalkBack - Erstatt emoji-kompassåtvaring med tilgjengeleg tekstresurs - Vis «Ventar på GPS…» i staden for «—» ved ukjend avstand - Legg til content_desc_shelter_item og compass_accuracy_warning-strengar (en/nb/nn) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5fd76678d4
commit
a3728798b8
5 changed files with 19 additions and 4 deletions
|
|
@ -489,7 +489,11 @@ class MainActivity : AppCompatActivity(), SensorEventListener {
|
||||||
/** Update all UI elements for the currently selected shelter. */
|
/** Update all UI elements for the currently selected shelter. */
|
||||||
private fun updateSelectedShelterUI() {
|
private fun updateSelectedShelterUI() {
|
||||||
val selected = selectedShelter ?: return
|
val selected = selectedShelter ?: return
|
||||||
val distanceText = DistanceUtils.formatDistance(selected.distanceMeters)
|
val distanceText = if (selected.distanceMeters.isNaN()) {
|
||||||
|
getString(R.string.status_no_location)
|
||||||
|
} else {
|
||||||
|
DistanceUtils.formatDistance(selected.distanceMeters)
|
||||||
|
}
|
||||||
|
|
||||||
// Update bottom sheet
|
// Update bottom sheet
|
||||||
binding.selectedShelterAddress.text = selected.shelter.adresse
|
binding.selectedShelterAddress.text = selected.shelter.adresse
|
||||||
|
|
@ -829,9 +833,7 @@ class MainActivity : AppCompatActivity(), SensorEventListener {
|
||||||
Log.w(TAG, "Compass accuracy degraded: $accuracy")
|
Log.w(TAG, "Compass accuracy degraded: $accuracy")
|
||||||
binding.compassAddressText.let { tv ->
|
binding.compassAddressText.let { tv ->
|
||||||
val current = selectedShelter?.shelter?.adresse ?: ""
|
val current = selectedShelter?.shelter?.adresse ?: ""
|
||||||
if (!current.contains("⚠")) {
|
tv.text = getString(R.string.compass_accuracy_warning, current)
|
||||||
tv.text = "⚠ $current"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM,
|
SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM,
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,13 @@ class ShelterListAdapter(
|
||||||
R.string.shelter_room_nr, item.shelter.romnr
|
R.string.shelter_room_nr, item.shelter.romnr
|
||||||
)
|
)
|
||||||
|
|
||||||
|
binding.root.contentDescription = ctx.getString(
|
||||||
|
R.string.content_desc_shelter_item,
|
||||||
|
item.shelter.adresse,
|
||||||
|
DistanceUtils.formatDistance(item.distanceMeters),
|
||||||
|
item.shelter.plasser
|
||||||
|
)
|
||||||
|
|
||||||
binding.root.isSelected = isSelected
|
binding.root.isSelected = isSelected
|
||||||
binding.root.alpha = if (isSelected) 1.0f else 0.7f
|
binding.root.alpha = if (isSelected) 1.0f else 0.7f
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,8 @@
|
||||||
|
|
||||||
<!-- Tilgjengelighet -->
|
<!-- Tilgjengelighet -->
|
||||||
<string name="direction_arrow_description">Retning til tilfluktsrom, %s unna</string>
|
<string name="direction_arrow_description">Retning til tilfluktsrom, %s unna</string>
|
||||||
|
<string name="content_desc_shelter_item">%1$s, %2$s, %3$d plasser</string>
|
||||||
|
<string name="compass_accuracy_warning">Upresist kompass - %s</string>
|
||||||
|
|
||||||
<!-- Sivilforsvar -->
|
<!-- Sivilforsvar -->
|
||||||
<string name="action_civil_defense_info">Sivilforsvarsinformasjon</string>
|
<string name="action_civil_defense_info">Sivilforsvarsinformasjon</string>
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,8 @@
|
||||||
|
|
||||||
<!-- Tilgjenge -->
|
<!-- Tilgjenge -->
|
||||||
<string name="direction_arrow_description">Retning til tilfluktsrom, %s unna</string>
|
<string name="direction_arrow_description">Retning til tilfluktsrom, %s unna</string>
|
||||||
|
<string name="content_desc_shelter_item">%1$s, %2$s, %3$d plassar</string>
|
||||||
|
<string name="compass_accuracy_warning">Upresis kompass - %s</string>
|
||||||
|
|
||||||
<!-- Sivilforsvar -->
|
<!-- Sivilforsvar -->
|
||||||
<string name="action_civil_defense_info">Sivilforsvarsinformasjon</string>
|
<string name="action_civil_defense_info">Sivilforsvarsinformasjon</string>
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,8 @@
|
||||||
|
|
||||||
<!-- Accessibility -->
|
<!-- Accessibility -->
|
||||||
<string name="direction_arrow_description">Direction to shelter, %s away</string>
|
<string name="direction_arrow_description">Direction to shelter, %s away</string>
|
||||||
|
<string name="content_desc_shelter_item">%1$s, %2$s, %3$d places</string>
|
||||||
|
<string name="compass_accuracy_warning">Low accuracy - %s</string>
|
||||||
|
|
||||||
<!-- Civil defense info -->
|
<!-- Civil defense info -->
|
||||||
<string name="action_civil_defense_info">Civil defense information</string>
|
<string name="action_civil_defense_info">Civil defense information</string>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue