diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/tracing/ui/details/TracingDetailsAdapter.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/tracing/ui/details/TracingDetailsAdapter.kt index 18c07154345ab5b3c6c479eb59c51cdabfde1ef8..9749b21aaf64c28ae9f92b021a4bb895376155f6 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/tracing/ui/details/TracingDetailsAdapter.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/tracing/ui/details/TracingDetailsAdapter.kt @@ -5,6 +5,7 @@ import androidx.annotation.LayoutRes import androidx.viewbinding.ViewBinding import de.rki.coronawarnapp.tracing.ui.details.items.DetailsItem import de.rki.coronawarnapp.tracing.ui.details.items.additionalinfos.AdditionalInfoLowRiskBox +import de.rki.coronawarnapp.tracing.ui.details.items.additionalinfos.FindDetailsInJournalBox import de.rki.coronawarnapp.tracing.ui.details.items.behavior.BehaviorIncreasedRiskBox import de.rki.coronawarnapp.tracing.ui.details.items.behavior.BehaviorNormalRiskBox import de.rki.coronawarnapp.tracing.ui.details.items.periodlogged.PeriodLoggedBox @@ -49,6 +50,7 @@ class TracingDetailsAdapter( TypedVHCreatorMod({ data[it] is BehaviorIncreasedRiskBox.Item }) { BehaviorIncreasedRiskBox(it) }, TypedVHCreatorMod({ data[it] is BehaviorNormalRiskBox.Item }) { BehaviorNormalRiskBox(it) }, TypedVHCreatorMod({ data[it] is AdditionalInfoLowRiskBox.Item }) { AdditionalInfoLowRiskBox(it) }, + TypedVHCreatorMod({ data[it] is FindDetailsInJournalBox.Item }) { FindDetailsInJournalBox(it) }, TypedVHCreatorMod({ data[it] is UserSurveyBox.Item }) { UserSurveyBox( parent = it, diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/tracing/ui/details/TracingDetailsItemProvider.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/tracing/ui/details/TracingDetailsItemProvider.kt index 7537905dc3a80932bd577072e9899170b12124e1..3f524d03b408832e3c647a2f2b2a377d9d579bbf 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/tracing/ui/details/TracingDetailsItemProvider.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/tracing/ui/details/TracingDetailsItemProvider.kt @@ -9,6 +9,7 @@ import de.rki.coronawarnapp.tracing.GeneralTracingStatus import de.rki.coronawarnapp.tracing.GeneralTracingStatus.Status import de.rki.coronawarnapp.tracing.ui.details.items.DetailsItem import de.rki.coronawarnapp.tracing.ui.details.items.additionalinfos.AdditionalInfoLowRiskBox +import de.rki.coronawarnapp.tracing.ui.details.items.additionalinfos.FindDetailsInJournalBox import de.rki.coronawarnapp.tracing.ui.details.items.behavior.BehaviorIncreasedRiskBox import de.rki.coronawarnapp.tracing.ui.details.items.behavior.BehaviorNormalRiskBox import de.rki.coronawarnapp.tracing.ui.details.items.periodlogged.PeriodLoggedBox @@ -44,11 +45,17 @@ class TracingDetailsItemProvider @Inject constructor( val latestCalc = riskLevelResults.lastCalculated + val lowRiskWithEncounters = latestCalc.riskState == RiskState.LOW_RISK && + latestCalc.matchedRiskCount > 0 + mutableListOf<DetailsItem>().apply { if (status != Status.TRACING_INACTIVE && - latestCalc.riskState == RiskState.LOW_RISK && - latestCalc.matchedRiskCount > 0 + (lowRiskWithEncounters || latestCalc.riskState == RiskState.INCREASED_RISK) ) { + add(FindDetailsInJournalBox.Item) + } + + if (status != Status.TRACING_INACTIVE && lowRiskWithEncounters) { add(AdditionalInfoLowRiskBox.Item) } diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/tracing/ui/details/items/additionalinfos/FindDetailsInJournalBox.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/tracing/ui/details/items/additionalinfos/FindDetailsInJournalBox.kt new file mode 100644 index 0000000000000000000000000000000000000000..48cf2f853edc29e64603db9296b367b1872eaedc --- /dev/null +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/tracing/ui/details/items/additionalinfos/FindDetailsInJournalBox.kt @@ -0,0 +1,31 @@ +package de.rki.coronawarnapp.tracing.ui.details.items.additionalinfos + +import android.view.ViewGroup +import androidx.annotation.LayoutRes +import de.rki.coronawarnapp.R +import de.rki.coronawarnapp.databinding.TracingDetailsFindDetailsInJournalBinding +import de.rki.coronawarnapp.tracing.ui.details.TracingDetailsAdapter + +class FindDetailsInJournalBox( + parent: ViewGroup, + @LayoutRes containerLayout: Int = R.layout.tracing_details_find_details_in_journal +) : TracingDetailsAdapter.DetailsItemVH<FindDetailsInJournalBox.Item, TracingDetailsFindDetailsInJournalBinding>( + containerLayout, + parent +) { + + override val viewBinding = lazy { + TracingDetailsFindDetailsInJournalBinding.inflate( + layoutInflater, + itemView.findViewById(R.id.box_container), + true + ) + } + + override val onBindData: TracingDetailsFindDetailsInJournalBinding.( + item: Item, + payloads: List<Any> + ) -> Unit = { _, _ -> } + + object Item : AdditionalInformationItem +} diff --git a/Corona-Warn-App/src/main/res/layout/tracing_details_find_details_in_journal.xml b/Corona-Warn-App/src/main/res/layout/tracing_details_find_details_in_journal.xml new file mode 100644 index 0000000000000000000000000000000000000000..943d16269bbf2c13e5607be54e75c52bb30bdad7 --- /dev/null +++ b/Corona-Warn-App/src/main/res/layout/tracing_details_find_details_in_journal.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/risk_details_find_details_in_journal" + style="@style/body1" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginHorizontal="@dimen/spacing_normal" + android:layout_marginTop="@dimen/spacing_normal" + android:focusable="true" + android:text="@string/risk_details_find_details_in_journal" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> \ No newline at end of file diff --git a/Corona-Warn-App/src/main/res/values-de/strings.xml b/Corona-Warn-App/src/main/res/values-de/strings.xml index 69f808d8263ee03caafc674914a6e00826bf16db..2d56b6304fbce5bf6347c8f9dd8e25a29179a55d 100644 --- a/Corona-Warn-App/src/main/res/values-de/strings.xml +++ b/Corona-Warn-App/src/main/res/values-de/strings.xml @@ -282,6 +282,8 @@ <string name="risk_details_behavior_body_wear_mask">"Tragen Sie einen Mund-Nasen-Schutz bei Begegnungen mit anderen Personen."</string> <!-- XMSG: risk details - stay 1,5 away, something like a bullet point --> <string name="risk_details_behavior_body_stay_away">"Halten Sie mindestens 1,5 Meter Abstand zu anderen Personen."</string> + <!-- XTXT: find details about exposures in the contact journal --> + <string name="risk_details_find_details_in_journal">Weitere Informationen zu Ihren Risiko-Begegnungen finden Sie in Ihrem Kontakt-Tagebuch.</string> <!-- XMSG: risk details - link to faq, something like a bullet point --> <string name="risk_details_increased_risk_faq_link_text">"Falls Sie sich testen lassen, finden Sie weitere Informationen in der FAQ zum Testablauf."</string> diff --git a/Corona-Warn-App/src/main/res/values/strings.xml b/Corona-Warn-App/src/main/res/values/strings.xml index 9e6f2ee6f6167191489685e38599f6daf82b1132..cfb76b2711d1ef4fc665d9cd60fb104b1be715ee 100644 --- a/Corona-Warn-App/src/main/res/values/strings.xml +++ b/Corona-Warn-App/src/main/res/values/strings.xml @@ -282,6 +282,8 @@ <string name="risk_details_behavior_body_wear_mask">"Wear a face mask when you encounter other people."</string> <!-- XMSG: risk details - stay 1,5 away, something like a bullet point --> <string name="risk_details_behavior_body_stay_away">"Keep at least 1.5 meters distance from other people."</string> + <!-- XTXT: find details about exposures in the contact journal --> + <string name="risk_details_find_details_in_journal"></string> <!-- XMSG: risk details - link to faq, something like a bullet point --> <string name="risk_details_increased_risk_faq_link_text">"If you get tested, you will find additional information about the testing procedure in the FAQ."</string>