Compare commits
10 Commits
ms/issue-5
...
ms/issue-1
Author | SHA1 | Date | |
---|---|---|---|
c976c00ce4 | |||
3388de76b0 | |||
8807105c06 | |||
849d6d4665 | |||
b5f8848f32 | |||
a2e8a5e333 | |||
52892c13d4 | |||
428759d30a | |||
1d617e7678 | |||
a7993ed680 |
@ -4,19 +4,19 @@ apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "29.0.3"
|
||||
|
||||
dataBinding {
|
||||
enabled = true
|
||||
buildFeatures {
|
||||
dataBinding = true
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "fr.sanchezm.attestationsCovid19"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 29
|
||||
versionCode 6
|
||||
versionName "1.0.4"
|
||||
targetSdkVersion 30
|
||||
versionCode 9
|
||||
versionName "2.0.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@ -74,24 +74,20 @@ dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
// Android X
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.core:core-ktx:1.2.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.core:core-ktx:1.3.2'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
|
||||
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.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'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
|
||||
implementation 'androidx.navigation:navigation-fragment:2.3.1'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'
|
||||
implementation 'androidx.navigation:navigation-ui:2.3.1'
|
||||
|
||||
// Design
|
||||
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'
|
||||
implementation 'com.google.android.material:material:1.2.1'
|
||||
|
||||
// PDF
|
||||
implementation 'com.tom_roush:pdfbox-android:1.8.10.1'
|
||||
@ -110,6 +106,6 @@ dependencies {
|
||||
|
||||
// Test
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
tools:replace="android:allowBackup"
|
||||
android:theme="@style/AppTheme.Light">
|
||||
<activity android:name=".QrCodeActivity" />
|
||||
<activity android:name=".PdfViewerActivity" />
|
||||
|
Binary file not shown.
@ -28,40 +28,3 @@ 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()
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -3,7 +3,7 @@ package fr.sanchezm.attestationsCovid19.data.db.entity
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
const val PATTERN = "dd/MM/yyyy 'a' HH'h'mm"
|
||||
const val PATTERN = "dd/MM/yyyy 'à' HH'h'mm"
|
||||
|
||||
//@Entity(tableName = "attestation")
|
||||
data class Attestation(
|
||||
@ -34,15 +34,17 @@ data class Attestation(
|
||||
|
||||
private fun getDate(dateTime: Long): String = SimpleDateFormat(PATTERN, Locale.FRANCE).format(Date(dateTime))
|
||||
|
||||
private fun getMotifText(i: Int): String {
|
||||
fun getMotifText(i: Int): String {
|
||||
return when (i) {
|
||||
1 -> "travail"
|
||||
2 -> "courses"
|
||||
2 -> "achats"
|
||||
3 -> "sante"
|
||||
4 -> "famille"
|
||||
5 -> "sport"
|
||||
6 -> "judiciare"
|
||||
7 -> "missions"
|
||||
5 -> "handicap"
|
||||
6 -> "sport_animaux"
|
||||
7 -> "convocation"
|
||||
8 -> "missions"
|
||||
9 -> "enfants"
|
||||
else -> "Error $i not found"
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,8 @@ class AddViewModel(
|
||||
val reason5 = MutableLiveData(false)
|
||||
val reason6 = MutableLiveData(false)
|
||||
val reason7 = MutableLiveData(false)
|
||||
val reason8 = MutableLiveData(false)
|
||||
val reason9 = MutableLiveData(false)
|
||||
// endregion
|
||||
|
||||
private val datePattern = "dd/MM/yyyy"
|
||||
@ -137,6 +139,8 @@ class AddViewModel(
|
||||
if (reason5.value!!) reasons.add(5)
|
||||
if (reason6.value!!) reasons.add(6)
|
||||
if (reason7.value!!) reasons.add(7)
|
||||
if (reason8.value!!) reasons.add(8)
|
||||
if (reason9.value!!) reasons.add(9)
|
||||
|
||||
return reasons
|
||||
}
|
||||
@ -162,6 +166,8 @@ class AddViewModel(
|
||||
|| reason5.value!!
|
||||
|| reason6.value!!
|
||||
|| reason7.value!!
|
||||
|| reason8.value!!
|
||||
|| reason9.value!!
|
||||
}
|
||||
|
||||
}
|
@ -1,15 +1,15 @@
|
||||
package fr.sanchezm.attestationsCovid19.ui.info
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Bundle
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import fr.sanchezm.attestationsCovid19.BuildConfig
|
||||
|
||||
import fr.sanchezm.attestationsCovid19.R;
|
||||
import fr.sanchezm.attestationsCovid19.R
|
||||
import kotlinx.android.synthetic.main.fragment_info.view.*
|
||||
|
||||
class InfoFragment : Fragment() {
|
||||
|
||||
@ -20,13 +20,19 @@ class InfoFragment : Fragment() {
|
||||
): View? {
|
||||
val root = inflater.inflate(R.layout.fragment_info, container, false)
|
||||
|
||||
root.findViewById<TextView>(R.id.develop_by).movementMethod = LinkMovementMethod.getInstance()
|
||||
root.findViewById<TextView>(R.id.version).text = getVersionText()
|
||||
root.credits_1.movementMethod = LinkMovementMethod.getInstance()
|
||||
root.credits_2.movementMethod = LinkMovementMethod.getInstance()
|
||||
root.credits_3.movementMethod = LinkMovementMethod.getInstance()
|
||||
root.credits_4.movementMethod = LinkMovementMethod.getInstance()
|
||||
root.credits_5.movementMethod = LinkMovementMethod.getInstance()
|
||||
|
||||
root.develop_by.movementMethod = LinkMovementMethod.getInstance()
|
||||
root.version.text = getVersionText()
|
||||
return root
|
||||
}
|
||||
|
||||
private fun getVersionText(): String {
|
||||
val versionText = getString(R.string.version_number);
|
||||
val versionText = getString(R.string.version_number)
|
||||
val versionName = BuildConfig.VERSION_NAME
|
||||
|
||||
return "$versionText $versionName"
|
||||
|
@ -21,8 +21,8 @@ class PdfUtils private constructor(
|
||||
private val path: String
|
||||
) {
|
||||
|
||||
private val checkboxListNames = ArrayList<String>()
|
||||
private val font = PDType1Font.HELVETICA
|
||||
// private val checkboxListNames = ArrayList<String>()
|
||||
// private val font = PDType1Font.HELVETICA
|
||||
|
||||
fun fillForm(attestation: Attestation, callback: (Boolean) -> Unit) {
|
||||
checkFolder()
|
||||
@ -65,8 +65,7 @@ class PdfUtils private constructor(
|
||||
attestation,
|
||||
size / 3,
|
||||
page1.mediaBox.upperRightX - margin - size / 3 - 30,
|
||||
141f,
|
||||
true
|
||||
99f
|
||||
)
|
||||
|
||||
// Add QRCode on a new page
|
||||
@ -83,8 +82,7 @@ class PdfUtils private constructor(
|
||||
attestation: Attestation,
|
||||
size: Int,
|
||||
x: Float,
|
||||
y: Float,
|
||||
addText: Boolean = false
|
||||
y: Float
|
||||
) {
|
||||
|
||||
val contentStream = PDPageContentStream(document, page, true, false)
|
||||
@ -92,21 +90,7 @@ class PdfUtils private constructor(
|
||||
LosslessFactory.createFromImage(document, QRCodeUtils.getQrCode(attestation, size))
|
||||
|
||||
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()
|
||||
|
||||
}
|
||||
|
||||
private fun setFieldsData(acroForm: PDAcroForm, attestation: Attestation): Boolean {
|
||||
@ -117,21 +101,18 @@ class PdfUtils private constructor(
|
||||
val namesField = acroForm.getField("Nom et prénom") as PDTextField
|
||||
val birthdayField = acroForm.getField("Date de naissance") as PDTextField
|
||||
val birthPlaceField = acroForm.getField("Lieu de naissance") as PDTextField
|
||||
val addressField = acroForm.getField("Adresse actuelle") as PDTextField
|
||||
val addressField = acroForm.getField("Adresse") as PDTextField
|
||||
val cityField = acroForm.getField("Ville") as PDTextField
|
||||
val dateField = acroForm.getField("Date") as PDTextField
|
||||
val hourField = acroForm.getField("Heure") as PDTextField
|
||||
val minutesField = acroForm.getField("Minute") as PDTextField
|
||||
// val signatureField = acroForm.getField("Signature") as PDTextField
|
||||
val exitField = acroForm.getField("Heure") as PDTextField
|
||||
|
||||
namesField.value = "${profile.firstName} ${profile.lastName}"
|
||||
birthdayField.value = profile.birthday
|
||||
birthPlaceField.value = profile.birthPlace
|
||||
addressField.value = "${profile.address} ${profile.postalCode} ${profile.city}"
|
||||
addressField.value = "${profile.address}, ${profile.city} ${profile.postalCode}"
|
||||
cityField.value = profile.city
|
||||
dateField.value = attestation.exitDate
|
||||
hourField.value = attestation.exitHour.split("h")[0]
|
||||
minutesField.value = attestation.exitHour.split("h")[1]
|
||||
exitField.value = attestation.exitHour.replace('h', ':')
|
||||
return true
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "${e.message}")
|
||||
@ -141,7 +122,7 @@ class PdfUtils private constructor(
|
||||
|
||||
private fun setCheckboxFields(acroForm: PDAcroForm, attestation: Attestation) {
|
||||
attestation.reasons.forEach {
|
||||
(acroForm.getField(checkboxListNames[it - 1]) as PDCheckbox).check()
|
||||
(acroForm.getField(attestation.getMotifText(it)) as PDCheckbox).check()
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,20 +144,10 @@ class PdfUtils private constructor(
|
||||
fun getInstance() = instance
|
||||
|
||||
fun getInstance(assetManager: AssetManager, path: String) = instance ?: synchronized(LOCK) {
|
||||
instance ?: PdfUtils(assetManager, path).also { instance = it; it.initList() }
|
||||
instance ?: PdfUtils(assetManager, path).also { instance = it }
|
||||
}
|
||||
|
||||
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,79 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingHorizontal="30dp"
|
||||
android:paddingVertical="20dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="30sp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?attr/colorPrimaryDark"
|
||||
android:text="@string/title_info"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/explication_1"
|
||||
android:text="@string/explication_1"
|
||||
android:layout_marginTop="40dp"
|
||||
style="@style/TextView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/explication_2"
|
||||
android:text="@string/explication_2"
|
||||
style="@style/TextView"
|
||||
android:justificationMode="inter_word"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/explication_1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/explication_3"
|
||||
android:text="@string/explication_3"
|
||||
style="@style/TextView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/explication_2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/explication_4"
|
||||
android:text="@string/explication_4"
|
||||
style="@style/TextView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/explication_3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/develop_by"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/colorPrimaryDark"
|
||||
android:text="@string/develop_by"
|
||||
android:layout_marginBottom="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/version" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/version_number"
|
||||
android:textSize="12sp"
|
||||
android:textColor="?attr/colorAccent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/custom_rectangle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:background="@drawable/custom_rectangle"
|
||||
android:padding="15dp">
|
||||
|
||||
<TextView
|
||||
@ -13,50 +13,50 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/people_item"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date_item"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/date_item"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="@string/date_item"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toBottomOf="@+id/people_item"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/people_item" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reason_item"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/reason_item"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="@string/reason_item"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toBottomOf="@+id/date_item"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/date_item" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/people_item_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date_item_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/people_item_data"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/people_item_data" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reason_item_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/date_item_data"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/date_item_data" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -250,6 +250,22 @@
|
||||
android:checked="@={viewModel.reason7}"
|
||||
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.checkbox.MaterialCheckBox
|
||||
android:id="@+id/reason_9"
|
||||
style="@style/MaterialCheckBox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="@={viewModel.reason9}"
|
||||
android:text="@string/reason_9" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/generate_attestation"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -52,6 +52,66 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/explication_3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/explication_5"
|
||||
android:text="@string/explication_5"
|
||||
style="@style/TextView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/explication_4" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="20dp"
|
||||
android:id="@+id/credits_title"
|
||||
android:text="@string/credits_title"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold"
|
||||
style="@style/TextViewCredits"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/explication_5" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="10dp"
|
||||
android:id="@+id/credits_1"
|
||||
android:text="@string/credits_1"
|
||||
style="@style/TextViewCredits"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/credits_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/credits_2"
|
||||
android:text="@string/credits_2"
|
||||
style="@style/TextViewCredits"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/credits_1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/credits_3"
|
||||
android:text="@string/credits_3"
|
||||
style="@style/TextViewCredits"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/credits_2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/credits_4"
|
||||
android:text="@string/credits_4"
|
||||
style="@style/TextViewCredits"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/credits_3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/credits_5"
|
||||
android:text="@string/credits_5"
|
||||
style="@style/TextViewCredits"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/credits_4" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/develop_by"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -4,7 +4,7 @@
|
||||
<style name="TextView">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginTop">@dimen/margin20dp</item>
|
||||
<item name="android:layout_marginTop">@dimen/margin15dp</item>
|
||||
<item name="android:textColor">@color/colorPrimary</item>
|
||||
<item name="android:textSize">@dimen/textSize18sp</item>
|
||||
<item name="android:justificationMode">inter_word</item>
|
||||
|
@ -4,6 +4,6 @@
|
||||
<!-- Validator -->
|
||||
<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éter</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_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>
|
@ -5,9 +5,9 @@
|
||||
<string name="title_info">À Propos</string>
|
||||
|
||||
<!-- Attestation Fragment -->
|
||||
<string name="attestation_title">Attestation de déplacement dérogatoire</string>
|
||||
<string name="attestation_subtitle">#RestonsChezNous</string>
|
||||
<string name="attestation_generated">Attestation générer</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_generated">Attestation générée</string>
|
||||
<string name="no_attestation">Aucune attestation, veuillez en générer une.</string>
|
||||
|
||||
<!-- Field for attestation -->
|
||||
@ -18,26 +18,35 @@
|
||||
<string name="address">Adresse</string>
|
||||
<string name="city">Ville</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_hour">Heure de sortie</string>
|
||||
<string name="generate_attestation_button">Générer l\'attestation</string>
|
||||
|
||||
<!-- Reasons for leaving house -->
|
||||
<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_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_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_4">Déplacements pour motif familial impérieux, pour l’assistance aux personnes vulnérables ou la garde d’enfants.</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_6">Convocation judiciaire ou 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">Je certifie que mon déplacement est lié au motif 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 ou les 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, des achats de première nécessité dans des établissements dont les activités demeurent autorisées (liste sur gouvernement.fr) et les livraisons à domicile.</string>
|
||||
<string name="reason_3">Consultations et soins ne pouvant être assurés à distance et ne pouvant être différés et l’achat de médicaments.</string>
|
||||
<string name="reason_4">Déplacements pour motif familial impérieux, pour l\'assistance aux personnes vulnérables et précaires ou la garde d\'enfants.</string>
|
||||
<string name="reason_5">Déplacements des personnes en situation de handicap et de leur accompagnant.</string>
|
||||
<string name="reason_6">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_7">Convocation judiciaire ou administrative et rendez-vous dans un service public.</string>
|
||||
<string name="reason_8">Participation à des missions d\'intérêt général sur demande de l\'autorité administrative.</string>
|
||||
<string name="reason_9">Déplacement pour chercher les enfants à l’écoles et à l’occasion de leurs activités périscolaires.</string>
|
||||
|
||||
<!-- Info Fragment -->
|
||||
<string name="explication_1">- Merci de n\'utiliser l\'application quand cas de nécessité.</string>
|
||||
<string name="explication_2">- Cette application n\'aura jamais de publicité.</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">- Application non gouvernementale ni officiel, développer par un étudiant.</string>
|
||||
<string name="develop_by">"Développer avec ❤️ par
|
||||
<string name="explication_1">- Merci de n\'utiliser l\'application qu\'en cas de nécessité.</string>
|
||||
<string name="explication_2">- Cette application n\'aura jamais de publicité.</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">- Application non gouvernementale ni officielle, développée par un étudiant.</string>
|
||||
<string name="explication_5">- J\'ai, moi-même été touché par ce virus, même à 22 ans il m\'a mis KO 2\-3 jours, faites attention à vous et à vos proches.</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_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_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="develop_by">"Développée avec ❤ par
|
||||
<a href="https://www.sanchezm.fr/">Mathieu Sanchez</a>"</string>
|
||||
<string name="version_number">Version :</string>
|
||||
|
||||
|
@ -37,14 +37,20 @@
|
||||
<style name="TextView" parent="Widget.MaterialComponents.TextView">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginTop">@dimen/margin20dp</item>
|
||||
<item name="android:layout_marginTop">@dimen/margin15dp</item>
|
||||
<item name="android:textColor">@color/colorPrimary</item>
|
||||
<item name="android:textSize">@dimen/textSize18sp</item>
|
||||
</style>
|
||||
|
||||
<style name="TextViewCredits" parent="TextView">
|
||||
<item name="android:textSize">@dimen/textSize14sp</item>
|
||||
<item name="android:layout_marginTop">@dimen/margin5dp</item>
|
||||
</style>
|
||||
|
||||
<dimen name="textSize18sp">18sp</dimen>
|
||||
<dimen name="textSize14sp">14sp</dimen>
|
||||
<dimen name="textInputCornerRadius">20dp</dimen>
|
||||
<dimen name="margin20dp">20dp</dimen>
|
||||
<dimen name="margin15dp">15dp</dimen>
|
||||
<dimen name="margin5dp">5dp</dimen>
|
||||
<dimen name="emptySize">0dp</dimen>
|
||||
</resources>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
buildscript {
|
||||
ext {
|
||||
kotlin_version = '1.3.72'
|
||||
kotlin_version = '1.4.10'
|
||||
db_version = '1'
|
||||
|
||||
}
|
||||
@ -13,7 +13,7 @@ buildscript {
|
||||
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.6.3'
|
||||
classpath 'com.android.tools.build:gradle:4.1.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// 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 @@
|
||||
#Sun Apr 12 01:14:42 CEST 2020
|
||||
#Sat Oct 24 15:33:39 CEST 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
|
||||
|
Reference in New Issue
Block a user