Skip to content

Commit

Permalink
Merge pull request #411 from SwissCovid/develop
Browse files Browse the repository at this point in the history
Version 2.3.0
  • Loading branch information
gallmann-ubique authored Dec 3, 2021
2 parents 171040b + 61ff66f commit 537a521
Show file tree
Hide file tree
Showing 24 changed files with 183 additions and 167 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ android {
applicationId "ch.admin.bag.dp3t"
minSdkVersion 23
targetSdkVersion 30
versionCode 22000
versionName "2.2.0"
versionCode 23000
versionName "2.3.0"
resConfigs "en", "fr", "de", "it", "pt", "es", "sq", "bs", "hr", "sr", "rm", "tr", "ti"

buildConfigField "long", "BUILD_TIME", readPropertyWithDefault('buildTimestamp', System.currentTimeMillis()) + 'L'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class ConfigWorker(context: Context, workerParams: WorkerParameters) : Coroutine
secureStorage.setTestInformationUrls(config.testInformationUrls)

secureStorage.setVaccinationBookingInfo(config.vaccinationBookingInfo)
secureStorage.setVaccinationBookingCantons(config.vaccinationBookingCantons)
secureStorage.setShowVaccinationInfo(config.isShowVaccinationInfo)

secureStorage.testLocations = config.testLocations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public class ConfigResponseModel {
private Map<String, String> testInformationUrls;
private boolean checkInUpdateNotificationEnabled;

private VaccinationBookingCantonCollection vaccinationBookingCantons;
private VaccinationBookingInfoCollection vaccinationBookingInfo;
private boolean showVaccinationInfo;

Expand Down Expand Up @@ -64,10 +63,6 @@ public boolean isCheckInUpdateNotificationEnabled() {
return checkInUpdateNotificationEnabled;
}

public VaccinationBookingCantonCollection getVaccinationBookingCantons() {
return vaccinationBookingCantons;
}

public VaccinationBookingInfoCollection getVaccinationBookingInfo() {
return vaccinationBookingInfo;
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ package ch.admin.bag.dp3t.networking.models
data class VaccinationBookingInfoModel(
val title: String,
val text: String,
val info: String
val info: String,
val impfcheckTitle: String?,
val impfcheckText: String?,
val impfcheckButton: String?,
val impfcheckUrl: String?
)
18 changes: 0 additions & 18 deletions app/src/main/java/ch/admin/bag/dp3t/storage/SecureStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import ch.admin.bag.dp3t.networking.models.VaccinationBookingCantonModel;
import ch.admin.bag.dp3t.networking.models.VaccinationBookingInfoModel;
import ch.admin.bag.dp3t.checkin.models.CheckInState;
import ch.admin.bag.dp3t.networking.models.*;

Expand Down Expand Up @@ -68,7 +66,6 @@ public class SecureStorage {
private static final String KEY_T_DUMMY = "KEY_T_DUMMY";
private static final String KEY_WHAT_TO_DO_POSITIVE_TEST_TEXTS = "whatToDoPositiveTestTexts";
private static final String KEY_VACCINATION_BOOKING_INFO = "vaccinationBookingInfo";
private static final String KEY_VACCINATION_CANTONS = "vaccinationCantons";
private static final String KEY_SHOW_VACCINATION_INFO = "showVaccinationInfo";
private static final String KEY_TEST_LOCATIONS = "test_locations";
private static final String KEY_INTEROP_COUNTRIES = "interop_countries";
Expand Down Expand Up @@ -338,21 +335,6 @@ public VaccinationBookingInfoModel getVaccinationBookingInfo(String language) {
return map.get(language);
}

public void setVaccinationBookingCantons(VaccinationBookingCantonCollection vaccinationBookingCantonCollection) {
prefs.edit().putString(KEY_VACCINATION_CANTONS, gson.toJson(vaccinationBookingCantonCollection)).apply();
}

public List<VaccinationBookingCantonModel> getVaccinationBookingCantons(String language) {
HashMap<String, List<VaccinationBookingCantonModel>> map =
gson.fromJson(prefs.getString(KEY_VACCINATION_CANTONS, "null"),
VaccinationBookingCantonCollection.class);
if (map == null) {
return null;
}
return map.get(language);
}


public void setShowVaccinationInfo(boolean showVaccinationInfo) {
prefs.edit().putBoolean(KEY_SHOW_VACCINATION_INFO, showVaccinationInfo).apply();
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import ch.admin.bag.dp3t.networking.models.VaccinationBookingCantonModel
import ch.admin.bag.dp3t.networking.models.VaccinationBookingInfoModel
import ch.admin.bag.dp3t.R
import ch.admin.bag.dp3t.databinding.FragmentVaccinationAppointmentBinding
import ch.admin.bag.dp3t.networking.models.VaccinationBookingInfoModel
import ch.admin.bag.dp3t.storage.SecureStorage
import ch.admin.bag.dp3t.util.UrlUtil

Expand All @@ -32,8 +31,6 @@ class VaccinationAppointmentFragment : Fragment() {
private var _binding: FragmentVaccinationAppointmentBinding? = null
private val binding get() = _binding!!

private val adapter = VaccinationAppointmentCantonAdapter(this::onCantonClicked)

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
_binding = FragmentVaccinationAppointmentBinding.inflate(inflater, container, false)
return binding.root
Expand All @@ -47,27 +44,34 @@ class VaccinationAppointmentFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.toolbar.setNavigationOnClickListener { parentFragmentManager.popBackStack() }
setupCantonList()

setupMoreInformationButton()

val secureStorage = SecureStorage.getInstance(context)
secureStorage.getVaccinationBookingInfo(requireContext().getString(R.string.language_key))?.let {
setupVaccinationBookingInfo(it)
}
adapter.setItems(
secureStorage.getVaccinationBookingCantons(requireContext().getString(R.string.language_key)) ?: emptyList()
)

}

private fun setupCantonList() {
binding.vaccinationAppointmentCantonList.adapter = adapter
}

private fun setupVaccinationBookingInfo(vaccinationBookingInfo: VaccinationBookingInfoModel) {
binding.vaccinationBookingTitle.text = vaccinationBookingInfo.title
binding.vaccinationBookingText.text = vaccinationBookingInfo.text
binding.vaccinationBookingInfo.text = vaccinationBookingInfo.info

if (vaccinationBookingInfo.impfcheckTitle != null && vaccinationBookingInfo.impfcheckText != null && vaccinationBookingInfo.impfcheckButton != null && vaccinationBookingInfo.impfcheckUrl != null) {
binding.impfcheckTitle.text = vaccinationBookingInfo.impfcheckTitle
binding.impfcheckInfoText.text = vaccinationBookingInfo.impfcheckText
binding.impfcheckAction.text = vaccinationBookingInfo.impfcheckButton
binding.impfcheckAction.setOnClickListener {
UrlUtil.openUrl(it.context, vaccinationBookingInfo.impfcheckUrl)
}
} else {
binding.impfcheckTitle.visibility = View.GONE
binding.impfcheckInfoText.visibility = View.GONE
binding.impfcheckAction.visibility = View.GONE
}
}

private fun setupMoreInformationButton() {
Expand All @@ -77,8 +81,4 @@ class VaccinationAppointmentFragment : Fragment() {
}
}

private fun onCantonClicked(canton: VaccinationBookingCantonModel) {
UrlUtil.openUrl(requireContext(), canton.linkUrl)
}

}
51 changes: 28 additions & 23 deletions app/src/main/res/layout/fragment_vaccination_appointment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<LinearLayout 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:background="@color/grey_light"
Expand Down Expand Up @@ -73,6 +72,34 @@
android:layout_marginBottom="@dimen/spacing_larger"
android:text="@string/vaccination_booking_info_text" />

<TextView
android:id="@+id/impfcheck_title"
style="@style/NextStep.Text.Bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/spacing_larger"
android:layout_marginTop="@dimen/spacing_small"
android:layout_marginBottom="@dimen/spacing_small"
android:gravity="left"
android:text="@string/vaccination_impf_check_title" />

<TextView
android:id="@+id/impfcheck_info_text"
style="@style/NextStep.Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/spacing_larger"
android:text="@string/vaccination_impf_check_info_text" />

<Button
android:id="@+id/impfcheck_action"
style="@style/NextStep.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_larger"
android:drawableRight="@drawable/ic_launch"
android:text="@string/vaccination_impf_check_action" />

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -120,28 +147,6 @@

</androidx.constraintlayout.widget.ConstraintLayout>

<TextView
style="@style/NextStep.Text.Bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/spacing_larger"
android:layout_marginTop="@dimen/spacing_very_large"
android:layout_marginBottom="@dimen/spacing_small"
android:gravity="left"
android:text="@string/vaccination_canton_title" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/vaccination_appointment_canton_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_small"
android:nestedScrollingEnabled="true"
android:overScrollMode="never"
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="5"
tools:listitem="@layout/item_vaccination_appointment_canton" />

</LinearLayout>

</androidx.cardview.widget.CardView>
Expand Down
12 changes: 11 additions & 1 deletion common/src/main/res/values-bs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,7 @@ Mnoga mesta nude i vakcinaciju bez zakazanog termina"</string>
<string name="vaccination_info_homescreen_title">"Još niste vakcinisani?"</string>

<!-- Homescreen Impfhinweis: Titel fett -->
<string name="vaccination_info_homescreen_title_bold">"Zakažite sada termin "</string>
<string name="vaccination_info_homescreen_title_bold">"Zakažite sada termin"</string>

<!-- Impfhinweis Detail: URL unten Weitere Informationen -->
<string name="vaccination_booking_info_url">"https://bag-coronavirus.ch/impfung/"</string>
Expand All @@ -1968,4 +1968,14 @@ Mnoga mesta nude i vakcinaciju bez zakazanog termina"</string>

<!-- Impf-Hinweis Screen: Kanton Titel -->
<string name="vaccination_canton_title">"Izaberite svoj kanton"</string>

<!-- vaccination booking screen info about Impf-Check (impf-check.ch) -->
<string name="vaccination_impf_check_info_text">"Provera vakcinisanja protiv Covida-19 pruža informacije o prvim i booster dozama i navigira Vas do odgovarajućeg kontakt mesta u Vašem kantonu."</string>

<!-- button title for link to impf-check.ch -->
<string name="vaccination_impf_check_action">"Na proveru vakcinisanja"</string>

<!-- URL to ImpfCheck -->
<string name="vaccination_impf_check_url">"https://covid19.impf-check.ch/"</string>
<string name="vaccination_impf_check_title">"Zakažite sada termin"</string>
</resources>
10 changes: 10 additions & 0 deletions common/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2054,4 +2054,14 @@ Viele Orte bieten auch Walk-in-Impfungen ohne Termine an."</string>

<!-- Impf-Hinweis Screen: Kanton Titel -->
<string name="vaccination_canton_title">"Wählen Sie Ihren Kanton"</string>

<!-- vaccination booking screen info about Impf-Check (impf-check.ch) -->
<string name="vaccination_impf_check_info_text">"Der Covid-19 Impf-Check gibt Auskunft über Erst- sowie Auffrischimpfungen und führt Sie zur entsprechenden Anlaufstelle in Ihrem Kanton."</string>

<!-- button title for link to impf-check.ch -->
<string name="vaccination_impf_check_action">"Zum Impf-Check"</string>

<!-- URL to ImpfCheck -->
<string name="vaccination_impf_check_url">"https://covid19.impf-check.ch/"</string>
<string name="vaccination_impf_check_title">"Jetzt Termin buchen"</string>
</resources>
10 changes: 10 additions & 0 deletions common/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1960,4 +1960,14 @@ Muchos centros ofrecen la posibllidad de vacunarse sin cita previa."</string>

<!-- Impf-Hinweis Screen: Kanton Titel -->
<string name="vaccination_canton_title">"Seleccione su cantón"</string>

<!-- vaccination booking screen info about Impf-Check (impf-check.ch) -->
<string name="vaccination_impf_check_info_text">"El Vac-Check Covid-19 le informa sobre la vacunación inicial y la vacuna de refuerzo, y le indica cuál es la oficina competente en su cantón."</string>

<!-- button title for link to impf-check.ch -->
<string name="vaccination_impf_check_action">"Ir al Vac-Check"</string>

<!-- URL to ImpfCheck -->
<string name="vaccination_impf_check_url">"https://covid19.impf-check.ch/"</string>
<string name="vaccination_impf_check_title">"Concierte su cita ahora"</string>
</resources>
Loading

0 comments on commit 537a521

Please sign in to comment.