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

Update Vaccination Certificate Detail Attributes (EXPOSUREAPP-7843) (#3477)


* updated attributes

* updated strings

* fixed string issue

* lint

* added targetDisease attribut

* removed placeholder

Co-authored-by: default avatarharambasicluka <64483219+harambasicluka@users.noreply.github.com>
Co-authored-by: default avatarMohamed Metwalli <mohamed.metwalli@sap.com>
parent e203d7e4
No related branches found
No related tags found
No related merge requests found
Showing
with 80 additions and 9 deletions
......@@ -17,8 +17,8 @@ import de.rki.coronawarnapp.databinding.FragmentTestCertificateDetailsBinding
import de.rki.coronawarnapp.ui.qrcode.fullscreen.QrCodeFullScreenFragmentArgs
import de.rki.coronawarnapp.ui.view.onOffsetChange
import de.rki.coronawarnapp.util.DialogHelper
import de.rki.coronawarnapp.util.TimeAndDateExtensions.toDateOfBirthFormat
import de.rki.coronawarnapp.util.TimeAndDateExtensions.toDayFormat
import de.rki.coronawarnapp.util.TimeAndDateExtensions.toHyphenSeparatedDate
import de.rki.coronawarnapp.util.TimeAndDateExtensions.toShortTimeFormat
import de.rki.coronawarnapp.util.TimeAndDateExtensions.toUserTimeZone
import de.rki.coronawarnapp.util.di.AutoInject
......@@ -64,7 +64,7 @@ class TestCertificateDetailsFragment : Fragment(R.layout.fragment_test_certifica
val testDateTime = testCertificate.sampleCollectedAt.toUserTimeZone()
name.text = testCertificate.run { "$lastName, $firstName" }
birthDate.text = testCertificate.dateOfBirth.toDateOfBirthFormat()
birthDate.text = testCertificate.dateOfBirth.toHyphenSeparatedDate()
diseaseType.text = testCertificate.targetName
testType.text = testCertificate.testType
testName.text = testCertificate.testName
......
......@@ -6,7 +6,7 @@ import org.joda.time.LocalDate
interface VaccinationCertificate : CwaCovidCertificate {
val vaccinatedAt: LocalDate
val targetDisease: String
val vaccineTypeName: String
val vaccineManufacturer: String
val medicalProductName: String
......
......@@ -79,6 +79,9 @@ data class VaccinationContainer internal constructor(
override val vaccinatedAt: LocalDate
get() = vaccination.vaccinatedAt
override val targetDisease: String
get() = valueSet?.getDisplayText(vaccination.targetId) ?: vaccination.targetId
override val doseNumber: Int
get() = vaccination.doseNumber
override val totalSeriesOfDoses: Int
......
......@@ -16,7 +16,7 @@ import de.rki.coronawarnapp.databinding.FragmentVaccinationDetailsBinding
import de.rki.coronawarnapp.ui.qrcode.fullscreen.QrCodeFullScreenFragmentArgs
import de.rki.coronawarnapp.ui.view.onOffsetChange
import de.rki.coronawarnapp.util.DialogHelper
import de.rki.coronawarnapp.util.TimeAndDateExtensions.toDateOfBirthFormat
import de.rki.coronawarnapp.util.TimeAndDateExtensions.toHyphenSeparatedDate
import de.rki.coronawarnapp.util.di.AutoInject
import de.rki.coronawarnapp.util.ui.popBackStack
import de.rki.coronawarnapp.util.ui.viewBinding
......@@ -111,11 +111,19 @@ class VaccinationDetailsFragment : Fragment(R.layout.fragment_vaccination_detail
certificate: VaccinationCertificate
) {
name.text = certificate.fullName
dateOfBirth.text = certificate.dateOfBirth.toDateOfBirthFormat()
dateOfBirth.text = certificate.dateOfBirth.toHyphenSeparatedDate()
vaccineName.text = certificate.medicalProductName
vaccineType.text = certificate.vaccineTypeName
diseaseType.text = certificate.targetDisease
vaccineManufacturer.text = certificate.vaccineManufacturer
certificateIssuer.text = certificate.certificateIssuer
vaccinationNumber.text = getString(
R.string.vaccination_certificate_attribute_dose_number,
certificate.doseNumber,
certificate.totalSeriesOfDoses
)
vaccinationDate.text = certificate.vaccinatedAt.toHyphenSeparatedDate()
certificateCountry.text = certificate.certificateCountry
certificateIssuer.text = certificate.certificateIssuer
certificateId.text = certificate.certificateId
}
......
......@@ -26,7 +26,7 @@ object TimeAndDateExtensions {
private val dayFormatter = DateTimeFormat.forPattern("dd.MM.yyyy")
private val dayFormatter2DigitYear = DateTimeFormat.forPattern("dd.MM.yy")
private val shortTime = DateTimeFormat.shortTime()
private val dayOfBirthFormatter = DateTimeFormat.forPattern("yyyy-MM-dd")
private val dateFormatterWithHyphenSeparator = DateTimeFormat.forPattern("yyyy-MM-dd")
fun getCurrentHourUTC(): Int = DateTime(Instant.now(), DateTimeZone.UTC).hourOfDay().get()
......@@ -154,7 +154,7 @@ object TimeAndDateExtensions {
/**
* Returns a readable date String with the format "yyy.MM.dd" like 1983-05-23 of an LocalDate
*/
fun LocalDate.toDateOfBirthFormat(): String = toString(dayOfBirthFormatter)
fun LocalDate.toHyphenSeparatedDate(): String = toString(dateFormatterWithHyphenSeparator)
}
typealias HourInterval = Long
......@@ -173,7 +173,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
tools:text="" />
tools:text="COVID-19" />
<TextView
style="@style/body1Medium"
......
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<!-- ####################################
Special string files for the strings
that should always keep the german / english
version independent from the selected system language
###################################### -->
<!-- #####################################################
COMMON STRINGS FOR ALL TYPES OF CERTIFICATES BELOW
##################################################### -->
<!-- XTXT: Person overview no certificates title-->
<string name="person_overview_no_certificates_title">Noch keine Zertifikate vorhanden</string>
<!-- XTXT: Person overview no certificates subtitle-->
......@@ -31,4 +42,27 @@
<string name="vaccination_consent_onboarding_legal_information">"Ausführliche Informationen zur Datenverarbeitung finden Sie in der Datenschutzerklärung."</string>
<!-- XBUT: Text for vaccination consent accept button -->
<string name="vaccination_consent_accept_button">"Weiter"</string>
<!-- #####################################################
VACCINATION CERTIFICATE STRINGS BELOW
##################################################### -->
<!-- #####################################################
RECOVERY CERTIFICATE STRINGS BELOW
##################################################### -->
<!-- XTXT: Recovery certificate detail title -->
<string name="recovery_certificate_details_title">"Genesenenzertifikat"</string>
<!-- XTXT: Recovery certificate detail subtitle -->
<string name="recovery_certificate_details_subtitle">"EU Digitales COVID-Zertifikat"</string>
<!-- #####################################################
TEST CERTIFICATE STRINGS BELOW
##################################################### -->
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<!-- ####################################
Special string files for the strings
that should always keep the german / english
version independent from the selected system language
###################################### -->
<!-- #####################################################
COMMON STRINGS FOR ALL TYPES OF CERTIFICATES BELOW
##################################################### -->
<!-- XTXT: Person overview no certificates title-->
<string name="person_overview_no_certificates_title">Noch keine Zertifikate vorhanden</string>
<!-- XTXT: Person overview no certificates subtitle-->
......@@ -32,9 +43,24 @@
<!-- XBUT: Text for vaccination consent accept button -->
<string name="vaccination_consent_accept_button">"Weiter"</string>
<!-- #####################################################
VACCINATION CERTIFICATE STRINGS BELOW
##################################################### -->
<!-- #####################################################
RECOVERY CERTIFICATE STRINGS BELOW
##################################################### -->
<!-- XTXT: Recovery certificate detail title -->
<string name="recovery_certificate_details_title">"Genesenenzertifikat"</string>
<!-- XTXT: Recovery certificate detail subtitle -->
<string name="recovery_certificate_details_subtitle">"EU Digitales COVID-Zertifikat"</string>
<!-- #####################################################
TEST CERTIFICATE STRINGS BELOW
##################################################### -->
</resources>
\ No newline at end of file
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