2 Commits

Author SHA1 Message Date
1d617e7678 Issue-4: Speeling correction 2020-05-02 14:46:30 +02:00
a7993ed680 Adding credits and correct spelling mistake 2020-04-29 17:20:11 +02:00
22 changed files with 180 additions and 251 deletions

View File

@ -30,28 +30,11 @@ android {
minifyEnabled true minifyEnabled true
shrinkResources true shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "Integer", "DB_VERSION", db_version buildConfigField "Integer", "DB_VERSION", "1"
buildConfigField "Boolean", "TEST", "false" buildConfigField "Boolean", "TEST", "false"
} }
beta {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "Integer", "DB_VERSION", db_version
buildConfigField "Boolean", "TEST", "false"
}
alpha {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "Integer", "DB_VERSION", db_version
buildConfigField "Boolean", "TEST", "true"
}
debug { debug {
buildConfigField "Integer", "DB_VERSION", db_version buildConfigField "Integer", "DB_VERSION", "1"
buildConfigField "Boolean", "TEST", "true" buildConfigField "Boolean", "TEST", "true"
} }
} }
@ -106,8 +89,6 @@ dependencies {
//noinspection GradleDependency //noinspection GradleDependency
implementation 'com.journeyapps:zxing-android-embedded:3.6.0' implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
implementation 'com.github.Ilhasoft:data-binding-validator:2.0.0'
// Test // Test
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.ext:junit:1.1.1'

View File

@ -15,7 +15,6 @@
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
tools:replace="android:allowBackup"
android:theme="@style/AppTheme.Light"> android:theme="@style/AppTheme.Light">
<activity android:name=".QrCodeActivity" /> <activity android:name=".QrCodeActivity" />
<activity android:name=".PdfViewerActivity" /> <activity android:name=".PdfViewerActivity" />

View File

@ -4,7 +4,6 @@ import android.content.Context
import fr.sanchezm.attestationsCovid19.data.db.dao.AttestationDao import fr.sanchezm.attestationsCovid19.data.db.dao.AttestationDao
import fr.sanchezm.attestationsCovid19.data.db.dao.ConfigDao import fr.sanchezm.attestationsCovid19.data.db.dao.ConfigDao
import fr.sanchezm.attestationsCovid19.data.db.dao.ProfileDao import fr.sanchezm.attestationsCovid19.data.db.dao.ProfileDao
import fr.sanchezm.attestationsCovid19.data.repository.ConfigRepository
class MyDatabase private constructor(private val savePath: String, private val filesPath: String) { class MyDatabase private constructor(private val savePath: String, private val filesPath: String) {
@ -12,15 +11,10 @@ class MyDatabase private constructor(private val savePath: String, private val f
private var _attestationDao: AttestationDao? = null private var _attestationDao: AttestationDao? = null
private var _configDao: ConfigDao? = null private var _configDao: ConfigDao? = null
fun profileDao(configRepository: ConfigRepository): ProfileDao = fun profileDao(): ProfileDao = _profileDao ?: ProfileDao(savePath).also { _profileDao = it }
_profileDao ?: ProfileDao(savePath, configRepository).also { _profileDao = it }
fun attestationDao(configRepository: ConfigRepository): AttestationDao = fun attestationDao(): AttestationDao =
_attestationDao ?: AttestationDao( _attestationDao ?: AttestationDao(savePath, filesPath).also { _attestationDao = it }
savePath,
filesPath,
configRepository
).also { _attestationDao = it }
fun configDao(): ConfigDao = _configDao ?: ConfigDao(savePath).also { _configDao = it } fun configDao(): ConfigDao = _configDao ?: ConfigDao(savePath).also { _configDao = it }
@ -34,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()
}
}
*/

View File

@ -6,15 +6,10 @@ import androidx.lifecycle.MutableLiveData
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import fr.sanchezm.attestationsCovid19.data.db.entity.Attestation import fr.sanchezm.attestationsCovid19.data.db.entity.Attestation
import fr.sanchezm.attestationsCovid19.data.repository.ConfigRepository
import fr.sanchezm.attestationsCovid19.utilities.PdfUtils import fr.sanchezm.attestationsCovid19.utilities.PdfUtils
import java.io.File import java.io.File
class AttestationDao( class AttestationDao(private val savePath: String, private val filesPath: String) {
private val savePath: String,
private val filesPath: String,
private val configRepository: ConfigRepository
) {
private val _attestations = MutableLiveData<ArrayList<Attestation>>() private val _attestations = MutableLiveData<ArrayList<Attestation>>()
private val fileName = "attestation.db" private val fileName = "attestation.db"
@ -28,8 +23,9 @@ class AttestationDao(
_attestations.value?.elementAt(id) _attestations.value?.elementAt(id)
fun addAttestation(attestation: Attestation) { fun addAttestation(attestation: Attestation) {
_attestations.value = _attestations.value ?: ArrayList()
_attestations.value?.add(attestation) _attestations.value?.add(attestation)
_attestations.value = _attestations.value
Log.d(TAG, "Add Attestation : $attestation") Log.d(TAG, "Add Attestation : $attestation")
save() save()
} }
@ -70,8 +66,6 @@ class AttestationDao(
if (file.exists()) { if (file.exists()) {
_attestations.value = Gson().fromJson(file.readText(Charsets.UTF_8), type) _attestations.value = Gson().fromJson(file.readText(Charsets.UTF_8), type)
} else {
_attestations.value = ArrayList()
} }
_attestations.value?.forEach { _attestations.value?.forEach {
val filePath = PdfUtils.getPath(filesPath, it.createAt) val filePath = PdfUtils.getPath(filesPath, it.createAt)

View File

@ -33,12 +33,7 @@ class ConfigDao(private val savePath: String) {
_config.value?.versionName = BuildConfig.VERSION_NAME _config.value?.versionName = BuildConfig.VERSION_NAME
} else { } else {
_config.value = _config.value =
Config( Config(BuildConfig.DB_VERSION, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)
BuildConfig.DB_VERSION,
BuildConfig.VERSION_NAME,
BuildConfig.VERSION_CODE,
-1
)
save() save()
} }
} }

View File

@ -1,77 +1,48 @@
package fr.sanchezm.attestationsCovid19.data.db.dao package fr.sanchezm.attestationsCovid19.data.db.dao
import android.util.Log
import androidx.lifecycle.LiveData import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import fr.sanchezm.attestationsCovid19.BuildConfig
import fr.sanchezm.attestationsCovid19.data.db.entity.Profile import fr.sanchezm.attestationsCovid19.data.db.entity.Profile
import fr.sanchezm.attestationsCovid19.data.repository.ConfigRepository
import fr.sanchezm.attestationsCovid19.utilities.DbMigration
import java.io.File import java.io.File
class ProfileDao(private val path: String, private val configRepository: ConfigRepository) { class ProfileDao(private val path: String) {
private val _profile = MutableLiveData<ArrayList<Profile>>() private val _profile = MutableLiveData<Profile>()
private val fileName = "profile.db" private val fileName = "profile.db"
private val type = object : TypeToken<ArrayList<Profile>>() {}.type
@Suppress("UNCHECKED_CAST") fun getProfile(): LiveData<Profile> =
fun getProfiles(): LiveData<List<Profile>> = _profile
_profile as LiveData<List<Profile>>
fun getProfile(id: Int): Profile? = fun updateProfile(profile: Profile) {
_profile.value?.get(id) _profile.value = profile
fun getProfileId(profile: Profile): Int? =
_profile.value?.indexOf(profile)
fun addProfile(profile: Profile): Int {
_profile.value?.add(profile)
_profile.value = _profile.value
save() save()
return _profile.value?.indexOf(profile)!!
} }
init { init {
val currentDbVersion = configRepository.getConfig().value!!.dbVersion load()
val appDbVersion = BuildConfig.DB_VERSION
if (currentDbVersion != appDbVersion) {
if (currentDbVersion == 1 && appDbVersion == 2) {
_profile.value = DbMigration.migrateProfileFrom1To2("$path/$fileName")
save()
configRepository.getConfig().value!!.let {
it.dbVersion = appDbVersion
configRepository.updateConfig(it)
}
Log.d(TAG, "Db version update from $currentDbVersion to $appDbVersion")
} else {
File("$path/$fileName").delete()
load()
}
} else {
load()
}
} }
private fun load() { private fun load() {
val file = File("$path/$fileName") val file = File("$path/$fileName")
if (file.exists()) { if (file.exists()) {
_profile.value = Gson().fromJson(file.readText(Charsets.UTF_8), type) _profile.value = Gson().fromJson(file.readText(Charsets.UTF_8), Profile::class.java)
} else { } else {
_profile.value = ArrayList() _profile.value = Profile("", "", "", "", "", "", "")
} }
} }
private fun save() { private fun save() {
File("$path/$fileName").writeText(Gson().toJson(_profile.value)) File("$path/$fileName").writeText(Gson().toJson(_profile.value))
} }
companion object {
private val TAG = ProfileDao::class.simpleName
}
} }
//@Dao
//interface ProfileDao {
// @Insert(onConflict = OnConflictStrategy.REPLACE)
// fun insert(profile: Profile)
//
// @Query(value = "SELECT * FROM profile WHERE id = $CURRENT_PROFILE_ID")
// fun getProfile(): LiveData<Profile>
//}

View File

@ -3,8 +3,9 @@ package fr.sanchezm.attestationsCovid19.data.db.entity
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* 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( data class Attestation(
val profile: Profile, val profile: Profile,
val exitDate: String, val exitDate: String,

View File

@ -1,8 +1,7 @@
package fr.sanchezm.attestationsCovid19.data.db.entity package fr.sanchezm.attestationsCovid19.data.db.entity
data class Config( data class Config(
var dbVersion: Int, val dbVersion: Int,
var versionName: String, var versionName: String,
var versionCode: Int, var versionCode: Int
var selectProfileId: Int
) )

View File

@ -1,5 +1,6 @@
package fr.sanchezm.attestationsCovid19.data.db.entity package fr.sanchezm.attestationsCovid19.data.db.entity
//@Entity(tableName = "profile")
data class Profile( data class Profile(
val firstName: String, val firstName: String,
val lastName: String, val lastName: String,
@ -9,6 +10,8 @@ data class Profile(
val city: String, val city: String,
val postalCode: String val postalCode: String
) { ) {
// @PrimaryKey
// var id: Int = CURRENT_PROFILE_ID
override fun toString(): String { override fun toString(): String {
return "Nom: $lastName; Prenom: $firstName; Naissance: $birthday a $birthPlace; Adresse: $address $postalCode $city" return "Nom: $lastName; Prenom: $firstName; Naissance: $birthday a $birthPlace; Adresse: $address $postalCode $city"

View File

@ -6,14 +6,11 @@ import fr.sanchezm.attestationsCovid19.data.db.entity.Profile
class ProfileRepository private constructor(private val profileDao: ProfileDao) { class ProfileRepository private constructor(private val profileDao: ProfileDao) {
fun getProfiles(): LiveData<List<Profile>> = fun getProfile(): LiveData<Profile> =
profileDao.getProfiles() profileDao.getProfile()
fun getProfile(id: Int): Profile? = fun insertProfile(profile: Profile) =
profileDao.getProfile(id) profileDao.updateProfile(profile)
fun insertProfile(profile: Profile): Int =
profileDao.addProfile(profile)
companion object { companion object {
@Volatile @Volatile

View File

@ -81,15 +81,15 @@ class AddViewModel(
} }
private fun setProfileValue() { private fun setProfileValue() {
val profile = profileRepository.getProfiles().value?.first() val profile = profileRepository.getProfile()
firstName.value = profile?.firstName firstName.value = profile.value?.firstName
lastName.value = profile?.lastName lastName.value = profile.value?.lastName
birthday.value = profile?.birthday birthday.value = profile.value?.birthday
birthPlace.value = profile?.birthPlace birthPlace.value = profile.value?.birthPlace
address.value = profile?.address address.value = profile.value?.address
city.value = profile?.city city.value = profile.value?.city
postalCode.value = profile?.postalCode postalCode.value = profile.value?.postalCode
} }
private fun setDateHourToday() { private fun setDateHourToday() {

View File

@ -1,15 +1,15 @@
package fr.sanchezm.attestationsCovid19.ui.info package fr.sanchezm.attestationsCovid19.ui.info
import android.os.Bundle; import android.os.Bundle
import android.text.method.LinkMovementMethod import android.text.method.LinkMovementMethod
import android.view.LayoutInflater; import android.view.LayoutInflater
import android.view.View; import android.view.View
import android.view.ViewGroup; import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import fr.sanchezm.attestationsCovid19.BuildConfig 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() { class InfoFragment : Fragment() {
@ -20,13 +20,19 @@ 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.findViewById<TextView>(R.id.develop_by).movementMethod = LinkMovementMethod.getInstance() root.credits_1.movementMethod = LinkMovementMethod.getInstance()
root.findViewById<TextView>(R.id.version).text = getVersionText() 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 return root
} }
private fun getVersionText(): String { private fun getVersionText(): String {
val versionText = getString(R.string.version_number); val versionText = getString(R.string.version_number)
val versionName = BuildConfig.VERSION_NAME val versionName = BuildConfig.VERSION_NAME
return "$versionText $versionName" return "$versionText $versionName"

View File

@ -1,22 +0,0 @@
package fr.sanchezm.attestationsCovid19.utilities
import com.google.gson.Gson
import fr.sanchezm.attestationsCovid19.data.db.entity.Profile
import java.io.File
object DbMigration {
fun migrateProfileFrom1To2(filename: String): ArrayList<Profile> {
val file = File(filename)
val list = ArrayList<Profile>()
val profile: Profile = if (file.exists()) {
Gson().fromJson(file.readText(Charsets.UTF_8), Profile::class.java)
} else {
Profile("", "", "", "", "", "", "")
}
list.add(profile)
return list
}
}

View File

@ -39,12 +39,11 @@ object InjectorUtils {
private fun getAttestationRepo(context: Context): AttestationRepository = private fun getAttestationRepo(context: Context): AttestationRepository =
AttestationRepository.getInstance( AttestationRepository.getInstance(
MyDatabase.invoke(context, getMyFilesDir(context)) MyDatabase.invoke(context, getMyFilesDir(context)).attestationDao()
.attestationDao(getConfigRepo(context))
) )
private fun getProfileRepo(context: Context): ProfileRepository = ProfileRepository.getInstance( private fun getProfileRepo(context: Context): ProfileRepository = ProfileRepository.getInstance(
MyDatabase.invoke(context, getMyFilesDir(context)).profileDao(getConfigRepo(context)) MyDatabase.invoke(context, getMyFilesDir(context)).profileDao()
) )
private fun getConfigRepo(context: Context): ConfigRepository = ConfigRepository.getInstance( private fun getConfigRepo(context: Context): ConfigRepository = ConfigRepository.getInstance(

View File

@ -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>

View File

@ -88,9 +88,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="date" android:inputType="date"
android:text="@={viewModel.birthday}" android:text="@={viewModel.birthday}" />
app:validateDate='@{"dd/MM/yyyy"}'
app:validateDateMessage="@{@string/date_error_message}"/>
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -119,7 +117,7 @@
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="number|textCapWords" android:inputType="textPostalAddress|textCapWords"
android:text="@={viewModel.address}" /> android:text="@={viewModel.address}" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -165,9 +163,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="date" android:inputType="date"
android:text="@={viewModel.exitDate}" android:text="@={viewModel.exitDate}" />
app:validateDate='@{"dd/MM/yyyy"}'
app:validateDateMessage="@{@string/date_error_message}"/>
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>

View File

@ -52,6 +52,58 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/explication_3" /> app:layout_constraintTop_toBottomOf="@+id/explication_3" />
<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_4" />
<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 <TextView
android:id="@+id/develop_by" android:id="@+id/develop_by"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -4,7 +4,7 @@
<style name="TextView"> <style name="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/margin20dp</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/textSize18sp</item> <item name="android:textSize">@dimen/textSize18sp</item>
<item name="android:justificationMode">inter_word</item> <item name="android:justificationMode">inter_word</item>

View File

@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- 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é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>

View File

@ -5,9 +5,9 @@
<string name="title_info">À Propos</string> <string name="title_info">À Propos</string>
<!-- Attestation Fragment --> <!-- Attestation Fragment -->
<string name="attestation_title">Attestation de déplacement dérogatoire</string> <string name="attestation_title">@string/app_name</string>
<string name="attestation_subtitle">#RestonsChezNous</string> <string name="attestation_subtitle">#RestonsChezNous</string>
<string name="attestation_generated">Attestation générer</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>
<!-- Field for attestation --> <!-- Field for attestation -->
@ -33,11 +33,17 @@
<string name="reason_7">Participation à des missions dintérêt général sur demande de lautorité administrative.</string> <string name="reason_7">Participation à des missions dintérêt général sur demande de lautorité administrative.</string>
<!-- Info Fragment --> <!-- Info Fragment -->
<string name="explication_1">- Merci de n\'utiliser l\'application quand cas de nécessité.</string> <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_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_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="explication_4">- Application non gouvernementale ni officielle, développée par un étudiant.</string>
<string name="develop_by">"Développer avec ❤️ par <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> <a href="https://www.sanchezm.fr/">Mathieu Sanchez</a>"</string>
<string name="version_number">Version :</string> <string name="version_number">Version :</string>

View File

@ -37,14 +37,20 @@
<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/margin20dp</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/textSize18sp</item> <item name="android:textSize">@dimen/textSize18sp</item>
</style> </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="textSize18sp">18sp</dimen>
<dimen name="textSize14sp">14sp</dimen>
<dimen name="textInputCornerRadius">20dp</dimen> <dimen name="textInputCornerRadius">20dp</dimen>
<dimen name="margin20dp">20dp</dimen> <dimen name="margin15dp">15dp</dimen>
<dimen name="margin5dp">5dp</dimen> <dimen name="margin5dp">5dp</dimen>
<dimen name="emptySize">0dp</dimen> <dimen name="emptySize">0dp</dimen>
</resources> </resources>

View File

@ -1,11 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext { ext.kotlin_version = '1.3.72'
kotlin_version = '1.3.72'
db_version = '2'
}
repositories { repositories {
google() google()
jcenter() jcenter()
@ -24,7 +20,7 @@ allprojects {
repositories { repositories {
google() google()
jcenter() jcenter()
maven { url 'https://jitpack.io' }
} }
} }