-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #407 from SwissCovid/feature/vaccination-appointment
add vaccination appointment screen
- Loading branch information
Showing
30 changed files
with
2,192 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...src/main/java/ch/admin/bag/dp3t/networking/models/VaccinationBookingCantonCollection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) 2021 Ubique Innovation AG <https://www.ubique.ch> | ||
* | ||
* 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/. | ||
* | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package ch.admin.bag.dp3t.networking.models; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
|
||
import ch.admin.bag.covidcertificate.common.config.VaccinationBookingCantonModel; | ||
|
||
public class VaccinationBookingCantonCollection extends HashMap<String, List<VaccinationBookingCantonModel>> { | ||
} |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/ch/admin/bag/dp3t/networking/models/VaccinationBookingCantonModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright (c) 2021 Ubique Innovation AG <https://www.ubique.ch> | ||
* | ||
* 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/. | ||
* | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
package ch.admin.bag.covidcertificate.common.config | ||
|
||
data class VaccinationBookingCantonModel( | ||
val name: String, | ||
val linkUrl: String | ||
) |
18 changes: 18 additions & 0 deletions
18
app/src/main/java/ch/admin/bag/dp3t/networking/models/VaccinationBookingInfoCollection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) 2021 Ubique Innovation AG <https://www.ubique.ch> | ||
* | ||
* 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/. | ||
* | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package ch.admin.bag.dp3t.networking.models; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import ch.admin.bag.covidcertificate.common.config.VaccinationBookingInfoModel; | ||
|
||
public class VaccinationBookingInfoCollection extends HashMap<String, VaccinationBookingInfoModel> { | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/ch/admin/bag/dp3t/networking/models/VaccinationBookingInfoModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (c) 2021 Ubique Innovation AG <https://www.ubique.ch> | ||
* | ||
* 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/. | ||
* | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
package ch.admin.bag.covidcertificate.common.config | ||
|
||
data class VaccinationBookingInfoModel( | ||
val title: String, | ||
val text: String, | ||
val info: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
app/src/main/java/ch/admin/bag/dp3t/vaccination/VaccinationAppointmentCantonAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) 2021 Ubique Innovation AG <https://www.ubique.ch> | ||
* | ||
* 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/. | ||
* | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
package ch.admin.bag.covidcertificate.wallet.vaccination.appointment | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import ch.admin.bag.covidcertificate.common.config.VaccinationBookingCantonModel | ||
import ch.admin.bag.dp3t.databinding.ItemVaccinationAppointmentCantonBinding | ||
|
||
class VaccinationAppointmentCantonAdapter( | ||
private val onCantonClicked: (VaccinationBookingCantonModel) -> Unit | ||
) : RecyclerView.Adapter<VaccinationAppointmentCantonViewHolder>() { | ||
|
||
private val items = mutableListOf<VaccinationBookingCantonModel>() | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VaccinationAppointmentCantonViewHolder { | ||
val binding = ItemVaccinationAppointmentCantonBinding.inflate(LayoutInflater.from(parent.context), parent, false) | ||
return VaccinationAppointmentCantonViewHolder(binding) | ||
} | ||
|
||
override fun onBindViewHolder(holder: VaccinationAppointmentCantonViewHolder, position: Int) { | ||
holder.bind(items[position], onCantonClicked) | ||
} | ||
|
||
override fun getItemCount() = items.size | ||
|
||
fun setItems(newItems: List<VaccinationBookingCantonModel>) { | ||
items.clear() | ||
items.addAll(newItems) | ||
notifyDataSetChanged() | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
app/src/main/java/ch/admin/bag/dp3t/vaccination/VaccinationAppointmentCantonViewHolder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) 2021 Ubique Innovation AG <https://www.ubique.ch> | ||
* | ||
* 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/. | ||
* | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
package ch.admin.bag.covidcertificate.wallet.vaccination.appointment | ||
|
||
import androidx.recyclerview.widget.RecyclerView | ||
import ch.admin.bag.covidcertificate.common.config.VaccinationBookingCantonModel | ||
import ch.admin.bag.dp3t.databinding.ItemVaccinationAppointmentCantonBinding | ||
|
||
class VaccinationAppointmentCantonViewHolder( | ||
private val binding: ItemVaccinationAppointmentCantonBinding | ||
) : RecyclerView.ViewHolder(binding.root) { | ||
|
||
fun bind(canton: VaccinationBookingCantonModel, onCantonClicked: (VaccinationBookingCantonModel) -> Unit) { | ||
binding.root.setOnClickListener { onCantonClicked.invoke(canton) } | ||
binding.cantonName.text = canton.name | ||
} | ||
|
||
} |
Oops, something went wrong.