From 2412f4271605f89e1b0d8b7425c511f17d8b3320 Mon Sep 17 00:00:00 2001 From: axelherbstreith <75120552+axelherbstreith@users.noreply.github.com> Date: Fri, 7 May 2021 17:27:13 +0200 Subject: [PATCH] Updated Pending Result Screen (EXPOSUREAPP-6897) (#3053) * add new icon * added new icon * adapted pending result screen * fixed merge conflicts * addressed comment * addressed comments * removed row with contact diary export * reverted string changes Co-authored-by: harambasicluka <64483219+harambasicluka@users.noreply.github.com> Co-authored-by: Lukas Lechner <lukas.lechner@sap.com> Co-authored-by: Matthias Urhahn <matthias.urhahn@sap.com> --- .../SubmissionTestResultPendingFragment.kt | 42 ++++++++++---- .../src/main/res/drawable/ic_hourglass.xml | 14 +++++ .../ic_result_pending_contact_diary.xml | 12 ++++ ...ragment_submission_test_result_pending.xml | 56 ++++++++++++++++--- .../src/main/res/values-de/strings.xml | 11 ++++ .../src/main/res/values/strings.xml | 17 ++++++ 6 files changed, 134 insertions(+), 18 deletions(-) create mode 100644 Corona-Warn-App/src/main/res/drawable/ic_hourglass.xml create mode 100644 Corona-Warn-App/src/main/res/drawable/ic_result_pending_contact_diary.xml diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/submission/testresult/pending/SubmissionTestResultPendingFragment.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/submission/testresult/pending/SubmissionTestResultPendingFragment.kt index 31e7e029e..ee69535ab 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/submission/testresult/pending/SubmissionTestResultPendingFragment.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/submission/testresult/pending/SubmissionTestResultPendingFragment.kt @@ -4,9 +4,11 @@ import android.os.Bundle import android.view.View import android.view.accessibility.AccessibilityEvent import androidx.appcompat.app.AlertDialog +import androidx.core.view.isVisible import androidx.fragment.app.Fragment import androidx.navigation.fragment.navArgs import de.rki.coronawarnapp.R +import de.rki.coronawarnapp.coronatest.type.CoronaTest import de.rki.coronawarnapp.bugreporting.ui.toErrorDialogBuilder import de.rki.coronawarnapp.databinding.FragmentSubmissionTestResultPendingBinding import de.rki.coronawarnapp.exception.http.CwaClientError @@ -35,7 +37,7 @@ class SubmissionTestResultPendingFragment : Fragment(R.layout.fragment_submissio private val navArgs by navArgs<SubmissionTestResultPendingFragmentArgs>() @Inject lateinit var viewModelFactory: CWAViewModelFactoryProvider.Factory - private val pendingViewModel: SubmissionTestResultPendingViewModel by cwaViewModelsAssisted( + private val viewModel: SubmissionTestResultPendingViewModel by cwaViewModelsAssisted( factoryProducer = { viewModelFactory }, constructorCall = { factory, _ -> factory as SubmissionTestResultPendingViewModel.Factory @@ -46,11 +48,11 @@ class SubmissionTestResultPendingFragment : Fragment(R.layout.fragment_submissio override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - pendingViewModel.consentGiven.observe2(this) { + viewModel.consentGiven.observe2(this) { binding.consentStatus.consent = it } - pendingViewModel.testState.observe2(this) { result -> + viewModel.testState.observe2(this) { result -> val hasResult = !result.coronaTest.isProcessing binding.apply { submissionTestResultSection.setTestResultSection(result.coronaTest) @@ -60,11 +62,29 @@ class SubmissionTestResultPendingFragment : Fragment(R.layout.fragment_submissio } } + binding.apply { + + when (navArgs.testType) { + CoronaTest.Type.PCR -> { + testResultPendingStepsWaitingPcrResult.isVisible = true + testResultPendingStepsPcrAdded.isVisible = true + testResultPendingStepsWaitingAntigenResult.isVisible = false + testResultPendingStepsRatAdded.isVisible = false + } + CoronaTest.Type.RAPID_ANTIGEN -> { + testResultPendingStepsWaitingAntigenResult.isVisible = true + testResultPendingStepsRatAdded.isVisible = true + testResultPendingStepsWaitingPcrResult.isVisible = false + testResultPendingStepsPcrAdded.isVisible = false + } + } + } + skipInitialTestResultRefresh = arguments?.getBoolean("skipInitialTestResultRefresh") ?: false binding.apply { submissionTestResultButtonPendingRefresh.setOnClickListener { - pendingViewModel.updateTestResult() + viewModel.updateTestResult() binding.submissionTestResultSection.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED) } @@ -74,10 +94,10 @@ class SubmissionTestResultPendingFragment : Fragment(R.layout.fragment_submissio navigateToMainScreen() } - consentStatus.setOnClickListener { pendingViewModel.onConsentClicked() } + consentStatus.setOnClickListener { viewModel.onConsentClicked() } } - pendingViewModel.showRedeemedTokenWarning.observe2(this) { + viewModel.showRedeemedTokenWarning.observe2(this) { val dialog = DialogHelper.DialogInstance( requireActivity(), R.string.submission_error_dialog_web_tan_redeemed_title, @@ -88,10 +108,10 @@ class SubmissionTestResultPendingFragment : Fragment(R.layout.fragment_submissio DialogHelper.showDialog(dialog) } - pendingViewModel.routeToScreen.observe2(this) { + viewModel.routeToScreen.observe2(this) { it?.let { doNavigate(it) } ?: navigateToMainScreen() } - pendingViewModel.errorEvent.observe2(this) { + viewModel.errorEvent.observe2(this) { it.toErrorDialogBuilder(requireContext()).show() } } @@ -100,13 +120,13 @@ class SubmissionTestResultPendingFragment : Fragment(R.layout.fragment_submissio super.onResume() binding.submissionTestResultContainer.sendAccessibilityEvent(AccessibilityEvent.TYPE_ANNOUNCEMENT) skipInitialTestResultRefresh = false - pendingViewModel.cwaWebExceptionLiveData.observeOnce(this.viewLifecycleOwner) { exception -> + viewModel.cwaWebExceptionLiveData.observeOnce(this.viewLifecycleOwner) { exception -> handleError(exception) } } override fun onPause() { - pendingViewModel.cwaWebExceptionLiveData.removeObservers(this.viewLifecycleOwner) + viewModel.cwaWebExceptionLiveData.removeObservers(this.viewLifecycleOwner) errorDialog?.dismiss() super.onPause() } @@ -119,7 +139,7 @@ class SubmissionTestResultPendingFragment : Fragment(R.layout.fragment_submissio R.string.submission_test_result_dialog_remove_test_button_positive, R.string.submission_test_result_dialog_remove_test_button_negative, positiveButtonFunction = { - pendingViewModel.deregisterTestFromDevice() + viewModel.deregisterTestFromDevice() } ) DialogHelper.showDialog(removeTestDialog).apply { diff --git a/Corona-Warn-App/src/main/res/drawable/ic_hourglass.xml b/Corona-Warn-App/src/main/res/drawable/ic_hourglass.xml new file mode 100644 index 000000000..8c56d559b --- /dev/null +++ b/Corona-Warn-App/src/main/res/drawable/ic_hourglass.xml @@ -0,0 +1,14 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="40dp" + android:height="40dp" + android:viewportWidth="40" + android:viewportHeight="40"> + <path + android:pathData="M20,20m-20,0a20,20 0,1 1,40 0a20,20 0,1 1,-40 0" + android:fillColor="#F5F5F5"/> + <path + android:pathData="M14,10V16H14.01L14,16.01L18,20L14,24L14.01,24.01H14V30H26V24.01H25.99L26,24L22,20L26,16.01L25.99,16H26V10H14ZM24,24.5V28H16V24.5L20,20.5L24,24.5ZM16,12V15.5L20,19.5L24,15.5V12H16Z" + android:fillColor="#17191A" + android:fillAlpha="0.3" + android:fillType="evenOdd"/> +</vector> diff --git a/Corona-Warn-App/src/main/res/drawable/ic_result_pending_contact_diary.xml b/Corona-Warn-App/src/main/res/drawable/ic_result_pending_contact_diary.xml new file mode 100644 index 000000000..be9412364 --- /dev/null +++ b/Corona-Warn-App/src/main/res/drawable/ic_result_pending_contact_diary.xml @@ -0,0 +1,12 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="40dp" + android:height="40dp" + android:viewportWidth="40" + android:viewportHeight="40"> + <path + android:pathData="M20,20m-20,0a20,20 0,1 1,40 0a20,20 0,1 1,-40 0" + android:fillColor="#F5F5F5"/> + <path + android:pathData="M28.0753,28.2529V11.4371C28.0753,9.9748 27,9 25.5,9H13.3493C12.088,9 10.9919,10.2089 11,11.4371C11,16.8684 11,22.5784 11,28.009C11,29.4713 12.0002,30.4461 13.5582,30.4461H27.5C27.5,30.4461 28,30.4461 28,29.9587C28,29.4713 28,28.9839 28,28.9839C28,28.9839 28,28.5019 27.5,28.4965C27,28.491 14.5002,28.4965 14.5002,28.4965C14.5002,28.4965 13,28.4965 13,27.0342C13,26.3653 13,26.0594 13,26.0594C13,24.5972 14.5002,24.5972 14.5002,24.5972C13.1767,24.5972 24.2552,24.5972 27,24.5972C27,24.5972 26.5,25.572 26.5,26.5468C26.5,27.1052 27,28.2529 27,28.2529C27.5,28.2529 28.0753,28.2529 28.0753,28.2529Z" + android:fillColor="#B2B3B3"/> +</vector> diff --git a/Corona-Warn-App/src/main/res/layout/fragment_submission_test_result_pending.xml b/Corona-Warn-App/src/main/res/layout/fragment_submission_test_result_pending.xml index 3a26e5772..510bb0650 100644 --- a/Corona-Warn-App/src/main/res/layout/fragment_submission_test_result_pending.xml +++ b/Corona-Warn-App/src/main/res/layout/fragment_submission_test_result_pending.xml @@ -79,7 +79,7 @@ app:layout_constraintTop_toBottomOf="@+id/submission_test_result_section" /> <de.rki.coronawarnapp.ui.view.SimpleStepEntry - android:id="@+id/test_result_pending_steps_added" + android:id="@+id/test_result_pending_steps_pcr_added" android:layout_width="0dp" android:layout_marginTop="@dimen/spacing_normal" android:layout_height="wrap_content" @@ -91,16 +91,58 @@ app:step_entry_icon="@drawable/ic_test_result_step_done" /> <de.rki.coronawarnapp.ui.view.SimpleStepEntry - android:id="@+id/test_result_pending_steps_waiting_result" + android:id="@+id/test_result_pending_steps_rat_added" + android:layout_width="0dp" + android:layout_marginTop="@dimen/spacing_normal" + android:layout_height="wrap_content" + app:layout_constraintEnd_toEndOf="@id/submission_test_result_subtitle" + app:layout_constraintStart_toStartOf="@id/submission_test_result_subtitle" + app:layout_constraintTop_toBottomOf="@+id/test_result_pending_steps_pcr_added" + app:simple_step_entry_title="@string/submission_test_result_steps_added_rat_heading" + app:step_entry_final="false" + android:visibility="gone" + tools:visibility="visible" + app:step_entry_icon="@drawable/ic_test_result_step_done" /> + + <de.rki.coronawarnapp.ui.view.SimpleStepEntry + android:id="@+id/test_result_pending_steps_waiting_pcr_result" + android:layout_width="0dp" + android:layout_height="wrap_content" + app:step_entry_final="true" + app:layout_constraintEnd_toEndOf="@id/submission_test_result_subtitle" + app:layout_constraintStart_toStartOf="@id/submission_test_result_subtitle" + app:layout_constraintTop_toBottomOf="@+id/test_result_pending_steps_rat_added" + app:simple_step_entry_text="@string/submission_test_result_pending_steps_waiting_pcr_body" + app:simple_step_entry_title="@string/submission_test_result_pending_steps_waiting_pcr_heading" + app:step_entry_icon="@drawable/ic_hourglass" /> + + <de.rki.coronawarnapp.ui.view.SimpleStepEntry + android:id="@+id/test_result_pending_steps_waiting_antigen_result" + android:layout_width="0dp" + android:layout_height="wrap_content" + app:layout_constraintEnd_toEndOf="@id/submission_test_result_subtitle" + app:layout_constraintStart_toStartOf="@id/submission_test_result_subtitle" + app:layout_constraintTop_toBottomOf="@+id/test_result_pending_steps_waiting_pcr_result" + android:visibility="gone" + app:step_entry_final="true" + app:simple_step_entry_text="@string/submission_test_result_pending_steps_waiting_rat_body" + app:simple_step_entry_title="@string/submission_test_result_pending_steps_waiting_rat_heading" + app:step_entry_icon="@drawable/ic_hourglass" + tools:visibility="visible"/> + + <de.rki.coronawarnapp.ui.view.SimpleStepEntry + android:id="@+id/test_result_pending_steps_contact_diary_result" android:layout_width="0dp" android:layout_height="wrap_content" app:layout_constraintEnd_toEndOf="@id/submission_test_result_subtitle" app:layout_constraintStart_toStartOf="@id/submission_test_result_subtitle" - app:layout_constraintTop_toBottomOf="@+id/test_result_pending_steps_added" - app:simple_step_entry_text="@string/submission_test_result_pending_steps_waiting_body" - app:simple_step_entry_title="@string/submission_test_result_pending_steps_waiting_heading" + app:layout_constraintTop_toBottomOf="@+id/test_result_pending_steps_waiting_antigen_result" + app:simple_step_entry_text="@string/submission_test_result_pending_steps_contact_diary_body" + app:simple_step_entry_title="@string/submission_test_result_pending_steps_contact_diary_heading" app:step_entry_final="true" - app:step_entry_icon="@drawable/ic_test_result_step_waiting" /> + android:visibility="gone" + app:step_entry_icon="@drawable/ic_result_pending_contact_diary" + tools:visibility="visible"/> <de.rki.coronawarnapp.ui.submission.consentstatus.ConsentStatusView android:id="@+id/consent_status" @@ -109,7 +151,7 @@ android:focusable="true" app:layout_constraintEnd_toEndOf="@id/submission_test_result_subtitle" app:layout_constraintStart_toStartOf="@id/submission_test_result_subtitle" - app:layout_constraintTop_toBottomOf="@+id/test_result_pending_steps_waiting_result" /> + app:layout_constraintTop_toBottomOf="@id/test_result_pending_steps_contact_diary_result" /> </androidx.constraintlayout.widget.ConstraintLayout> </ScrollView> 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 8cc314fee..74477dbe9 100644 --- a/Corona-Warn-App/src/main/res/values-de/strings.xml +++ b/Corona-Warn-App/src/main/res/values-de/strings.xml @@ -1071,6 +1071,17 @@ <string name="submission_test_result_pending_steps_waiting_heading">"Ihr Testergebnis liegt noch nicht vor."</string> <!-- YTXT: Body text for next steps section of waiting test result page --> <string name="submission_test_result_pending_steps_waiting_body">"Sobald Ihr Testergebnis vorliegt, wird es Ihnen in der App angezeigt.\n\nSie bekommen Ihr Testergebnis auch außerhalb der App mitgeteilt. Falls Ihr Test positiv ist, bekommen Sie vom Gesundheitsamt eine Mitteilung.\n\nWenn Ihnen außerhalb der App ein positives Testergebnis mitgeteilt wurde, entfernen Sie den aktuell in der App registrierten Test. Rufen Sie die unter "TAN anfragen" angegebene Nummer an, um eine TAN zu erhalten. Registrieren Sie dann Ihr Testergebnis mithilfe der TAN in der App."</string> + <!-- XHED: Page headline for results next steps --> + <string name="submission_test_result_steps_added_rat_heading">"Ihr Schnelltest wurde hinzugefügt."</string> + <!-- XHED: Page headline for pending test result next steps --> + <string name="submission_test_result_pending_steps_waiting_rat_heading">"Ihr Testergebnis liegt noch nicht vor."</string> + <!-- YTXT: Body text for next steps section of waiting test result page --> + <string name="submission_test_result_pending_steps_waiting_rat_body">"Sobald Ihr Testergebnis vorliegt, wird es Ihnen in der App angezeigt."</string> + <!-- XHED: Page headline for pending test result next steps --> + <string name="submission_test_result_pending_steps_contact_diary_heading">"Ihr Testergebnis wird dem Kontakt-Tagebuch hinzugefügt."</string> + <!-- YTXT: Body text for next steps section of waiting test result page --> + <string name="submission_test_result_pending_steps_contact_diary_body">"Sobald Ihr Testergebnis vorliegt, wird es Ihnen in der App angezeigt."</string> + <!-- XBUT: test result pending : refresh button --> <string name="submission_test_result_pending_refresh_button">"Aktualisieren"</string> <!-- XBUT: test result pending : remove the test button --> diff --git a/Corona-Warn-App/src/main/res/values/strings.xml b/Corona-Warn-App/src/main/res/values/strings.xml index ba2f0d31f..2e236810c 100644 --- a/Corona-Warn-App/src/main/res/values/strings.xml +++ b/Corona-Warn-App/src/main/res/values/strings.xml @@ -1067,10 +1067,27 @@ <string name="submission_test_result_steps_added_heading">"Test added successfully"</string> <!-- YTXT: Body text for for results next steps --> <string name="submission_test_result_steps_added_body">"Your test has been stored in the Corona-Warn-App."</string> + <!-- XHED: Page headline for pending test result next steps --> <string name="submission_test_result_pending_steps_waiting_heading">"Your test result is not available yet."</string> <!-- YTXT: Body text for next steps section of waiting test result page --> <string name="submission_test_result_pending_steps_waiting_body">"As soon as your test result becomes available, it will be displayed in the app.\n\nYou will also receive your test result outside of the app. The public health authorities will notify you, should your test be positive.\n\nIf you are notified of a positive test result outside the app, please remove the test currently registered in the app. Call the number shown under “Request TAN†to get a TAN. You can then use this TAN to register your result in the app and warn others."</string> + <!-- XHED: Page headline for pending test result next steps --> + <string name="submission_test_result_pending_steps_waiting_pcr_heading">"Your test result is not available yet."</string> + <!-- YTXT: Body text for next steps section of waiting test result page --> + <string name="submission_test_result_pending_steps_waiting_pcr_body">"As soon as your test result becomes available, it will be displayed in the app.\n\nYou will also receive your test result outside of the app. The public health authorities will notify you, should your test be positive.\n\nIf you are notified of a positive test result outside the app, please remove the test currently registered in the app. Call the number shown under “Request TAN†to get a TAN. You can then use this TAN to register your result in the app and warn others."</string> + + <!-- XHED: Page headline for results next steps --> + <string name="submission_test_result_steps_added_rat_heading">"Ihr Schnelltest wurde hinzugefügt."</string> + <!-- XHED: Page headline for pending test result next steps --> + <string name="submission_test_result_pending_steps_waiting_rat_heading">"Ihr Testergebnis liegt noch nicht vor."</string> + <!-- YTXT: Body text for next steps section of waiting test result page --> + <string name="submission_test_result_pending_steps_waiting_rat_body">"Sobald Ihr Testergebnis vorliegt, wird es Ihnen in der App angezeigt."</string> + <!-- XHED: Page headline for pending test result next steps --> + <string name="submission_test_result_pending_steps_contact_diary_heading">"Ihr Testergebnis wird dem Kontakt-Tagebuch hinzugefügt."</string> + <!-- YTXT: Body text for next steps section of waiting test result page --> + <string name="submission_test_result_pending_steps_contact_diary_body">"Sobald Ihr Testergebnis vorliegt, wird es Ihnen in der App angezeigt."</string> + <!-- XBUT: test result pending : refresh button --> <string name="submission_test_result_pending_refresh_button">"Update"</string> <!-- XBUT: test result pending : remove the test button --> -- GitLab