Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/2.0.x' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rken committed Apr 26, 2021
2 parents de207de + f65f66f commit e1ec946
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.rki.coronawarnapp.ui.eventregistration.attendee.checkins

import androidx.annotation.StringRes
import de.rki.coronawarnapp.eventregistration.checkins.CheckIn
import de.rki.coronawarnapp.eventregistration.checkins.qrcode.VerifiedTraceLocation
import de.rki.coronawarnapp.util.ui.LazyString

sealed class CheckInEvent {

Expand All @@ -12,7 +12,7 @@ sealed class CheckInEvent {

data class ConfirmCheckIn(val verifiedTraceLocation: VerifiedTraceLocation) : CheckInEvent()

data class InvalidQrCode(@StringRes val errorTextRes: Int) : CheckInEvent()
data class InvalidQrCode(val errorText: LazyString) : CheckInEvent()

data class ConfirmCheckInWithoutHistory(val verifiedTraceLocation: VerifiedTraceLocation) : CheckInEvent()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import android.os.Bundle
import android.provider.Settings
import android.view.View
import android.widget.Toast
import androidx.annotation.StringRes
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.Toolbar
import androidx.core.net.toUri
Expand All @@ -34,6 +33,7 @@ import de.rki.coronawarnapp.util.lists.decorations.TopBottomPaddingDecorator
import de.rki.coronawarnapp.util.lists.diffutil.update
import de.rki.coronawarnapp.util.onScroll
import de.rki.coronawarnapp.util.tryHumanReadableError
import de.rki.coronawarnapp.util.ui.LazyString
import de.rki.coronawarnapp.util.ui.doNavigate
import de.rki.coronawarnapp.util.ui.observe2
import de.rki.coronawarnapp.util.ui.viewBindingLazy
Expand Down Expand Up @@ -99,7 +99,7 @@ class CheckInsFragment : Fragment(R.layout.trace_location_attendee_checkins_frag
)
}

is CheckInEvent.InvalidQrCode -> showInvalidQrCodeInformation(event.errorTextRes)
is CheckInEvent.InvalidQrCode -> showInvalidQrCodeInformation(event.errorText)

is CheckInEvent.ConfirmCheckInWithoutHistory -> doNavigate(
CheckInsFragmentDirections.actionCheckInsFragmentToConfirmCheckInFragmentCleanHistory(
Expand Down Expand Up @@ -135,12 +135,14 @@ class CheckInsFragment : Fragment(R.layout.trace_location_attendee_checkins_frag
}
}

private fun showInvalidQrCodeInformation(@StringRes errorTextRes: Int) =
private fun showInvalidQrCodeInformation(lazyErrorText: LazyString) {
MaterialAlertDialogBuilder(requireContext()).apply {
setTitle(R.string.errors_generic_headline)
setMessage(errorTextRes)
setPositiveButton(R.string.errors_generic_button_positive) { _, _ -> }
val errorText = lazyErrorText.get(context)
setTitle(R.string.trace_location_attendee_invalid_qr_code_dialog_title)
setMessage(getString(R.string.trace_location_attendee_invalid_qr_code_dialog_message, errorText))
setPositiveButton(R.string.trace_location_attendee_invalid_qr_code_dialog_positive_button) { _, _ -> }
}.show()
}

private fun updateViews(items: List<CheckInsItem>) {
checkInsAdapter.update(items)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import de.rki.coronawarnapp.eventregistration.checkins.CheckIn
import de.rki.coronawarnapp.eventregistration.checkins.CheckInRepository
import de.rki.coronawarnapp.eventregistration.checkins.qrcode.QRCodeUriParser
import de.rki.coronawarnapp.eventregistration.checkins.qrcode.TraceLocationVerifier
import de.rki.coronawarnapp.exception.ExceptionCategory
import de.rki.coronawarnapp.exception.reporting.report
import de.rki.coronawarnapp.presencetracing.checkins.checkout.CheckOutHandler
import de.rki.coronawarnapp.ui.eventregistration.attendee.checkins.items.ActiveCheckInVH
import de.rki.coronawarnapp.ui.eventregistration.attendee.checkins.items.CameraPermissionVH
Expand All @@ -22,6 +20,8 @@ import de.rki.coronawarnapp.util.coroutine.AppScope
import de.rki.coronawarnapp.util.coroutine.DispatcherProvider
import de.rki.coronawarnapp.util.flow.intervalFlow
import de.rki.coronawarnapp.util.ui.SingleLiveEvent
import de.rki.coronawarnapp.util.ui.toLazyString
import de.rki.coronawarnapp.util.ui.toResolvingString
import de.rki.coronawarnapp.util.viewmodel.CWAViewModel
import de.rki.coronawarnapp.util.viewmodel.CWAViewModelFactory
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -153,11 +153,12 @@ class CheckInsViewModel @AssistedInject constructor(
CheckInEvent.ConfirmCheckIn(verifyResult.verifiedTraceLocation)
)
is TraceLocationVerifier.VerificationResult.Invalid ->
events.postValue(CheckInEvent.InvalidQrCode(verifyResult.errorTextRes))
events.postValue(CheckInEvent.InvalidQrCode(verifyResult.errorTextRes.toResolvingString()))
}
} catch (e: Exception) {
Timber.d(e, "TraceLocation verification failed")
e.report(ExceptionCategory.INTERNAL)
val msg = e.message ?: "QR-Code was invalid"
events.postValue(CheckInEvent.InvalidQrCode(msg.toLazyString()))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<!-- XTXT: Text bodies for the release info screen bullet points -->
<string-array name="new_release_body">
<item>"CWA Ви позволява да се регистрирате, когато пристигате на определени места и събития. Организаторите на събития и собствениците на магазини могат да използват приложението за създаване на QR код, който посетителите да сканират, когато пристигат, за да регистрират присъствието си. При поискване приложението може също да създава запис в дневника. Ако на някой от посетителите на съответното място или събитие бъде поставена диагноза коронавирус, други лица, които са се регистрирали на същото място по същото време, може да бъдат предупредени автоматично."</item>
<item>"CWA Ви позволява да се регистрирате, когато пристигате на определени места и събития. Организаторите на събития и собствениците на магазини могат да използват приложението за създаване на QR код, който посетителите да сканират, когато пристигат, за да регистрират присъствието си. При поискване приложението може също да създава запис в дневника. Ако на някой от посетителите на съответното място или събитие бъде поставена диагноза коронавирус на по-късен етап, другите лица, които са се регистрирали на същото място по същото време, ще могат да бъдат предупредени."</item>
</string-array>

<!-- XTXT: Text labels that will be converted to Links -->
Expand Down
9 changes: 9 additions & 0 deletions Corona-Warn-App/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1991,4 +1991,13 @@
<string name="trace_location_attendee_consent_dialog_positive_button">"Споделяне"</string>
<!-- XBUT: Trace location check-ins consent screen dialog negative button -->
<string name="trace_location_attendee_consent_dialog_negative_button">"Да не се споделя"</string>

<!-- XHED: Trace location check-ins invalid qr code dialog title -->
<string name="trace_location_attendee_invalid_qr_code_dialog_title">"Невалиден QR код"</string>
<!-- YTXT: Trace location check-ins invalid qr code dialog message -->
<string name="trace_location_attendee_invalid_qr_code_dialog_message">"Сканираният QR код е невалиден.\nМоля, сканирайте валиден QR код.\n\n(%1$s)"</string>
<!-- XBUT: Trace location check-ins invalid qr code dialog positive button -->
<string name="trace_location_attendee_invalid_qr_code_dialog_positive_button">"ОК"</string>
<!-- XBUT: Trace location check-ins invalid qr code dialog negative button -->
<string name="trace_location_attendee_invalid_qr_code_dialog_negative_button">"Отказ"</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<!-- XTXT: Text bodies for the release info screen bullet points -->
<string-array name="new_release_body">
<item>Die CWA ermöglicht nun einen Check-in für Events und Orte. Personen, die Events veranstalten oder ein Geschäft haben, können über die App einen QR-Code erstellen. Durch Scannen des QR-Codes können sich Gäste bei Ankunft einchecken, um so ihre Anwesenheit zu registrieren. Auf Wunsch legt die App außerdem einen entsprechenden Tagebuch-Eintrag an. Wird eine eingecheckte Person später positiv auf das Coronavirus getestet, können andere Personen gewarnt werden, die zur selben Zeit eingescheckt waren.</item>
<item>Die CWA ermöglicht nun einen Check-in für Events und Orte. Personen, die Events veranstalten oder ein Geschäft haben, können über die App einen QR-Code erstellen. Durch Scannen des QR-Codes können sich Gäste bei Ankunft einchecken, um so ihre Anwesenheit zu registrieren. Auf Wunsch legt die App außerdem einen entsprechenden Tagebuch-Eintrag an. Wird eine eingecheckte Person später positiv auf das Coronavirus getestet, können andere Personen gewarnt werden, die zur selben Zeit eingecheckt waren.</item>
</string-array>

<!-- XTXT: Text labels that will be converted to Links -->
Expand Down
9 changes: 9 additions & 0 deletions Corona-Warn-App/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1992,4 +1992,13 @@
<string name="trace_location_attendee_consent_dialog_positive_button">Teilen</string>
<!-- XBUT: Trace location check-ins consent screen dialog negative button -->
<string name="trace_location_attendee_consent_dialog_negative_button">Nicht teilen</string>

<!-- XHED: Trace location check-ins invalid qr code dialog title -->
<string name="trace_location_attendee_invalid_qr_code_dialog_title">QR-Code nicht gültig</string>
<!-- YTXT: Trace location check-ins invalid qr code dialog message -->
<string name="trace_location_attendee_invalid_qr_code_dialog_message">Der gescannte QR-Code ist nicht gültig.\nBitte scannen Sie einen gültigen QR-Code.\n\n(%1$s)</string>
<!-- XBUT: Trace location check-ins invalid qr code dialog positive button -->
<string name="trace_location_attendee_invalid_qr_code_dialog_positive_button">Ok</string>
<!-- XBUT: Trace location check-ins invalid qr code dialog negative button -->
<string name="trace_location_attendee_invalid_qr_code_dialog_negative_button">Abbrechen</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<!-- XTXT: Text bodies for the release info screen bullet points -->
<string-array name="new_release_body">
<item>"The CWA now enables you to check in to events and places. Event organizers and store owners can use the app to create a QR code. Guests can then scan this QR code when they arrive to register their presence. The app can also create a journal entry upon request. If someone who checked in to this event or place is diagnosed with coronavirus later, other people who were checked in at the same time can be warned automatically."</item>
<item>"The CWA now enables you to check in to events and places. Event organizers and store owners can use the app to create a QR code. Guests can then scan this QR code when they arrive to register their presence. The app can also create a journal entry upon request. If someone who checked in to this event or place is diagnosed with coronavirus later, others who were checked in at the same time can be warned."</item>
</string-array>

<!-- XTXT: Text labels that will be converted to Links -->
Expand Down
9 changes: 9 additions & 0 deletions Corona-Warn-App/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1991,4 +1991,13 @@
<string name="trace_location_attendee_consent_dialog_positive_button">"Share"</string>
<!-- XBUT: Trace location check-ins consent screen dialog negative button -->
<string name="trace_location_attendee_consent_dialog_negative_button">"Don’t Share"</string>

<!-- XHED: Trace location check-ins invalid qr code dialog title -->
<string name="trace_location_attendee_invalid_qr_code_dialog_title">"Invalid QR Code"</string>
<!-- YTXT: Trace location check-ins invalid qr code dialog message -->
<string name="trace_location_attendee_invalid_qr_code_dialog_message">"The scanned QR code is not valid.\nPlease scan a valid QR code.\n\n(%1$s)"</string>
<!-- XBUT: Trace location check-ins invalid qr code dialog positive button -->
<string name="trace_location_attendee_invalid_qr_code_dialog_positive_button">"OK"</string>
<!-- XBUT: Trace location check-ins invalid qr code dialog negative button -->
<string name="trace_location_attendee_invalid_qr_code_dialog_negative_button">"Cancel"</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<!-- XTXT: Text bodies for the release info screen bullet points -->
<string-array name="new_release_body">
<item>"CWA umożliwia teraz meldowanie obecności w wydarzeniach i miejscach. Organizatorzy wydarzeń i właściciele sklepów mogą wykorzystać tę aplikację do utworzenia kodu QR. Goście mogą zeskanować ten kod QR po przybyciu na miejsce, aby zarejestrować swoją obecność. Na życzenie aplikacja może również utworzyć wpis w dzienniku. Jeśli u osoby, która zameldowała swoją obecność w danym wydarzeniu lub miejscu, zostanie później zdiagnozowany koronawirus, inne osoby, które zameldowały się w tym samym czasie, otrzymają automatyczne ostrzeżenie."</item>
<item>"CWA umożliwia teraz meldowanie obecności w wydarzeniach i miejscach. Organizatorzy wydarzeń i właściciele sklepów mogą wykorzystać tę aplikację do utworzenia kodu QR. Goście mogą zeskanować ten kod QR po przybyciu na miejsce, aby zarejestrować swoją obecność. Na życzenie aplikacja może również utworzyć wpis w dzienniku. Jeśli u osoby, która zameldowała swoją obecność w danym wydarzeniu lub miejscu, zostanie później zdiagnozowany koronawirus, inne osoby, które zameldowały się w tym samym czasie, otrzymają ostrzeżenie."</item>
</string-array>

<!-- XTXT: Text labels that will be converted to Links -->
Expand Down
9 changes: 9 additions & 0 deletions Corona-Warn-App/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1991,4 +1991,13 @@
<string name="trace_location_attendee_consent_dialog_positive_button">"Udostępnij"</string>
<!-- XBUT: Trace location check-ins consent screen dialog negative button -->
<string name="trace_location_attendee_consent_dialog_negative_button">"Nie udostępniaj"</string>

<!-- XHED: Trace location check-ins invalid qr code dialog title -->
<string name="trace_location_attendee_invalid_qr_code_dialog_title">"Nieprawidłowy kod QR"</string>
<!-- YTXT: Trace location check-ins invalid qr code dialog message -->
<string name="trace_location_attendee_invalid_qr_code_dialog_message">"Zeskanowany kod QR jest nieprawidłowy.\nZeskanuj prawidłowy kod QR.\n\n(%1$s)"</string>
<!-- XBUT: Trace location check-ins invalid qr code dialog positive button -->
<string name="trace_location_attendee_invalid_qr_code_dialog_positive_button">"OK"</string>
<!-- XBUT: Trace location check-ins invalid qr code dialog negative button -->
<string name="trace_location_attendee_invalid_qr_code_dialog_negative_button">"Anuluj"</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<!-- XTXT: Text bodies for the release info screen bullet points -->
<string-array name="new_release_body">
<item>"Acum, aplicația Corona-Warn vă permite să faceți check-in la evenimente și în locuri. Organizatorii de evenimente și proprietarii de magazine pot utiliza aplicația pentru a crea un cod QR. Apoi, invitații pot scana acest cod QR atunci când sosesc, pentru a-și înregistra prezența. De asemenea, aplicația poate crea la cerere o intrare în jurnal. Dacă o persoană care a făcut check-in la acest eveniment sau în acest loc este diagnosticată ulterior cu coronavirus, alte persoane care au făcut check-in în același timp pot fi avertizate automat."</item>
<item>"Acum, aplicația Corona-Warn vă permite să faceți check-in la evenimente și în locuri. Organizatorii de evenimente și proprietarii de magazine pot utiliza aplicația pentru a crea un cod QR. Apoi, invitații pot scana acest cod QR atunci când sosesc, pentru a-și înregistra prezența. De asemenea, aplicația poate crea la cerere o intrare în jurnal. Dacă o persoană care a făcut check-in la acest eveniment sau în acest loc este diagnosticată ulterior cu coronavirus, alte persoane care au făcut check-in în același timp pot fi avertizate."</item>
</string-array>

<!-- XTXT: Text labels that will be converted to Links -->
Expand Down
9 changes: 9 additions & 0 deletions Corona-Warn-App/src/main/res/values-ro/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1991,4 +1991,13 @@
<string name="trace_location_attendee_consent_dialog_positive_button">"Partajare"</string>
<!-- XBUT: Trace location check-ins consent screen dialog negative button -->
<string name="trace_location_attendee_consent_dialog_negative_button">"Nu partajez"</string>

<!-- XHED: Trace location check-ins invalid qr code dialog title -->
<string name="trace_location_attendee_invalid_qr_code_dialog_title">"Cod QR nevalabil"</string>
<!-- YTXT: Trace location check-ins invalid qr code dialog message -->
<string name="trace_location_attendee_invalid_qr_code_dialog_message">"Codul QR scanat nu este valabil.\nScanați un cod QR valabil.\n\n(%1$s)"</string>
<!-- XBUT: Trace location check-ins invalid qr code dialog positive button -->
<string name="trace_location_attendee_invalid_qr_code_dialog_positive_button">"OK"</string>
<!-- XBUT: Trace location check-ins invalid qr code dialog negative button -->
<string name="trace_location_attendee_invalid_qr_code_dialog_negative_button">"Anulare"</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<!-- XTXT: Text bodies for the release info screen bullet points -->
<string-array name="new_release_body">
<item>"CWA artık etkinliklere ve yerlere check in yapabilmenizi sağlar. Etkinlik organizatörleri ve mağaza sahipleri uygulamayı kullanarak bir QR kod oluşturabilir. Ardından konuklar geldiklerinde bu QR kodu tarayarak katılımlarını kayıt altına alabilir. Uygulama, talep üzerine günce girişi oluşturma seçeneği de sunmaktadır. Bu etkinliğe ya da yere check in yapan bir kişi daha sonra koronavirüs tanısı alırsa aynı anda check in yapmış diğer kişilere otomatik olarak uyarı gönderilebilir."</item>
<item>"CWA artık etkinliklere ve yerlere check in yapabilmenizi sağlar. Etkinlik organizatörleri ve mağaza sahipleri uygulamayı kullanarak bir QR kod oluşturabilir. Ardından konuklar geldiklerinde bu QR kodu tarayarak katılımlarını kayıt altına alabilir. Uygulama, talep üzerine günce girişi oluşturma seçeneği de sunmaktadır. Bu etkinliğe ya da yere check in yapan bir kişi daha sonra koronavirüs tanısı alırsa aynı anda check in yapmış diğer kişilere uyarı gönderilebilir."</item>
</string-array>

<!-- XTXT: Text labels that will be converted to Links -->
Expand Down
Loading

0 comments on commit e1ec946

Please sign in to comment.