Commit d7cc29a8 authored by Harri Kirik's avatar Harri Kirik
Browse files

COVAPP-462: Update URLs and add in fixes from code review

parent aeceb5cd
......@@ -25,19 +25,19 @@ object IcefireEnvironment : Environment {
override val patientPortalBaseUrl: String = "https://portal-emulator-dev.icefire-lab.eu?"
override val patientPortalCallbackBaseUrl: String = "https://app-emulator-dev.icefire-lab.eu/callback"
override val infoPageUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me?source=app",
en = "https://www.hoia.me/en?source=app",
ru = "https://www.hoia.me/ru?source=app"
et = "https://hoia.me?source=app",
en = "https://hoia.me/en?source=app",
ru = "https://hoia.me/ru?source=app"
)
override val contactInfoPageUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/contact?source=app",
en = "https://www.hoia.me/en/contact?source=app",
ru = "https://www.hoia.me/ru/contact?source=app"
et = "ttps://www.hoia.me/close-contact?source=app",
en = "https://www.hoia.me/en/close-contact?source=app",
ru = "https://www.hoia.me/ru/close-contact?source=app"
)
override val privacyPolicyUrl: LocalizedUrl = LocalizedUrl(
et = "https://hoia.me/privacy?source=app",
en = "https://hoia.me/en/privacy?source=app",
ru = "https://hoia.me/ru/privacy?source=app"
et = "https://www.hoia.me/privacy?source=app",
en = "https://www.hoia.me/en/privacy?source=app",
ru = "https://www.hoia.me/ru/privacy?source=app"
)
override val covidInstructionsUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.terviseamet.ee/et/patsiendi-koduse-ravi-juhend-covid-19-korral",
......@@ -49,15 +49,15 @@ object IcefireEnvironment : Environment {
en = "https://www.terviseamet.ee/et/lahikontaktse-juhis#ENG",
ru = "https://www.terviseamet.ee/et/lahikontaktse-juhis#RUS"
)
override val gotSickAbroadUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/hoia-euroopas?source=app",
en = "https://www.hoia.me/en/hoia-in-europe?source=app",
ru = "https://hoia.me/ru/hoia-v-yevrope?source=app"
)
override val appLogEnabled: Boolean = BuildConfig.DEBUG
override val crashAppOnUndeliverableException: Boolean = BuildConfig.DEBUG
override val showLongVersionInfo: Boolean = true
override val allowInfectionConfirmationStartWithoutGAEN: Boolean = BuildConfig.DEBUG
override val federationGatewayUsageForDP3TBackend: FederationGatewayUsageForDP3TBackend = FederationGatewayUsageForDP3TBackend.Enabled
override val federationGatewayUsageForPatientPortal: FederationGatewayUsageForPatientPortal = FederationGatewayUsageForPatientPortal.Enabled
override val gotSickAbroadUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/got-sick-abroad?source=app",
en = "https://www.hoia.me/got-sick-abroad/en?source=app",
ru = "https://www.hoia.me/got-sick-abroad/ru?source=app"
)
}
......@@ -27,6 +27,10 @@ interface Environment {
val covidInstructionsUrl: LocalizedUrl
val healthBoardRecommendationsUrl: LocalizedUrl
val privacyPolicyUrl: LocalizedUrl
/**
* URL to Hoia.me page's got sick abroad information.
*/
val gotSickAbroadUrl: LocalizedUrl
// Is app logging enabled?
val appLogEnabled: Boolean
// Should we display the long version string with backend and SDK info?
......@@ -45,8 +49,4 @@ interface Environment {
* Flag to use when doing PP side infection confirmation. See [FederationGatewayUsageForPatientPortal] for more.
*/
val federationGatewayUsageForPatientPortal: FederationGatewayUsageForPatientPortal
/**
* URL to Hoia.me page's got sick abroad information.
*/
val gotSickAbroadUrl: LocalizedUrl
}
......@@ -74,30 +74,16 @@ fun TextView.setTextWithClickableSpan(source: String, clickablePart: String, cli
movementMethod = LinkMovementMethod.getInstance()
}
fun TextView.setTextWithTwoClickableSpans(
source: String,
clickablePart1: String,
clickListener1: () -> Unit,
clickablePart2: String,
clickListener2: () -> Unit
) {
val spannable = SpannableString(source)
addClickableSpan(spannable, clickablePart1, clickListener1)
addClickableSpan(spannable, clickablePart2, clickListener2)
this.text = spannable
movementMethod = LinkMovementMethod.getInstance()
}
private fun TextView.addClickableSpan(
spannable: SpannableString,
clickablePart1: String,
clickListener1: () -> Unit
clickablePart: String,
clickListener: () -> Unit
) {
spannable.addSpan(
clickablePart1,
clickablePart,
object : ClickableSpan() {
override fun onClick(widget: View) {
clickListener1.invoke()
clickListener.invoke()
}
override fun updateDrawState(paint: TextPaint) {
......
......@@ -17,11 +17,11 @@ import androidx.navigation.fragment.findNavController
import mobi.lab.mvvm.MvvmFragment
import org.dpppt.android.app.BuildConfig
import org.dpppt.android.app.R
import org.dpppt.android.app.common.util.ViewBindingHolder
import org.dpppt.android.app.common.util.DateUtils
import org.dpppt.android.app.common.util.FragmentBindingHolder
import org.dpppt.android.app.common.util.ViewBindingHolder
import org.dpppt.android.app.common.util.ViewModelFactory
import org.dpppt.android.app.common.util.exhaustive
import org.dpppt.android.app.common.util.DateUtils
import org.dpppt.android.app.common.util.setTextWithBoldSpans
import org.dpppt.android.app.databinding.FragmentHomeBinding
import org.dpppt.android.app.di.Injector
......@@ -30,7 +30,6 @@ import org.dpppt.android.app.domain.entity.enums.SettingsScrollDestination
import org.dpppt.android.app.main.model.InfectedStatus
import org.dpppt.android.app.util.startActivitySafely
import org.dpppt.android.app.viewmodel.TracingViewModel
import timber.log.Timber
import javax.inject.Inject
class HomeFragment : MvvmFragment(R.layout.fragment_home), ViewBindingHolder<FragmentHomeBinding> by FragmentBindingHolder() {
......@@ -50,17 +49,6 @@ class HomeFragment : MvvmFragment(R.layout.fragment_home), ViewBindingHolder<Fra
return createBinding(FragmentHomeBinding.inflate(inflater), this)
}
override fun onSaveInstanceState(outState: Bundle) {
Timber.d("WOOT onSaveInstanceState")
outState.putString("TEST", "loading")
super.onSaveInstanceState(outState)
}
override fun onViewStateRestored(savedInstanceState: Bundle?) {
Timber.d("WOOT onViewStateRestored: ${savedInstanceState?.getString("TEST")}")
super.onViewStateRestored(savedInstanceState)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initViewModel()
......
......@@ -124,7 +124,7 @@ class SettingsFragment : MvvmFragment(), ViewBindingHolder<FragmentSettingsBindi
is SettingsViewModel.Action.ScrollToCrossCountryItem -> {
scrollToCrossCountryItem()
}
is SettingsViewModel.Action.OpenCountryInfoUrl -> {
is SettingsViewModel.Action.OpenCrossCountryInfoUrl -> {
startActivitySafely(Intent(Intent.ACTION_VIEW).setData(Uri.parse(action.url)))
}
}.exhaustive
......
......@@ -202,7 +202,7 @@ class SettingsViewModel @Inject constructor(
linkDisposable = createGotSickAbroadPageUrlUseCase.execute()
.backgroundToMain()
.subscribe(
{ url -> _action.value = Event(Action.OpenCountryInfoUrl(url)) },
{ url -> _action.value = Event(Action.OpenCrossCountryInfoUrl(url)) },
{ error ->
Timber.e(error, "crossCountryInfoLinkClicked")
// NO-OP: This should not happen atm. But for the future we still want to consume this
......@@ -217,6 +217,6 @@ class SettingsViewModel @Inject constructor(
data class ShowPlayServicesUpdateDialog(val isUpdateRequired: Boolean) : Action()
object OpenPlayStoreUrl : Action()
object ScrollToCrossCountryItem : Action()
data class OpenCountryInfoUrl(val url: String) : Action()
data class OpenCrossCountryInfoUrl(val url: String) : Action()
}
}
......@@ -30,14 +30,14 @@ object TehikdevEnvironment : Environment {
ru = "https://hoia.me/ru?source=app"
)
override val contactInfoPageUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/close-contact?source=app",
en = "https://www.hoia.me/close-contact/en?source=app",
ru = "https://www.hoia.me/close-contact/ru?source=app"
et = "ttps://www.hoia.me/close-contact?source=app",
en = "https://www.hoia.me/en/close-contact?source=app",
ru = "https://www.hoia.me/ru/close-contact?source=app"
)
override val privacyPolicyUrl: LocalizedUrl = LocalizedUrl(
et = "https://hoia.me/privacy?source=app",
en = "https://hoia.me/en/privacy?source=app",
ru = "https://hoia.me/ru/privacy?source=app"
et = "https://www.hoia.me/privacy?source=app",
en = "https://www.hoia.me/en/privacy?source=app",
ru = "https://www.hoia.me/ru/privacy?source=app"
)
override val covidInstructionsUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.terviseamet.ee/et/patsiendi-koduse-ravi-juhend-covid-19-korral",
......@@ -49,15 +49,15 @@ object TehikdevEnvironment : Environment {
en = "https://www.terviseamet.ee/et/lahikontaktse-juhis#ENG",
ru = "https://www.terviseamet.ee/et/lahikontaktse-juhis#RUS"
)
override val gotSickAbroadUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/hoia-euroopas?source=app",
en = "https://www.hoia.me/en/hoia-in-europe?source=app",
ru = "https://hoia.me/ru/hoia-v-yevrope?source=app"
)
override val appLogEnabled: Boolean = BuildConfig.DEBUG
override val crashAppOnUndeliverableException: Boolean = BuildConfig.DEBUG
override val showLongVersionInfo: Boolean = true
override val allowInfectionConfirmationStartWithoutGAEN: Boolean = BuildConfig.DEBUG
override val federationGatewayUsageForDP3TBackend: FederationGatewayUsageForDP3TBackend = FederationGatewayUsageForDP3TBackend.Enabled
override val federationGatewayUsageForPatientPortal: FederationGatewayUsageForPatientPortal = FederationGatewayUsageForPatientPortal.Enabled
override val gotSickAbroadUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/got-sick-abroad?source=app",
en = "https://www.hoia.me/got-sick-abroad/en?source=app",
ru = "https://www.hoia.me/got-sick-abroad/ru?source=app"
)
}
......@@ -36,14 +36,14 @@ object TehikprodEnvironment : Environment {
ru = "https://hoia.me/ru?source=app"
)
override val contactInfoPageUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/close-contact?source=app",
en = "https://www.hoia.me/close-contact/en?source=app",
ru = "https://www.hoia.me/close-contact/ru?source=app"
et = "ttps://www.hoia.me/close-contact?source=app",
en = "https://www.hoia.me/en/close-contact?source=app",
ru = "https://www.hoia.me/ru/close-contact?source=app"
)
override val privacyPolicyUrl: LocalizedUrl = LocalizedUrl(
et = "https://hoia.me/privacy?source=app",
en = "https://hoia.me/en/privacy?source=app",
ru = "https://hoia.me/ru/privacy?source=app"
et = "https://www.hoia.me/privacy?source=app",
en = "https://www.hoia.me/en/privacy?source=app",
ru = "https://www.hoia.me/ru/privacy?source=app"
)
override val covidInstructionsUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.terviseamet.ee/et/patsiendi-koduse-ravi-juhend-covid-19-korral",
......@@ -55,15 +55,15 @@ object TehikprodEnvironment : Environment {
en = "https://www.terviseamet.ee/et/lahikontaktse-juhis#ENG",
ru = "https://www.terviseamet.ee/et/lahikontaktse-juhis#RUS"
)
override val gotSickAbroadUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/hoia-euroopas?source=app",
en = "https://www.hoia.me/en/hoia-in-europe?source=app",
ru = "https://hoia.me/ru/hoia-v-yevrope?source=app"
)
override val appLogEnabled: Boolean = BuildConfig.DEBUG // Only for the debug variant
override val crashAppOnUndeliverableException: Boolean = false
override val showLongVersionInfo: Boolean = false // For Production we only show the short info
override val allowInfectionConfirmationStartWithoutGAEN: Boolean = BuildConfig.DEBUG
override val federationGatewayUsageForDP3TBackend: FederationGatewayUsageForDP3TBackend = FederationGatewayUsageForDP3TBackend.Enabled
override val federationGatewayUsageForPatientPortal: FederationGatewayUsageForPatientPortal = FederationGatewayUsageForPatientPortal.Enabled
override val gotSickAbroadUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/got-sick-abroad?source=app",
en = "https://www.hoia.me/got-sick-abroad/en?source=app",
ru = "https://www.hoia.me/got-sick-abroad/ru?source=app"
)
}
......@@ -30,14 +30,14 @@ object TehiktestEnvironment : Environment {
ru = "https://hoia.me/ru?source=app"
)
override val contactInfoPageUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/close-contact?source=app",
en = "https://www.hoia.me/close-contact/en?source=app",
ru = "https://www.hoia.me/close-contact/ru?source=app"
et = "ttps://www.hoia.me/close-contact?source=app",
en = "https://www.hoia.me/en/close-contact?source=app",
ru = "https://www.hoia.me/ru/close-contact?source=app"
)
override val privacyPolicyUrl: LocalizedUrl = LocalizedUrl(
et = "https://hoia.me/privacy?source=app",
en = "https://hoia.me/en/privacy?source=app",
ru = "https://hoia.me/ru/privacy?source=app"
et = "https://www.hoia.me/privacy?source=app",
en = "https://www.hoia.me/en/privacy?source=app",
ru = "https://www.hoia.me/ru/privacy?source=app"
)
override val covidInstructionsUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.terviseamet.ee/et/patsiendi-koduse-ravi-juhend-covid-19-korral",
......@@ -49,15 +49,15 @@ object TehiktestEnvironment : Environment {
en = "https://www.terviseamet.ee/et/lahikontaktse-juhis#ENG",
ru = "https://www.terviseamet.ee/et/lahikontaktse-juhis#RUS"
)
override val gotSickAbroadUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/hoia-euroopas?source=app",
en = "https://www.hoia.me/en/hoia-in-europe?source=app",
ru = "https://hoia.me/ru/hoia-v-yevrope?source=app"
)
override val appLogEnabled: Boolean = BuildConfig.DEBUG
override val crashAppOnUndeliverableException: Boolean = BuildConfig.DEBUG
override val showLongVersionInfo: Boolean = true
override val allowInfectionConfirmationStartWithoutGAEN: Boolean = BuildConfig.DEBUG
override val federationGatewayUsageForDP3TBackend: FederationGatewayUsageForDP3TBackend = FederationGatewayUsageForDP3TBackend.Enabled
override val federationGatewayUsageForPatientPortal: FederationGatewayUsageForPatientPortal = FederationGatewayUsageForPatientPortal.Enabled
override val gotSickAbroadUrl: LocalizedUrl = LocalizedUrl(
et = "https://www.hoia.me/got-sick-abroad?source=app",
en = "https://www.hoia.me/got-sick-abroad/en?source=app",
ru = "https://www.hoia.me/got-sick-abroad/ru?source=app"
)
}
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