Skip to content
Snippets Groups Projects
Unverified Commit 6e925dc6 authored by axelherbstreith's avatar axelherbstreith Committed by GitHub
Browse files

Contact Journal Location/Person not announced (EXPOSUREAPP-4459) (#2129)

* added type announcement

* added enum class for types

* updated to when statement for type decision
parent efe8be18
No related branches found
No related tags found
No related merge requests found
......@@ -82,7 +82,8 @@ class ContactDiaryOverviewViewModel @AssistedInject constructor(
.map { personEncounter ->
ListItem.Data(
R.drawable.ic_contact_diary_person_item,
personEncounter.contactDiaryPerson.fullName
personEncounter.contactDiaryPerson.fullName,
ListItem.Type.PERSON
)
}
}
......@@ -96,7 +97,8 @@ class ContactDiaryOverviewViewModel @AssistedInject constructor(
.map { locationVisit ->
ListItem.Data(
R.drawable.ic_contact_diary_location_item,
locationVisit.contactDiaryLocation.locationName
locationVisit.contactDiaryLocation.locationName,
ListItem.Type.LOCATION
)
}
}
......
......@@ -39,6 +39,12 @@ class ContactDiaryOverviewNestedAdapter(
{ key, _ ->
contactDiaryOverviewElementImage.setImageResource(key.drawableId)
contactDiaryOverviewElementName.text = key.text
contactDiaryOverviewElementName.contentDescription = when (key.type) {
ListItem.Type.LOCATION -> context.getString(R.string.accessibility_location, key.text)
ListItem.Type.PERSON -> context.getString(R.string.accessibility_person, key.text)
else -> key.text
}
contactDiaryOverviewElementNestedContainer.setOnClickListener { onItemSelectionListener(element) }
}
}
......
......@@ -9,6 +9,11 @@ data class ListItem(
data class Data(
val drawableId: Int,
val text: String
val text: String,
val type: Type
)
enum class Type {
LOCATION, PERSON
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment