Compare commits
No commits in common. "master" and "ms/issue-14/adding-pickers" have entirely different histories.
master
...
ms/issue-1
@ -4,19 +4,19 @@ apply plugin: 'kotlin-kapt'
|
|||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-android-extensions'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 30
|
compileSdkVersion 29
|
||||||
buildToolsVersion "29.0.3"
|
buildToolsVersion "29.0.3"
|
||||||
|
|
||||||
buildFeatures {
|
dataBinding {
|
||||||
dataBinding true
|
enabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "fr.sanchezm.attestationsCovid19"
|
applicationId "fr.sanchezm.attestationsCovid19"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 29
|
||||||
versionCode 13
|
versionCode 7
|
||||||
versionName "2.2.0"
|
versionName "1.0.5"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@ -74,18 +74,24 @@ dependencies {
|
|||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
// Android X
|
// Android X
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||||
implementation 'androidx.core:core-ktx:1.3.2'
|
implementation 'androidx.core:core-ktx:1.2.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
|
||||||
|
|
||||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.2'
|
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2'
|
||||||
implementation 'androidx.navigation:navigation-ui-ktx:2.3.2'
|
implementation 'androidx.navigation:navigation-fragment:2.2.2'
|
||||||
|
implementation 'androidx.navigation:navigation-ui-ktx:2.2.2'
|
||||||
|
implementation 'androidx.navigation:navigation-ui:2.2.2'
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
implementation 'com.google.android.material:material:1.2.1'
|
implementation 'com.google.android.material:material:1.1.0'
|
||||||
|
|
||||||
|
// Room
|
||||||
|
// implementation 'androidx.room:room-runtime:2.2.5'
|
||||||
|
// kapt 'androidx.room:room-compiler:2.2.5'
|
||||||
|
|
||||||
// PDF
|
// PDF
|
||||||
implementation 'com.tom_roush:pdfbox-android:1.8.10.1'
|
implementation 'com.tom_roush:pdfbox-android:1.8.10.1'
|
||||||
@ -104,6 +110,6 @@ dependencies {
|
|||||||
|
|
||||||
// Test
|
// Test
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
@ -28,3 +28,40 @@ class MyDatabase private constructor(private val savePath: String, private val f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.room.Database
|
||||||
|
import androidx.room.Room
|
||||||
|
import androidx.room.RoomDatabase
|
||||||
|
import fr.sanchezm.attestationsCovid19.data.db.dao.AttestationDao
|
||||||
|
import fr.sanchezm.attestationsCovid19.data.db.dao.ProfileDao
|
||||||
|
import fr.sanchezm.attestationsCovid19.data.db.entity.Profile
|
||||||
|
|
||||||
|
@Database(
|
||||||
|
entities = [Profile::class],
|
||||||
|
version = 1
|
||||||
|
)
|
||||||
|
abstract class MyDatabase private constructor() : RoomDatabase() {
|
||||||
|
|
||||||
|
abstract fun profileDao(): ProfileDao
|
||||||
|
abstract fun attestationDao(): AttestationDao
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@Volatile
|
||||||
|
private var instance: MyDatabase? = null
|
||||||
|
private val LOCK = Any()
|
||||||
|
|
||||||
|
operator fun invoke(context: Context) = instance ?: synchronized(LOCK) {
|
||||||
|
instance ?: buildDatabase(context).also { instance = it }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun buildDatabase(context: Context) =
|
||||||
|
Room.databaseBuilder(
|
||||||
|
context.applicationContext,
|
||||||
|
MyDatabase::class.java, "data.db"
|
||||||
|
)
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
@ -14,7 +14,7 @@ data class Attestation(
|
|||||||
val reasons: List<Int>
|
val reasons: List<Int>
|
||||||
) {
|
) {
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "Cree le: ${getDate(createAt)};\n$profile;\nSortie: ${getExitDateFormatted()};\nMotifs: ${getMotifsText()}"
|
return "Cree le: ${getDate(createAt)}; $profile; Sortie: ${getExitDateFormatted()}; Motifs: ${getMotifsText()}"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getNameFormatted(): String = "${profile.firstName} ${profile.lastName}"
|
fun getNameFormatted(): String = "${profile.firstName} ${profile.lastName}"
|
||||||
@ -28,22 +28,21 @@ data class Attestation(
|
|||||||
private fun getMotifsText(): String {
|
private fun getMotifsText(): String {
|
||||||
val motifs = StringBuilder()
|
val motifs = StringBuilder()
|
||||||
|
|
||||||
reasons.forEach { motifs.append(getMotifText(it), ", ") }
|
reasons.forEach { motifs.append(getMotifText(it), "-") }
|
||||||
return motifs.toString().dropLast(2)
|
return motifs.toString().dropLast(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getDate(dateTime: Long): String = SimpleDateFormat(PATTERN, Locale.FRANCE).format(Date(dateTime))
|
private fun getDate(dateTime: Long): String = SimpleDateFormat(PATTERN, Locale.FRANCE).format(Date(dateTime))
|
||||||
|
|
||||||
fun getMotifText(i: Int): String {
|
private fun getMotifText(i: Int): String {
|
||||||
return when (i) {
|
return when (i) {
|
||||||
1 -> "travail"
|
1 -> "travail"
|
||||||
2 -> "sante"
|
2 -> "courses"
|
||||||
3 -> "famille"
|
3 -> "sante"
|
||||||
4 -> "handicap"
|
4 -> "famille"
|
||||||
5 -> "convocation"
|
5 -> "sport"
|
||||||
6 -> "missions"
|
6 -> "judiciare"
|
||||||
7 -> "transits"
|
7 -> "missions"
|
||||||
8 -> "animaux"
|
|
||||||
else -> "Error $i not found"
|
else -> "Error $i not found"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,6 @@ data class Profile(
|
|||||||
// var id: Int = CURRENT_PROFILE_ID
|
// var id: Int = CURRENT_PROFILE_ID
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "Nom: $lastName;\nPrenom: $firstName;\nNaissance: $birthday a $birthPlace;\nAdresse: $address $postalCode $city"
|
return "Nom: $lastName; Prenom: $firstName; Naissance: $birthday a $birthPlace; Adresse: $address $postalCode $city"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -60,7 +60,6 @@ class AddViewModel(
|
|||||||
val reason5 = MutableLiveData(false)
|
val reason5 = MutableLiveData(false)
|
||||||
val reason6 = MutableLiveData(false)
|
val reason6 = MutableLiveData(false)
|
||||||
val reason7 = MutableLiveData(false)
|
val reason7 = MutableLiveData(false)
|
||||||
val reason8 = MutableLiveData(false)
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
private val datePattern = "dd/MM/yyyy"
|
private val datePattern = "dd/MM/yyyy"
|
||||||
@ -95,7 +94,7 @@ class AddViewModel(
|
|||||||
|
|
||||||
val dpd = DatePickerDialog(
|
val dpd = DatePickerDialog(
|
||||||
app,
|
app,
|
||||||
{ _, yearPicked, monthOfYear, dayOfMonth ->
|
DatePickerDialog.OnDateSetListener { _, yearPicked, monthOfYear, dayOfMonth ->
|
||||||
birthday.value =
|
birthday.value =
|
||||||
"${getFormattedDayOrMonth(dayOfMonth)}/${getFormattedDayOrMonth(monthOfYear + 1)}/$yearPicked"
|
"${getFormattedDayOrMonth(dayOfMonth)}/${getFormattedDayOrMonth(monthOfYear + 1)}/$yearPicked"
|
||||||
},
|
},
|
||||||
@ -205,7 +204,6 @@ class AddViewModel(
|
|||||||
if (reason5.value!!) reasons.add(5)
|
if (reason5.value!!) reasons.add(5)
|
||||||
if (reason6.value!!) reasons.add(6)
|
if (reason6.value!!) reasons.add(6)
|
||||||
if (reason7.value!!) reasons.add(7)
|
if (reason7.value!!) reasons.add(7)
|
||||||
if (reason8.value!!) reasons.add(8)
|
|
||||||
|
|
||||||
return reasons
|
return reasons
|
||||||
}
|
}
|
||||||
@ -231,7 +229,6 @@ class AddViewModel(
|
|||||||
|| reason5.value!!
|
|| reason5.value!!
|
||||||
|| reason6.value!!
|
|| reason6.value!!
|
||||||
|| reason7.value!!
|
|| reason7.value!!
|
||||||
|| reason8.value!!
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getFormattedDayOrMonth(date: Int): String {
|
private fun getFormattedDayOrMonth(date: Int): String {
|
||||||
|
@ -20,7 +20,6 @@ class InfoFragment : Fragment() {
|
|||||||
): View? {
|
): View? {
|
||||||
val root = inflater.inflate(R.layout.fragment_info, container, false)
|
val root = inflater.inflate(R.layout.fragment_info, container, false)
|
||||||
|
|
||||||
root.explication_4.movementMethod = LinkMovementMethod.getInstance()
|
|
||||||
root.credits_1.movementMethod = LinkMovementMethod.getInstance()
|
root.credits_1.movementMethod = LinkMovementMethod.getInstance()
|
||||||
root.credits_2.movementMethod = LinkMovementMethod.getInstance()
|
root.credits_2.movementMethod = LinkMovementMethod.getInstance()
|
||||||
root.credits_3.movementMethod = LinkMovementMethod.getInstance()
|
root.credits_3.movementMethod = LinkMovementMethod.getInstance()
|
||||||
|
@ -21,8 +21,8 @@ class PdfUtils private constructor(
|
|||||||
private val path: String
|
private val path: String
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// private val checkboxListNames = ArrayList<String>()
|
private val checkboxListNames = ArrayList<String>()
|
||||||
// private val font = PDType1Font.HELVETICA
|
private val font = PDType1Font.HELVETICA
|
||||||
|
|
||||||
fun fillForm(attestation: Attestation, callback: (Boolean) -> Unit) {
|
fun fillForm(attestation: Attestation, callback: (Boolean) -> Unit) {
|
||||||
checkFolder()
|
checkFolder()
|
||||||
@ -54,7 +54,7 @@ class PdfUtils private constructor(
|
|||||||
|
|
||||||
private fun addPageWithQrCode(document: PDDocument, attestation: Attestation) {
|
private fun addPageWithQrCode(document: PDDocument, attestation: Attestation) {
|
||||||
val size = 360
|
val size = 360
|
||||||
val margin = 25f
|
val margin = 40f
|
||||||
|
|
||||||
// Add QRCode on the first page
|
// Add QRCode on the first page
|
||||||
val page1: PDPage = document.pages.first()
|
val page1: PDPage = document.pages.first()
|
||||||
@ -64,8 +64,9 @@ class PdfUtils private constructor(
|
|||||||
page1,
|
page1,
|
||||||
attestation,
|
attestation,
|
||||||
size / 3,
|
size / 3,
|
||||||
page1.mediaBox.upperRightX - margin - size / 3,
|
page1.mediaBox.upperRightX - margin - size / 3 - 30,
|
||||||
25f
|
141f,
|
||||||
|
true
|
||||||
)
|
)
|
||||||
|
|
||||||
// Add QRCode on a new page
|
// Add QRCode on a new page
|
||||||
@ -82,7 +83,8 @@ class PdfUtils private constructor(
|
|||||||
attestation: Attestation,
|
attestation: Attestation,
|
||||||
size: Int,
|
size: Int,
|
||||||
x: Float,
|
x: Float,
|
||||||
y: Float
|
y: Float,
|
||||||
|
addText: Boolean = false
|
||||||
) {
|
) {
|
||||||
|
|
||||||
val contentStream = PDPageContentStream(document, page, true, false)
|
val contentStream = PDPageContentStream(document, page, true, false)
|
||||||
@ -90,7 +92,21 @@ class PdfUtils private constructor(
|
|||||||
LosslessFactory.createFromImage(document, QRCodeUtils.getQrCode(attestation, size))
|
LosslessFactory.createFromImage(document, QRCodeUtils.getQrCode(attestation, size))
|
||||||
|
|
||||||
contentStream.drawImage(alphaXimage, x, y)
|
contentStream.drawImage(alphaXimage, x, y)
|
||||||
|
if (addText) {
|
||||||
|
contentStream.beginText()
|
||||||
|
contentStream.setFont(font, 7f)
|
||||||
|
contentStream.newLineAtOffset(page.mediaBox.upperRightX - size - 20, 145f)
|
||||||
|
contentStream.showText("Date de création:")
|
||||||
|
contentStream.endText()
|
||||||
|
|
||||||
|
contentStream.beginText()
|
||||||
|
contentStream.setFont(font, 7f)
|
||||||
|
contentStream.newLineAtOffset(page.mediaBox.upperRightX - size - 27, 138f)
|
||||||
|
contentStream.showText(attestation.getCreatedAtFormattedDate())
|
||||||
|
contentStream.endText()
|
||||||
|
}
|
||||||
contentStream.close()
|
contentStream.close()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setFieldsData(acroForm: PDAcroForm, attestation: Attestation): Boolean {
|
private fun setFieldsData(acroForm: PDAcroForm, attestation: Attestation): Boolean {
|
||||||
@ -101,18 +117,21 @@ class PdfUtils private constructor(
|
|||||||
val namesField = acroForm.getField("Nom et prénom") as PDTextField
|
val namesField = acroForm.getField("Nom et prénom") as PDTextField
|
||||||
val birthdayField = acroForm.getField("Date de naissance") as PDTextField
|
val birthdayField = acroForm.getField("Date de naissance") as PDTextField
|
||||||
val birthPlaceField = acroForm.getField("Lieu de naissance") as PDTextField
|
val birthPlaceField = acroForm.getField("Lieu de naissance") as PDTextField
|
||||||
val addressField = acroForm.getField("Adresse") as PDTextField
|
val addressField = acroForm.getField("Adresse actuelle") as PDTextField
|
||||||
val cityField = acroForm.getField("Ville") as PDTextField
|
val cityField = acroForm.getField("Ville") as PDTextField
|
||||||
val dateField = acroForm.getField("Date") as PDTextField
|
val dateField = acroForm.getField("Date") as PDTextField
|
||||||
val exitField = acroForm.getField("Heure") as PDTextField
|
val hourField = acroForm.getField("Heure") as PDTextField
|
||||||
|
val minutesField = acroForm.getField("Minute") as PDTextField
|
||||||
|
// val signatureField = acroForm.getField("Signature") as PDTextField
|
||||||
|
|
||||||
namesField.value = "${profile.firstName} ${profile.lastName}"
|
namesField.value = "${profile.firstName} ${profile.lastName}"
|
||||||
birthdayField.value = profile.birthday
|
birthdayField.value = profile.birthday
|
||||||
birthPlaceField.value = profile.birthPlace
|
birthPlaceField.value = profile.birthPlace
|
||||||
addressField.value = "${profile.address}, ${profile.city} ${profile.postalCode}"
|
addressField.value = "${profile.address} ${profile.postalCode} ${profile.city}"
|
||||||
cityField.value = profile.city
|
cityField.value = profile.city
|
||||||
dateField.value = attestation.exitDate
|
dateField.value = attestation.exitDate
|
||||||
exitField.value = attestation.exitHour.replace('h', ':')
|
hourField.value = attestation.exitHour.split(":")[0]
|
||||||
|
minutesField.value = attestation.exitHour.split(":")[1]
|
||||||
return true
|
return true
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "${e.message}")
|
Log.e(TAG, "${e.message}")
|
||||||
@ -122,7 +141,7 @@ class PdfUtils private constructor(
|
|||||||
|
|
||||||
private fun setCheckboxFields(acroForm: PDAcroForm, attestation: Attestation) {
|
private fun setCheckboxFields(acroForm: PDAcroForm, attestation: Attestation) {
|
||||||
attestation.reasons.forEach {
|
attestation.reasons.forEach {
|
||||||
(acroForm.getField("distinction Motif $it") as PDCheckbox).check()
|
(acroForm.getField(checkboxListNames[it - 1]) as PDCheckbox).check()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,10 +163,20 @@ class PdfUtils private constructor(
|
|||||||
fun getInstance() = instance
|
fun getInstance() = instance
|
||||||
|
|
||||||
fun getInstance(assetManager: AssetManager, path: String) = instance ?: synchronized(LOCK) {
|
fun getInstance(assetManager: AssetManager, path: String) = instance ?: synchronized(LOCK) {
|
||||||
instance ?: PdfUtils(assetManager, path).also { instance = it }
|
instance ?: PdfUtils(assetManager, path).also { instance = it; it.initList() }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getPath(path: String, createAt: Long): String = "$path/$folderPath/$createAt.pdf"
|
fun getPath(path: String, createAt: Long): String = "$path/$folderPath/$createAt.pdf"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun initList() {
|
||||||
|
checkboxListNames.add("Déplacements entre domicile et travail")
|
||||||
|
checkboxListNames.add("Déplacements achats nécéssaires")
|
||||||
|
checkboxListNames.add("Consultations et soins")
|
||||||
|
checkboxListNames.add("Déplacements pour motif familial")
|
||||||
|
checkboxListNames.add("Déplacements brefs (activité physique et animaux)")
|
||||||
|
checkboxListNames.add("Convcation judiciaire ou administrative")
|
||||||
|
checkboxListNames.add("Mission d'intérêt général")
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,10 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:background="@drawable/custom_rectangle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="15dp"
|
android:layout_marginBottom="15dp"
|
||||||
android:background="@drawable/custom_rectangle"
|
|
||||||
android:padding="15dp">
|
android:padding="15dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -13,50 +13,50 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/people_item"
|
android:text="@string/people_item"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/date_item"
|
android:id="@+id/date_item"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="3dp"
|
|
||||||
android:text="@string/date_item"
|
android:text="@string/date_item"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintTop_toBottomOf="@+id/people_item"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/people_item" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/reason_item"
|
android:id="@+id/reason_item"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="3dp"
|
|
||||||
android:text="@string/reason_item"
|
android:text="@string/reason_item"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintTop_toBottomOf="@+id/date_item"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/date_item" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/people_item_data"
|
android:id="@+id/people_item_data"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/date_item_data"
|
android:id="@+id/date_item_data"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="3dp"
|
android:layout_marginTop="3dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toBottomOf="@id/people_item_data"
|
||||||
app:layout_constraintTop_toBottomOf="@id/people_item_data" />
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/reason_item_data"
|
android:id="@+id/reason_item_data"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="3dp"
|
android:layout_marginTop="3dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toBottomOf="@id/date_item_data"
|
||||||
app:layout_constraintTop_toBottomOf="@id/date_item_data" />
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -256,14 +256,6 @@
|
|||||||
android:checked="@={viewModel.reason7}"
|
android:checked="@={viewModel.reason7}"
|
||||||
android:text="@string/reason_7" />
|
android:text="@string/reason_7" />
|
||||||
|
|
||||||
<com.google.android.material.checkbox.MaterialCheckBox
|
|
||||||
android:id="@+id/reason_8"
|
|
||||||
style="@style/MaterialCheckBox"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="@={viewModel.reason8}"
|
|
||||||
android:text="@string/reason_8" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/generate_attestation"
|
android:id="@+id/generate_attestation"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/explication_1"
|
android:id="@+id/explication_1"
|
||||||
android:text="@string/explication_1"
|
android:text="@string/explication_1"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="40dp"
|
||||||
style="@style/TextView"
|
style="@style/TextView"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
<!-- Validator -->
|
<!-- Validator -->
|
||||||
<string name="date_error_message">Votre date doit être au format 01/01/1970</string>
|
<string name="date_error_message">Votre date doit être au format 01/01/1970</string>
|
||||||
|
|
||||||
<string name="error_cannot_create_attestation">Erreur lors de la génération de l\'attestation, tout les champs ne sont pas complétés</string>
|
<string name="error_cannot_create_attestation">Erreur lors de la génération de l\'attestation, tout les champs ne sont pas compléter</string>
|
||||||
<string name="error_failed_create_pdf">Erreur lors de la génération de l\'attestion, veuillez vérifiez vos champs ou contacter le développeur.</string>
|
<string name="error_failed_create_pdf">Erreur lors de la génération de l\'attestion, veuillez vérifiez vos champs ou contacter le développeur.</string>
|
||||||
</resources>
|
</resources>
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<!-- Attestation Fragment -->
|
<!-- Attestation Fragment -->
|
||||||
<string name="attestation_title">@string/app_name</string>
|
<string name="attestation_title">@string/app_name</string>
|
||||||
<string name="attestation_subtitle">Restons chez nous pour nous protéger et protéger les autres</string>
|
<string name="attestation_subtitle">#RestonsChezNous</string>
|
||||||
<string name="attestation_generated">Attestation générée</string>
|
<string name="attestation_generated">Attestation générée</string>
|
||||||
<string name="no_attestation">Aucune attestation, veuillez en générer une.</string>
|
<string name="no_attestation">Aucune attestation, veuillez en générer une.</string>
|
||||||
|
|
||||||
@ -18,32 +18,31 @@
|
|||||||
<string name="address">Adresse</string>
|
<string name="address">Adresse</string>
|
||||||
<string name="city">Ville</string>
|
<string name="city">Ville</string>
|
||||||
<string name="postal_code">Code Postal</string>
|
<string name="postal_code">Code Postal</string>
|
||||||
|
<string name="reason">Choisissez le ou les motif(s) de sortie</string>
|
||||||
<string name="exit_date">Date de sortie</string>
|
<string name="exit_date">Date de sortie</string>
|
||||||
<string name="exit_hour">Heure de sortie</string>
|
<string name="exit_hour">Heure de sortie</string>
|
||||||
<string name="generate_attestation_button">Générer l’attestation</string>
|
<string name="generate_attestation_button">Générer l\'attestation</string>
|
||||||
|
|
||||||
<!-- Reasons for leaving house -->
|
<!-- Reasons for leaving house -->
|
||||||
<string name="reason">Je certifie que mon déplacement est lié au(x) motif(s) suivant (cocher la case) autorisé en application des mesures générales nécessaires pour faire face à l’épidémie de Covid19 dans le cadre de l’état d’urgence sanitaire :</string>
|
<string name="reason_1">Déplacements entre le domicile et le lieu d’exercice de l’activité professionnelle, lorsqu\'ils sont indispensables à l\'exercice d’activités ne pouvant être organisées sous forme de télétravail ou déplacements professionnels ne pouvant être différés.</string>
|
||||||
<string name="reason_1">1. Déplacements entre le domicile et le lieu d’exercice de l’activité professionnelle ou le lieu d’enseignement et de formation, déplacements professionnels ne pouvant être différés.</string>
|
<string name="reason_2">Déplacements pour effectuer des achats de fournitures nécessaires à l’activité professionnelle et des achats de première nécessité dans des établissements dont les activités demeurent autorisées</string>
|
||||||
<string name="reason_2">2. Déplacements pour des consultations et soins ne pouvant être assurés à distance et ne pouvant être différés ou pour l’achat de produits de santé.</string>
|
<string name="reason_3">Consultations et soins ne pouvant être assurés à distance et ne pouvant être différés ; consultations et soins des patients atteints d\'une affection de longue durée.</string>
|
||||||
<string name="reason_3">3. Déplacements pour motif familial impérieux, pour l’assistance aux personnes vulnérables ou précaires ou pour la garde d’enfants.</string>
|
<string name="reason_4">Déplacements pour motif familial impérieux, pour l’assistance aux personnes vulnérables ou la garde d’enfants.</string>
|
||||||
<string name="reason_4">4. Déplacements des personnes en situation de handicap et de leur accompagnant.</string>
|
<string name="reason_5">Déplacements brefs, dans la limite d\'une heure quotidienne et dans un rayon maximal d\'un kilomètre autour du domicile, liés soit à l\'activité physique individuelle des personnes, à l\'exclusion de toute pratique sportive collective et de toute proximité avec d\'autres personnes, soit à la promenade avec les seules personnes regroupées dans un même domicile, soit aux besoins des animaux de compagnie.</string>
|
||||||
<string name="reason_5">5. Déplacements pour répondre à une convocation judiciaire ou administrative.</string>
|
<string name="reason_6">Convocation judiciaire ou administrative.</string>
|
||||||
<string name="reason_6">6. Déplacements pour participer à des missions d’intérêt général sur demande de l’autorité administrative.</string>
|
<string name="reason_7">Participation à des missions d’intérêt général sur demande de l’autorité administrative.</string>
|
||||||
<string name="reason_7">7. Déplacements liés à des transits ferroviaires ou aériens pour des déplacements de longues distances.</string>
|
|
||||||
<string name="reason_8">8. Déplacements brefs, dans un rayon maximal d’un kilomètre autour du domicile pour les besoins des animaux de compagnie.</string>
|
|
||||||
|
|
||||||
<!-- Info Fragment -->
|
<!-- Info Fragment -->
|
||||||
<string name="explication_1">- Cette application n’aura jamais de publicité.</string>
|
<string name="explication_1">- Merci de n\'utiliser l\'application qu\'en cas de nécessité.</string>
|
||||||
<string name="explication_2">- Toutes les données sont stockées uniquement sur votre téléphone, utilisable hors ligne.</string>
|
<string name="explication_2">- Cette application n\'aura jamais de publicité.</string>
|
||||||
<string name="explication_3">- Application non gouvernementale ni officielle, développée par un jeune diplômé.</string>
|
<string name="explication_3">- Toutes les données sont stockées uniquement sur votre téléphone, utilisable hors ligne.</string>
|
||||||
<string name="explication_4">- Si vous souhaitez m’offrir une bière ou un café, c’est <a href="https://buymeacoff.ee/sanchezm/">ici</a> ou vous pouvez me suivre sur <a href="https://www.twitch.tv/mathdieu">twitch</a>.</string>
|
<string name="explication_4">- Application non gouvernementale ni officielle, développée par un étudiant.</string>
|
||||||
<string name="credits_title">Petit remerciement pour l’aide apportée au développement de l’application :</string>
|
<string name="credits_title">Petit remerciement pour l\'aide apportée au développement de l\'application :</string>
|
||||||
<string name="credits_1">TomRoush: <a href="https://github.com/TomRoush/PdfBox-Android">PdfBox-Android</a></string>
|
<string name="credits_1">TomRoush: <a href="https://github.com/TomRoush/PdfBox-Android">PdfBox-Android</a></string>
|
||||||
<string name="credits_2">Barteksc: <a href="https://github.com/barteksc/AndroidPdfViewer">AndroidPdfViewer</a></string>
|
<string name="credits_2">Barteksc: <a href="https://github.com/barteksc/AndroidPdfViewer">AndroidPdfViewer</a></string>
|
||||||
<string name="credits_3">Journeyapps: <a href="https://github.com/journeyapps/zxing-android-embedded">zxing-android-embedded</a></string>
|
<string name="credits_3">Journeyapps: <a href="https://github.com/journeyapps/zxing-android-embedded">zxing-android-embedded</a></string>
|
||||||
<string name="credits_4">Ainsi que toutes les libraries fourni par google</string>
|
<string name="credits_4">Ainsi que toutes les libraries fourni par google</string>
|
||||||
<string name="credits_5">Merci à <a href="https://www.linkedin.com/in/julienfabbro/">Fabbro J.</a> pour l’aide sur l’orthographe</string>
|
<string name="credits_5">Merci à <a href="https://www.linkedin.com/in/julienfabbro/">Fabbro J.</a> pour l\'aide sur l\'orthographe</string>
|
||||||
<string name="develop_by">"Développée avec ❤ par
|
<string name="develop_by">"Développée avec ❤ par
|
||||||
<a href="https://www.sanchezm.fr/">Mathieu Sanchez</a>"</string>
|
<a href="https://www.sanchezm.fr/">Mathieu Sanchez</a>"</string>
|
||||||
<string name="version_number">Version :</string>
|
<string name="version_number">Version :</string>
|
||||||
@ -56,6 +55,6 @@
|
|||||||
<!-- QR Fragment -->
|
<!-- QR Fragment -->
|
||||||
<string name="generating_attestation">Création de votre attesation</string>
|
<string name="generating_attestation">Création de votre attesation</string>
|
||||||
<string name="qrcode_attestation">QrCode Attestation</string>
|
<string name="qrcode_attestation">QrCode Attestation</string>
|
||||||
<string name="display_attestation">Afficher l’attestation</string>
|
<string name="display_attestation">Afficher l\'attestation</string>
|
||||||
<string name="delete_attestation">Supprimer l’attestation</string>
|
<string name="delete_attestation">Supprimer l\'attestation</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -37,9 +37,9 @@
|
|||||||
<style name="TextView" parent="Widget.MaterialComponents.TextView">
|
<style name="TextView" parent="Widget.MaterialComponents.TextView">
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:layout_marginTop">@dimen/margin5dp</item>
|
<item name="android:layout_marginTop">@dimen/margin15dp</item>
|
||||||
<item name="android:textColor">@color/colorPrimary</item>
|
<item name="android:textColor">@color/colorPrimary</item>
|
||||||
<item name="android:textSize">@dimen/textSize14sp</item>
|
<item name="android:textSize">@dimen/textSize18sp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TextViewCredits" parent="TextView">
|
<style name="TextViewCredits" parent="TextView">
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.4.21'
|
kotlin_version = '1.3.72'
|
||||||
db_version = '1'
|
db_version = '1'
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -13,7 +13,7 @@ buildscript {
|
|||||||
|
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.1.1'
|
classpath 'com.android.tools.build:gradle:3.6.3'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
#Sat Oct 24 15:33:39 CEST 2020
|
#Sun Apr 12 01:14:42 CEST 2020
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
|
||||||
|
Loading…
Reference in New Issue
Block a user