Skip to content

Commit

Permalink
Return resolved string resource for TYPE_HOME for Label.LocationHome
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstyl committed Jan 10, 2022
1 parent bef013b commit 79b4ee6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion library/src/main/java/com/alexstyl/contactstore/Label.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ public fun Label.getLocalizedString(resources: Resources): String {
is Label.Custom -> this.label
Label.DateAnniversary -> resources.getString(Event.getTypeResource(Event.TYPE_ANNIVERSARY))
Label.DateBirthday -> resources.getString(Event.getTypeResource(Event.TYPE_BIRTHDAY))
Label.LocationHome -> resources.getString(Event.getTypeResource(Event.TYPE_BIRTHDAY))

Label.LocationHome -> resources.getString(StructuredPostal.getTypeLabelResource(StructuredPostal.TYPE_HOME))
Label.LocationWork -> resources.getString(StructuredPostal.getTypeLabelResource(StructuredPostal.TYPE_WORK))

Label.Main -> resources.getString(Phone.getTypeLabelResource(Phone.TYPE_MAIN))
Label.Other -> resources.getString(Phone.getTypeLabelResource(Phone.TYPE_OTHER))
Label.PhoneNumberAssistant -> resources.getString(Phone.getTypeLabelResource(Phone.TYPE_ASSISTANT))
Expand All @@ -82,6 +84,7 @@ public fun Label.getLocalizedString(resources: Resources): String {
Label.PhoneNumberTtyTdd -> resources.getString(Phone.getTypeLabelResource(Phone.TYPE_TTY_TDD))
Label.PhoneNumberWorkMobile -> resources.getString(Phone.getTypeLabelResource(Phone.TYPE_WORK_MOBILE))
Label.PhoneNumberWorkPager -> resources.getString(Phone.getTypeLabelResource(Phone.TYPE_WORK_PAGER))

Label.RelationBrother -> resources.getString(Relation.getTypeLabelResource(Relation.TYPE_BROTHER))
Label.RelationChild -> resources.getString(Relation.getTypeLabelResource(Relation.TYPE_CHILD))
Label.RelationDomesticPartner -> resources.getString(Relation.getTypeLabelResource(Relation.TYPE_DOMESTIC_PARTNER))
Expand All @@ -95,6 +98,7 @@ public fun Label.getLocalizedString(resources: Resources): String {
Label.RelationRelative -> resources.getString(Relation.getTypeLabelResource(Relation.TYPE_RELATIVE))
Label.RelationSister -> resources.getString(Relation.getTypeLabelResource(Relation.TYPE_SISTER))
Label.RelationSpouse -> resources.getString(Relation.getTypeLabelResource(Relation.TYPE_SPOUSE))

Label.WebsiteBlog -> resources.getString(R.string.blog)
Label.WebsiteFtp -> resources.getString(R.string.ftp)
Label.WebsiteHomePage -> resources.getString(R.string.home_page)
Expand Down

0 comments on commit 79b4ee6

Please sign in to comment.