Commit 6cfad772 authored by stopcovid@lunabee.com's avatar stopcovid@lunabee.com
Browse files

Update to 3.5.2

- Certificate event adjustments
- Add warning on foreign DCC
- Logo sanitary pass
parent 543026ae
......@@ -32,4 +32,5 @@ enum class AppEventName {
e18,
e19,
e20,
e21,
}
\ No newline at end of file
......@@ -45,8 +45,8 @@ android {
applicationId "fr.gouv.android.stopcovid"
minSdkVersion 21
targetSdkVersion 30
versionCode 320
versionName "3.5.1"
versionCode 322
versionName "3.5.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
......
......@@ -590,7 +590,7 @@
"keyfigure.nombrevaccinations.colorCode.dark":"#31D158",
"keyfigure.nombrevaccinations.label":"Total number of vaccinated people",
"keyfigure.nombrevaccinations.shortLabel":"Total vaccinated",
"keyfigure.nombrevaccinations.description":"This indicator represents the total number of people vaccinated for the first time (people who received a first injection).\n\nThe data are consolidated the day after they are reported to take into account the latest vaccination data from the night before.",
"keyfigure.nombrevaccinations.description":"This indicator represents the total number of people vaccinated (people who received all required injections).\nThe data are consolidated the day after they are reported to take into account the latest vaccination data from the night before.\n\n👉 Change on July 26: this indicator now relates to people vaccinated, having received all their injections.",
"enterCodeController.alert.expiredCode.title":"Expired",
"enterCodeController.alert.expiredCode.message":"Your presence in this venue dates back more than 15 days. It is therefore no longer useful from a health point of view to add it to your history.",
"keyFigureDetailController.section.evolution.title":"Evolution",
......@@ -998,7 +998,7 @@
"walletController.convertCertificate.error.url2.title":"Open SI-DEP",
"keyfigure.couvcompletvaccination.label":"Vaccination coverage",
"keyfigure.couvcompletvaccination.shortLabel":"Vaccination coverage",
"keyfigure.couvcompletvaccination.description":"This figure gives the proportion of the population fully vaccinated (all required doses).",
"keyfigure.couvcompletvaccination.description":"This figure gives the proportion of the population over 12 years old fully vaccinated (all required doses).\n\n👉 Change on July 24: this indicator now relates to the vaccinated population over 12 years old.",
"keyfigure.couvcompletvaccination.colorCode.light":"#18B1BF",
"keyfigure.couvcompletvaccination.colorCode.dark":"#72E1EB",
"common.skip":"Skip",
......@@ -1040,5 +1040,6 @@
"flashWalletCodeController.footer.link.android": "https://play.google.com/store/apps/details?id=com.ingroupe.verify.anticovid",
"universalQrScanController.footer.text": "⚠️ For professionals, certificate verification is only allowed with the “TAC Verification” application that you can find on the Stores.\nTap to find out more.",
"universalQrScanController.footer.link.ios": "https://apps.apple.com/fr/app/tousanticovid-verif/id1562303493",
"universalQrScanController.footer.link.android": "https://play.google.com/store/apps/details?id=com.ingroupe.verify.anticovid"
"universalQrScanController.footer.link.android": "https://play.google.com/store/apps/details?id=com.ingroupe.verify.anticovid",
"wallet.proof.europe.foreignCountryWarning.gb": "⚠️ Please contact the NHS - The authenticity of NHS certificates does not comply with EU standards. Work is in progress."
}
{
{
"app.name":"TousAntiCovid",
"onboarding.welcomeController.title":"Bienvenue",
"onboarding.welcomeController.mainMessage.title":"Soyez alertés et alertez les autres en cas d’exposition à la COVID-19",
......@@ -555,7 +555,7 @@
"keyfigure.nombrevaccinations.colorCode.dark":"#31D158",
"keyfigure.nombrevaccinations.label":"Nombre total de personnes vaccinées",
"keyfigure.nombrevaccinations.shortLabel":"Total vaccinés",
"keyfigure.nombrevaccinations.description":"Cet indicateur représente le nombre total de personnes primo-vaccinées (personnes ayant reçu une première injection).\nLes données sont consolidées le lendemain de leur remontée pour tenir compte des dernières données de vaccination de la veille au soir.",
"keyfigure.nombrevaccinations.description":"Cet indicateur représente le nombre total de personnes vaccinées (personnes ayant reçu toutes leurs doses).\nLes données sont consolidées le lendemain de leur remontée pour tenir compte des dernières données de vaccination de la veille au soir.\n\n👉 Changement le 26 juillet : cet indicateur porte désormais sur les personnes vaccinées, ayant reçu toutes leurs doses.",
"enterCodeController.alert.expiredCode.title":"Expiré",
"enterCodeController.alert.expiredCode.message":"Votre présence dans ce lieu date de plus de 15 jours. Il n'est donc plus utile d'un point de vue sanitaire de l'ajouter à votre historique.",
"keyFigureDetailController.section.evolution.title":"Evolution",
......@@ -971,7 +971,7 @@
"keyfigure.couvcompletvaccination.label":"Couverture vaccinale",
"keyfigure.couvcompletvaccination.shortLabel":"Couverture vaccinale",
"keyfigure.couvcompletvaccination.description":"Cet indicateur reflète la part de la population vaccinée avec un schéma complet (l'ensemble des doses nécessaires).",
"keyfigure.couvcompletvaccination.description":"Cet indicateur reflète la part de la population vaccinée de plus de 12 ans avec un schéma complet (l'ensemble des doses nécessaires).\n\n👉 Changement le 24 juillet : cet indicateur porte désormais sur la population vaccinée de plus de 12 ans.",
"keyfigure.couvcompletvaccination.colorCode.light":"#18B1BF",
"keyfigure.couvcompletvaccination.colorCode.dark":"#72E1EB",
"common.skip":"Passer",
......@@ -1015,5 +1015,6 @@
"flashWalletCodeController.footer.link.android": "https://play.google.com/store/apps/details?id=com.ingroupe.verify.anticovid",
"universalQrScanController.footer.text": "⚠️ Pour les professionnels, la vérification de certificats est uniquement permise avec l’application “TAC Vérif” que vous pouvez trouver sur les Stores.\nAppuyez pour en savoir plus.",
"universalQrScanController.footer.link.ios": "https://apps.apple.com/fr/app/tousanticovid-verif/id1562303493",
"universalQrScanController.footer.link.android": "https://play.google.com/store/apps/details?id=com.ingroupe.verify.anticovid"
"universalQrScanController.footer.link.android": "https://play.google.com/store/apps/details?id=com.ingroupe.verify.anticovid",
"wallet.proof.europe.foreignCountryWarning.gb": "⚠️ Veuillez contacter le NHS - L'authenticité des certificats NHS n'est pas en conformité avec les normes de l'UE. Des travaux sont en cours."
}
package com.lunabeestudio.stopcovid.fragment
import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.os.bundleOf
import androidx.core.view.doOnNextLayout
import androidx.core.view.isVisible
import androidx.fragment.app.setFragmentResult
import androidx.navigation.fragment.navArgs
import com.lunabeestudio.stopcovid.R
import com.lunabeestudio.stopcovid.activity.MainActivity
import com.lunabeestudio.stopcovid.coreui.extension.appCompatActivity
import com.lunabeestudio.stopcovid.coreui.extension.findNavControllerOrNull
import com.lunabeestudio.stopcovid.coreui.fastitem.buttonItem
import com.lunabeestudio.stopcovid.coreui.fastitem.captionItem
import com.lunabeestudio.stopcovid.coreui.fastitem.spaceItem
import com.lunabeestudio.stopcovid.coreui.fastitem.titleItem
import com.lunabeestudio.stopcovid.fastitem.dangerButtonItem
import com.lunabeestudio.stopcovid.fastitem.logoItem
import com.mikepenz.fastadapter.GenericItem
import com.lunabeestudio.stopcovid.coreui.extension.safeEmojiSpanify
import com.lunabeestudio.stopcovid.coreui.extension.setTextOrHide
import com.lunabeestudio.stopcovid.coreui.fragment.BaseFragment
import com.lunabeestudio.stopcovid.databinding.FragmentConfirmAddWalletCertificateBinding
class ConfirmAddWalletCertificateFragment : MainFragment() {
class ConfirmAddWalletCertificateFragment : BaseFragment() {
private val args: ConfirmAddWalletCertificateFragmentArgs by navArgs()
override fun getTitleKey(): String = "confirmWalletQrCodeController.title"
private lateinit var binding: FragmentConfirmAddWalletCertificateBinding
override fun getItems(): List<GenericItem> {
val items = arrayListOf<GenericItem>()
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
binding = FragmentConfirmAddWalletCertificateBinding.inflate(inflater, container, false)
return binding.root
}
items += logoItem {
imageRes = R.drawable.wallet
identifier = R.drawable.wallet.toLong()
}
items += spaceItem {
spaceRes = R.dimen.spacing_large
identifier = items.count().toLong()
}
items += captionItem {
text = strings["confirmWalletQrCodeController.explanation.title"]
gravity = Gravity.CENTER
identifier = "confirmWalletQrCodeController.explanation.title".hashCode().toLong()
}
items += titleItem {
text = strings["confirmWalletQrCodeController.explanation.subtitle"]
gravity = Gravity.CENTER
identifier = "confirmWalletQrCodeController.explanation.subtitle".hashCode().toLong()
}
items += spaceItem {
spaceRes = R.dimen.spacing_large
identifier = items.count().toLong()
}
items += buttonItem {
text = strings["confirmWalletQrCodeController.confirm"]
gravity = Gravity.CENTER
width = ViewGroup.LayoutParams.MATCH_PARENT
onClickListener = View.OnClickListener {
setFragmentResult(
WalletContainerFragment.CONFIRM_ADD_CODE_RESULT_KEY,
bundleOf(
WalletContainerFragment.CONFIRM_ADD_CODE_BUNDLE_KEY_CONFIRM to true,
WalletContainerFragment.CONFIRM_ADD_CODE_BUNDLE_KEY_CODE to args.certificateCode,
WalletContainerFragment.CONFIRM_ADD_CODE_BUNDLE_KEY_FORMAT to args.certificateFormat,
)
)
findNavControllerOrNull()?.navigateUp()
}
identifier = "confirmWalletQrCodeController.confirm".hashCode().toLong()
}
items += dangerButtonItem {
text = strings["common.cancel"]
gravity = Gravity.CENTER
width = ViewGroup.LayoutParams.MATCH_PARENT
onClickListener = View.OnClickListener {
findNavControllerOrNull()?.navigateUp()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
if ((activity as? MainActivity)?.binding?.tabLayout?.isVisible == true) {
postponeEnterTransition()
(activity as? MainActivity)?.binding?.appBarLayout?.doOnNextLayout {
startPostponedEnterTransition()
}
identifier = "common.cancel".hashCode().toLong()
(activity as? MainActivity)?.binding?.tabLayout?.isVisible = false
}
items += spaceItem {
spaceRes = R.dimen.spacing_large
identifier = items.count().toLong()
}
override fun refreshScreen() {
appCompatActivity?.supportActionBar?.title = strings["confirmWalletQrCodeController.title"]
binding.walletCaptionTextView.textView.setTextOrHide(strings["confirmWalletQrCodeController.explanation.title"])
binding.walletCaptionTextView.textView.gravity = Gravity.CENTER
binding.walletTitleTextView.textSwitcher.setText(strings["confirmWalletQrCodeController.explanation.subtitle"]?.safeEmojiSpanify())
binding.walletTitleTextView.textView1.gravity = Gravity.CENTER
binding.walletTitleTextView.textView2.gravity = Gravity.CENTER
binding.walletAddButton.setTextOrHide(strings["confirmWalletQrCodeController.confirm"])
binding.walletAddButton.setOnClickListener {
setFragmentResult(
WalletContainerFragment.CONFIRM_ADD_CODE_RESULT_KEY,
bundleOf(
WalletContainerFragment.CONFIRM_ADD_CODE_BUNDLE_KEY_CONFIRM to true,
WalletContainerFragment.CONFIRM_ADD_CODE_BUNDLE_KEY_CODE to args.certificateCode,
WalletContainerFragment.CONFIRM_ADD_CODE_BUNDLE_KEY_FORMAT to args.certificateFormat,
)
)
findNavControllerOrNull()?.navigateUp()
}
return items
binding.walletCancelButton.setTextOrHide(strings["common.cancel"])
binding.walletCancelButton.setOnClickListener {
findNavControllerOrNull()?.navigateUp()
}
}
}
\ No newline at end of file
......@@ -41,8 +41,10 @@ import com.lunabeestudio.stopcovid.coreui.extension.toDimensSize
import com.lunabeestudio.stopcovid.coreui.fastitem.captionItem
import com.lunabeestudio.stopcovid.coreui.fastitem.spaceItem
import com.lunabeestudio.stopcovid.extension.barcodeFormat
import com.lunabeestudio.stopcovid.extension.countryCode
import com.lunabeestudio.stopcovid.extension.dccCertificatesManager
import com.lunabeestudio.stopcovid.extension.fullDescription
import com.lunabeestudio.stopcovid.extension.isFrench
import com.lunabeestudio.stopcovid.extension.openInExternalBrowser
import com.lunabeestudio.stopcovid.extension.raw
import com.lunabeestudio.stopcovid.extension.robertManager
......@@ -237,7 +239,6 @@ class WalletCertificateFragment : MainFragment() {
formatText = Constants.QrCode.FORMAT_2D_DOC
conversionLambda = if (robertManager.configuration.displayCertificateConversion) {
{
AnalyticsManager.reportAppEvent(requireContext(), AppEventName.e20, null)
showConversionConfirmationAlert(certificate)
}
} else {
......@@ -261,13 +262,18 @@ class WalletCertificateFragment : MainFragment() {
return qrCodeCardItem {
this.generateBarcode = generateBarcode
mainDescription = certificate.fullDescription(strings, robertManager.configuration)
footerDescription = if ((certificate as? EuropeanCertificate)?.greenCertificate?.testResultIsNegative == false) {
// Fix SIDEP has generated positive test instead of recovery
val span = strings["wallet.proof.europe.test.positiveSidepError"]?.let { SpannableString(it) }
span?.let { Linkify.addLinks(it, Linkify.WEB_URLS) }
span
} else {
null
val greenCertificate = (certificate as? EuropeanCertificate)?.greenCertificate
footerDescription = when {
greenCertificate == null -> null
greenCertificate.testResultIsNegative == false -> {
// Fix SIDEP has generated positive test instead of recovery
strings["wallet.proof.europe.test.positiveSidepError"]?.toSpannable()?.also {
Linkify.addLinks(it, Linkify.WEB_URLS)
}
}
!greenCertificate.isFrench ->
strings["wallet.proof.europe.foreignCountryWarning.${greenCertificate.countryCode?.lowercase()}"]?.toSpannable()
else -> null
}
share = strings["walletController.menu.share"]
delete = strings["walletController.menu.delete"]
......@@ -364,6 +370,7 @@ class WalletCertificateFragment : MainFragment() {
.setMessage(strings["walletController.menu.convertToEurope.alert.message"])
.setPositiveButton(strings["common.ok"]) { _, _ ->
requestCertificateConversion(certificate)
AnalyticsManager.reportAppEvent(requireContext(), AppEventName.e20, null)
}
.setNegativeButton(strings["common.cancel"], null)
.setNeutralButton(strings["walletController.menu.convertToEurope.alert.terms"]) { _, _ ->
......@@ -427,7 +434,8 @@ class WalletCertificateFragment : MainFragment() {
certificateFormat,
)
viewModel.saveCertificate(requireContext(), certificate)
viewModel.saveCertificate(certificate)
AnalyticsManager.reportAppEvent(requireContext(), AppEventName.e21, null)
val vaccination = (certificate as? EuropeanCertificate)?.greenCertificate?.vaccinations?.lastOrNull()
if (vaccination != null && vaccination.doseNumber >= vaccination.totalSeriesOfDoses) {
......
......@@ -21,6 +21,8 @@ import androidx.fragment.app.viewModels
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.navArgs
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.lunabeestudio.analytics.manager.AnalyticsManager
import com.lunabeestudio.analytics.model.AppEventName
import com.lunabeestudio.domain.model.WalletCertificateType
import com.lunabeestudio.robert.extension.safeEnumValueOf
import com.lunabeestudio.stopcovid.activity.MainActivity
......@@ -198,7 +200,8 @@ class WalletContainerFragment : BaseFragment() {
private suspend fun processCertificate(certificate: WalletCertificate) {
try {
viewModel.saveCertificate(requireContext(), certificate)
viewModel.saveCertificate(certificate)
AnalyticsManager.reportAppEvent(requireContext(), AppEventName.e13, null)
val vaccination = (certificate as? EuropeanCertificate)?.greenCertificate?.vaccinations?.lastOrNull()
if (vaccination != null && vaccination.doseNumber >= vaccination.totalSeriesOfDoses) {
......
......@@ -10,13 +10,10 @@
package com.lunabeestudio.stopcovid.viewmodel
import android.content.Context
import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.map
import com.lunabeestudio.analytics.manager.AnalyticsManager
import com.lunabeestudio.analytics.model.AppEventName
import com.lunabeestudio.framework.local.datasource.SecureKeystoreDataSource
import com.lunabeestudio.robert.RobertManager
import com.lunabeestudio.robert.datasource.LocalKeystoreDataSource
......@@ -61,16 +58,11 @@ class WalletViewModel(
return certificates.value.isNullOrEmpty()
}
fun saveCertificate(
context: Context,
walletCertificate: WalletCertificate
) {
fun saveCertificate(walletCertificate: WalletCertificate) {
WalletManager.saveCertificate(
keystoreDataSource,
walletCertificate,
)
AnalyticsManager.reportAppEvent(context, AppEventName.e13, null)
}
fun toggleFavorite(
......
<?xml version="1.0" encoding="utf-8"?><!--
~ This Source Code Form is subject to the terms of the Mozilla Public
~ License, v. 2.0. If a copy of the MPL was not distributed with this
~ file, You can obtain one at https://mozilla.org/MPL/2.0/.
~
~ Authors
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Created by Lunabee Studio / Date - 2021/26/7 - for the TOUS-ANTI-COVID project
-->
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/walletLogoImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@null"
android:src="@drawable/wallet"
app:layout_constraintBottom_toTopOf="@id/walletLogoDivider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<include
android:id="@+id/walletLogoDivider"
layout="@layout/item_divider"
android:layout_width="0dp"
android:layout_height="@dimen/divider_height"
android:layout_marginStart="@dimen/spacing_xlarge"
android:layout_marginEnd="@dimen/spacing_xlarge"
app:layout_constraintBottom_toTopOf="@id/walletCaptionTextView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/walletLogoImageView" />
<include
android:id="@+id/walletCaptionTextView"
layout="@layout/item_caption"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/spacing_large"
android:layout_marginVertical="@dimen/spacing_small"
app:layout_constraintBottom_toTopOf="@id/walletTitleTextView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<include
android:id="@+id/walletTitleTextView"
layout="@layout/item_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/spacing_large"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/walletAddButton"
style="@style/Widget.StopCovid.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/spacing_large"
android:layout_marginTop="@dimen/spacing_large"
android:textAllCaps="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/walletTitleTextView"
tools:text="@tools:sample/lorem[2]" />
<com.google.android.material.button.MaterialButton
android:id="@+id/walletCancelButton"
style="@style/Widget.StopCovid.Button.Danger"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/spacing_large"
android:layout_marginTop="@dimen/spacing_large"
android:textAllCaps="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/walletAddButton"
tools:text="@tools:sample/lorem[2]" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
\ No newline at end of file
......@@ -672,7 +672,8 @@
tools:layout="@layout/fragment_qr_code" />
<fragment
android:id="@+id/confirmAddWalletCertificateFragment"
android:name="com.lunabeestudio.stopcovid.fragment.ConfirmAddWalletCertificateFragment">
android:name="com.lunabeestudio.stopcovid.fragment.ConfirmAddWalletCertificateFragment"
tools:layout="@layout/fragment_confirm_add_wallet_certificate">
<argument
android:name="certificateCode"
app:argType="string" />
......
......@@ -47,6 +47,7 @@ version.androidx.constraintlayout=2.0.4
## # available=2.1.0-alpha2
## # available=2.1.0-beta01
## # available=2.1.0-beta02
## # available=2.1.0-rc01
version.androidx.core=1.6.0
## # available=1.7.0-alpha01
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment