Skip to content

Commit

Permalink
Merge pull request #1550 from minvws/explo/4.12
Browse files Browse the repository at this point in the history
Explo/4.12
  • Loading branch information
ktiniatros authored Apr 5, 2023
2 parents 8c55b6f + c4f742c commit a3f4002
Show file tree
Hide file tree
Showing 10 changed files with 289 additions and 270 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ package nl.rijksoverheid.ctr.appconfig

import android.annotation.SuppressLint
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.View
import androidx.annotation.DrawableRes
Expand Down Expand Up @@ -52,17 +51,13 @@ class AppLockedFragment : Fragment(R.layout.fragment_app_locked) {
R.string.app_status_deactivated_action,
R.drawable.illustration_app_status_deactivated
) {
startActivity(
Intent(
Intent.ACTION_VIEW, Uri.parse(
getString(
if (isVerifierApp(requireContext())) {
R.string.verifier_deactivation_url
} else {
R.string.holder_deactivation_url
}
)
)
intentUtil.openUrl(
requireContext(), getString(
if (isVerifierApp(requireContext())) {
R.string.verifier_deactivation_url
} else {
R.string.holder_deactivation_url
}
)
)
}
Expand All @@ -78,10 +73,16 @@ class AppLockedFragment : Fragment(R.layout.fragment_app_locked) {
}
}
is AppStatus.LaunchError -> {
val helpdeskPhoneNumber = cachedAppConfigUseCase.getCachedAppConfig().contactInfo.phoneNumber
val helpdeskPhoneNumber =
cachedAppConfigUseCase.getCachedAppConfig().contactInfo.phoneNumber
binding.bind(
R.string.appstatus_launchError_title,
getString(R.string.appstatus_launchError_body, helpdeskPhoneNumber, helpdeskPhoneNumber, appStatus.errorMessage),
getString(
R.string.appstatus_launchError_body,
helpdeskPhoneNumber,
helpdeskPhoneNumber,
appStatus.errorMessage
),
R.string.appstatus_launchError_button,
R.drawable.illustration_app_status_launch_error
) {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion appconfig/src/main/res/layout/fragment_app_locked.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<Button
android:id="@+id/action"
style="@style/Widget.App.Button.Small"
style="@style/Widget.App.Button.Small.DayNight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import nl.rijksoverheid.ctr.design.ext.getAttrColor
import nl.rijksoverheid.ctr.design.ext.isHeading
import nl.rijksoverheid.ctr.design.ext.separated
import nl.rijksoverheid.ctr.design.spans.BulletPointSpan
import nl.rijksoverheid.ctr.shared.utils.WebsiteEnvironmentUtil
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject

private const val HTML_LINKS_ENABLED = false
private const val PARAGRAPH_MARGIN_MULTIPLIER = 1.0f
Expand All @@ -45,7 +48,9 @@ class HtmlTextViewWidget @JvmOverloads constructor(
attrs: AttributeSet? = null,
defStyle: Int = 0,
defStyleRes: Int = 0
) : LinearLayout(context, attrs, defStyle, defStyleRes) {
) : LinearLayout(context, attrs, defStyle, defStyleRes), KoinComponent {

private val websiteEnvironmentUtil: WebsiteEnvironmentUtil by inject()

private val textColor by lazy {
context.getColor(R.color.primary_text)
Expand Down Expand Up @@ -131,7 +136,12 @@ class HtmlTextViewWidget @JvmOverloads constructor(
splitHtmlText: Boolean = false
) {
val text = context.getString(htmlText)
setHtmlText(text, htmlLinksEnabled = htmlLinksEnabled, splitHtmlText = splitHtmlText, textIsSelectable = textIsSelectable)
setHtmlText(
text,
htmlLinksEnabled = htmlLinksEnabled,
splitHtmlText = splitHtmlText,
textIsSelectable = textIsSelectable
)
}

/**
Expand All @@ -157,10 +167,11 @@ class HtmlTextViewWidget @JvmOverloads constructor(
if (htmlText.isEmpty()) {
return
}
this.text = htmlText

val adjustedHtmlText = websiteEnvironmentUtil.adjust(htmlText)

// Step 1: Parse the given String into a Spannable
val spannable = getSpannableFromHtml(htmlText)
val spannable = getSpannableFromHtml(adjustedHtmlText)
this.spannable = spannable

// Step 2: Separate the Spannable on each paragraph if
Expand Down
1 change: 0 additions & 1 deletion design/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<style name="Widget.App.Button.Small.DayNight" parent="Widget.App.Button.Small.Night" />
<style name="Widget.App.Button.Small.Night" parent="Widget.App.Button.Small">
<item name="android:textColor">@color/cta_text_color</item>
<item name="android:backgroundTint">@color/neutral_white</item>
</style>

<style name="Widget.App.Button.DayNight" parent="Widget.App.Button.Night" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class HolderMainActivity : AppCompatActivity() {
val isAppStatusFragment =
navController.currentBackStackEntry?.destination?.id == R.id.nav_app_locked
if (isAppStatusFragment) {
navController.popBackStack()
navController.navigate(RootNavDirections.actionMain())
}
}

Expand Down
12 changes: 6 additions & 6 deletions holder/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@
<string name="refresh_eu_items_toolbar_title">Renew vaccination certificate</string>
<string name="dashboard_item_refreshed_eu_vaccinations_text">Your international vaccination certificate has been renewed</string>
<string name="refreshed_eu_items_title">Renewed vaccination certificate</string>
<string name="refreshed_eu_items_description"><![CDATA[We have renewed everyone\'s vaccination certificate. From now on, you have access to QR codes of earlier vaccinations.<br/><br/>This can be useful for people who want to go to a place where their latest vaccination is not yet valid.<br/><br/><a href=\"https://coronacheck.nl/en/faq/3-5-waarom-heb-ik-voor-elke-prik-een-internationale-QR-code/\">Read more about your renewed vaccination certificate here</a>.]]></string>
<string name="refreshed_eu_items_description"><![CDATA[We have renewed everyone\'s vaccination certificate. From now on, you have access to QR codes of earlier vaccinations.<br/><br/>This can be useful for people who want to go to a place where their latest vaccination is not yet valid.<br/><br/><a href=\"https://coronacheck.nl/en/faq-in-app/3-5-waarom-heb-ik-voor-elke-prik-een-internationale-QR-code/\">Read more about your renewed vaccination certificate here</a>.]]></string>
<string name="config_warning_card_message">Please connect to the internet soon</string>
<string name="config_warning_page_title">Please connect to the internet</string>
<string name="config_warning_page_message"><![CDATA[Every now and then, the CoronaCheck app needs an internet connection to keep working. Without internet, your app will keep working until %1s. Open the app once you have an internet connection. It will automatically work again.<br/><br/>Please connect regularly to prevent any problems.]]></string>
Expand Down Expand Up @@ -529,9 +529,9 @@
<string name="certificate_created_toolbar_title">Certificate created</string>
<string name="certificate_created_vaccination_recovery_description"><![CDATA[A Dutch vaccination certificate has been created.<br><br>Your positive test result was suitable for creating a recovery certificate as well.]]></string>
<string name="certificate_created_recovery_title">Created only a recovery certificate</string>
<string name="certificate_created_recovery_description"><![CDATA[You tested positive after your first vaccination. Your test result is therefore not suitable for creating a Dutch vaccination certificate. However, a recovery certificate has been created.<br><br>Check the <a href=\"https://coronacheck.nl/en/faq/2-4-ik-heb-wel-een-internationale-qr-code-maar-geen-nederlandse/\">the frequently asked questions</a> for more information.]]></string>
<string name="certificate_created_recovery_description"><![CDATA[You tested positive after your first vaccination. Your test result is therefore not suitable for creating a Dutch vaccination certificate. However, a recovery certificate has been created.<br><br>Check the <a href=\"https://coronacheck.nl/en/faq-in-app/2-4-ik-heb-wel-een-internationale-qr-code-maar-geen-nederlandse/\">the frequently asked questions</a> for more information.]]></string>
<string name="certificate_created_recovery_unsuitable_title">Positive test result is not suitable</string>
<string name="certificate_created_recovery_unsuitable_description"><![CDATA[You were tested positive after your first vaccination. Your test result is therefore not suitable for creating a Dutch certificate.<br><br>Check the <a href=\"https://coronacheck.nl/en/faq/2-4-ik-heb-wel-een-internationale-qr-code-maar-geen-nederlandse/\">frequently asked questions</a> for more information.]]></string>
<string name="certificate_created_recovery_unsuitable_description"><![CDATA[You were tested positive after your first vaccination. Your test result is therefore not suitable for creating a Dutch certificate.<br><br>Check the <a href=\"https://coronacheck.nl/en/faq-in-app/2-4-ik-heb-wel-een-internationale-qr-code-maar-geen-nederlandse/\">frequently asked questions</a> for more information.]]></string>
<string name="retrieve_test_result_toolbar_title">Retrieve test result</string>
<string name="retrieve_test_result_title">Retrieve details about your positive test</string>
<string name="retrieve_test_result_description">Log in with DigiD. Details about your positive test will be retrieved automatically.</string>
Expand Down Expand Up @@ -716,7 +716,7 @@ Read more on <a href=\"https://www.government.nl/entry-pass-visitors-cc\">www.go
<string name="holder_storedEvents_title">My stored data</string>
<string name="holder_storedEvents_message">The data below is stored on your phone and is used by CoronaCheck to create your coronavirus pass.</string>
<string name="holder_storedEvents_button_handleData">How does Coronacheck handle my data?</string>
<string name="holder_storedEvents_url">https://coronacheck.nl/en/privacy</string>
<string name="holder_storedEvents_url">https://coronacheck.nl/en/privacy-in-app</string>
<string name="holder_storedEvents_button_removeEvents">Remove from the app</string>
<string name="holder_storedEvents_list_noEvents">No stored data</string>
<string name="holder_storedEvents_listHeader_fetchedFromProvider">Retrieved at %s</string>
Expand Down Expand Up @@ -763,9 +763,9 @@ Read more on <a href=\"https://www.government.nl/entry-pass-visitors-cc\">www.go
<string name="holder_qr_code_expired_explanation_title">Expired QR code</string>
<string name="holder_qr_code_expired_explanation_description"><![CDATA[If your QR code has expired it means your vaccination is still valid, but the certificate that you’ve added isn\'t. You can request a new certificate with QR code and add it to the app again.<br/><br/>Do you have a more recent vaccination in the app? Then you can also use that QR code.]]></string>
<string name="holder_qr_code_expired_explanation_action">Read more on CoronaCheck.nl</string>
<string name="holder_qr_code_expired_explanation_url">https://coronacheck.nl/en/faq/1-12-de-qr-code-van-mijn-vaccinatie-is-verlopen-wat-moet-ik-doen/</string>
<string name="holder_qr_code_expired_explanation_url">https://coronacheck.nl/en/faq-in-app/1-12-de-qr-code-van-mijn-vaccinatie-is-verlopen-wat-moet-ik-doen/</string>
<string name="holder_qr_code_hidden_explanation_action">Read more on CoronaCheck.nl</string>
<string name="holder_qr_code_hidden_explanation_url">https://coronacheck.nl/en/faq/1-11-mijn-qr-code-is-verborgen-wat-betekent-dit/</string>
<string name="holder_qr_code_hidden_explanation_url">https://coronacheck.nl/en/faq-in-app/1-11-mijn-qr-code-is-verborgen-wat-betekent-dit/</string>
<string name="holder_showQR_euAboutVaccination_daysSince">Days since vaccination:</string>
<plurals name="general_days">
<item quantity="one">day</item>
Expand Down
12 changes: 6 additions & 6 deletions holder/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@
<string name="refresh_eu_items_toolbar_title">Bewijs vernieuwen</string>
<string name="dashboard_item_refreshed_eu_vaccinations_text">Jouw vaccinatiebewijs is vernieuwd</string>
<string name="refreshed_eu_items_title">Vernieuwd vaccinatiebewijs</string>
<string name="refreshed_eu_items_description"><![CDATA[We hebben voor iedereen het vaccinatiebewijs vernieuwd. Je hebt nu ook toegang tot QR-codes van eerdere prikken.<br/><br/>Dat is bijvoorbeeld handig voor mensen die ergens heen willen waar hun laatste prik nog niet geldig is.<br/><br/><a href=\"https://coronacheck.nl/nl/faq/3-5-waarom-heb-ik-voor-elke-prik-een-internationale-QR-code/\">Lees hier meer over je vernieuwde vaccinatiebewijs</a>.]]></string>
<string name="refreshed_eu_items_description"><![CDATA[We hebben voor iedereen het vaccinatiebewijs vernieuwd. Je hebt nu ook toegang tot QR-codes van eerdere prikken.<br/><br/>Dat is bijvoorbeeld handig voor mensen die ergens heen willen waar hun laatste prik nog niet geldig is.<br/><br/><a href=\"https://coronacheck.nl/nl/faq-in-app/3-5-waarom-heb-ik-voor-elke-prik-een-internationale-QR-code/\">Lees hier meer over je vernieuwde vaccinatiebewijs</a>.]]></string>
<string name="config_warning_card_message">Maak binnenkort verbinding met het internet</string>
<string name="config_warning_page_title">Maak verbinding met het internet</string>
<string name="config_warning_page_message"><![CDATA[De CoronaCheck-app heeft af en toe internet nodig om te blijven werken. Zonder internetverbinding werkt jouw app nog tot %1s. Open de app zodra je internet hebt. Dan doet deze het gewoon weer.<br/><br/>Maak regelmatig verbinding om problemen te voorkomen.]]></string>
Expand Down Expand Up @@ -529,9 +529,9 @@
<string name="certificate_created_toolbar_title">Bewijs gemaakt</string>
<string name="certificate_created_vaccination_recovery_description"><![CDATA[Er is een Nederlands vaccinatiebewijs gemaakt.<br><br>Van je positieve testuitslag kon ook een herstelbewijs gemaakt worden.]]></string>
<string name="certificate_created_recovery_title">Alleen een herstelbewijs gemaakt</string>
<string name="certificate_created_recovery_description"><![CDATA[Je bent positief getest ná je eerste vaccinatie. Daardoor is je testuitslag niet geschikt om een Nederlands vaccinatiebewijs van te maken. Er is wel een herstelbewijs gemaakt.<br><br>Kijk voor meer informatie bij de <a href=\"https://coronacheck.nl/nl/faq/2-4-ik-heb-wel-een-internationale-qr-code-maar-geen-nederlandse/\">meestgestelde vragen</a>.]]></string>
<string name="certificate_created_recovery_description"><![CDATA[Je bent positief getest ná je eerste vaccinatie. Daardoor is je testuitslag niet geschikt om een Nederlands vaccinatiebewijs van te maken. Er is wel een herstelbewijs gemaakt.<br><br>Kijk voor meer informatie bij de <a href=\"https://coronacheck.nl/nl/faq-in-app/2-4-ik-heb-wel-een-internationale-qr-code-maar-geen-nederlandse/\">meestgestelde vragen</a>.]]></string>
<string name="certificate_created_recovery_unsuitable_title">Positieve testuitslag is niet geschikt</string>
<string name="certificate_created_recovery_unsuitable_description"><![CDATA[Je bent positief getest ná je eerste vaccinatie. Daardoor is je testuitslag niet geschikt om een Nederlands vaccinatiebewijs van te maken. Er is wel een herstelbewijs gemaakt.<br><br>Kijk voor meer informatie bij de <a href=\"https://coronacheck.nl/nl/faq/2-4-ik-heb-wel-een-internationale-qr-code-maar-geen-nederlandse/\">meestgestelde vragen</a>.]]></string>
<string name="certificate_created_recovery_unsuitable_description"><![CDATA[Je bent positief getest ná je eerste vaccinatie. Daardoor is je testuitslag niet geschikt om een Nederlands vaccinatiebewijs van te maken. Er is wel een herstelbewijs gemaakt.<br><br>Kijk voor meer informatie bij de <a href=\"https://coronacheck.nl/nl/faq-in-app/2-4-ik-heb-wel-een-internationale-qr-code-maar-geen-nederlandse/\">meestgestelde vragen</a>.]]></string>
<string name="retrieve_test_result_toolbar_title">Testuitslag ophalen</string>
<string name="retrieve_test_result_title">Gegevens van je positieve test ophalen</string>
<string name="retrieve_test_result_description">Log in met DigiD. De gegevens van je positieve test worden dan automatisch opgehaald.</string>
Expand Down Expand Up @@ -716,7 +716,7 @@ Lees meer op <a href=\"https://www.rijksoverheid.nl/ctb-bezoekers-cc\">www.rijks
<string name="holder_storedEvents_title">Mijn opgeslagen gegevens</string>
<string name="holder_storedEvents_message">De gegevens hieronder staan opgeslagen op je telefoon en worden gebruikt door CoronaCheck om je coronabewijs te maken.</string>
<string name="holder_storedEvents_button_handleData">Hoe gaat CoronaCheck met gegevens om?</string>
<string name="holder_storedEvents_url">https://coronacheck.nl/nl/privacy</string>
<string name="holder_storedEvents_url">https://coronacheck.nl/nl/privacy-in-app</string>
<string name="holder_storedEvents_button_removeEvents">Uit de app verwijderen</string>
<string name="holder_storedEvents_list_noEvents">Geen gegevens opgeslagen</string>
<string name="holder_storedEvents_listHeader_fetchedFromProvider">Opgehaald bij %s</string>
Expand Down Expand Up @@ -763,9 +763,9 @@ Lees meer op <a href=\"https://www.rijksoverheid.nl/ctb-bezoekers-cc\">www.rijks
<string name="holder_qr_code_expired_explanation_title">Verlopen QR-code</string>
<string name="holder_qr_code_expired_explanation_description"><![CDATA[Als je QR-code is verlopen betekent dit dat je vaccinatie nog geldig is, maar het bewijs dat je hebt toegevoegd niet meer. Je kunt een nieuw bewijs met QR-code aanvragen en deze opnieuw toevoegen aan de app.<br/><br/>Heb je een nieuwere vaccinatie in de app staan? Dan kun je ook die QR-code gebruiken.]]></string>
<string name="holder_qr_code_expired_explanation_action">Lees meer op CoronaCheck.nl</string>
<string name="holder_qr_code_expired_explanation_url">https://coronacheck.nl/nl/faq/1-12-de-qr-code-van-mijn-vaccinatie-is-verlopen-wat-moet-ik-doen/</string>
<string name="holder_qr_code_expired_explanation_url">https://coronacheck.nl/nl/faq-in-app/1-12-de-qr-code-van-mijn-vaccinatie-is-verlopen-wat-moet-ik-doen/</string>
<string name="holder_qr_code_hidden_explanation_action">Lees meer op CoronaCheck.nl</string>
<string name="holder_qr_code_hidden_explanation_url">https://coronacheck.nl/nl/faq/1-11-mijn-qr-code-is-verborgen-wat-betekent-dit/</string>
<string name="holder_qr_code_hidden_explanation_url">https://coronacheck.nl/nl/faq-in-app/1-11-mijn-qr-code-is-verborgen-wat-betekent-dit/</string>
<string name="holder_showQR_euAboutVaccination_daysSince">Dagen sinds vaccinatie / Days since vaccination:</string>
<plurals name="general_days">
<item quantity="one">dag</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ class WebsiteEnvironmentUtilImplTest {

assert(websiteEnvironmentUtil.adjust(url) == "https://www.coronacheck.nl/en/faq-in-app.html")
}

@Test
fun `given a link in html text, when acc, then return acc web link`() {
every { context.packageName } returns "nl.rijksoverheid.ctr.holder.acc"

val adjustedUrlText = websiteEnvironmentUtil.adjust("In de <a href=\"https://coronacheck.nl/nl/privacy-in-app\">privacyverklaring</a> staat hoe de app omgaat met jouw gegevens. Dit zijn de belangrijkste punten:")
assert(adjustedUrlText.contains("acc"))
}
}

0 comments on commit a3f4002

Please sign in to comment.