Add Info Page

This commit is contained in:
Mathieu Sanchez
2020-04-14 16:44:17 +02:00
parent 02b3c53a0a
commit dd91303137
23 changed files with 496 additions and 76 deletions

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
</vector>

View File

@ -0,0 +1,79 @@
<?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

@ -13,6 +13,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/context"
tools:context=".ui.add.AddFragment">
<androidx.core.widget.NestedScrollView
@ -27,12 +28,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="50dp"
android:paddingHorizontal="30dp"
android:paddingVertical="20dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="@string/attestation_title"
android:textColor="?attr/colorPrimary"
android:textSize="25sp" />
@ -71,7 +73,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName|textCapWords"
android:text="@{viewModel.lastName}" />
android:text="@={viewModel.lastName}" />
</com.google.android.material.textfield.TextInputLayout>
@ -86,7 +88,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="date"
android:text="@{viewModel.birthday}" />
android:text="@={viewModel.birthday}" />
</com.google.android.material.textfield.TextInputLayout>
@ -101,7 +103,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text|textCapWords"
android:text="@{viewModel.birthPlace}" />
android:text="@={viewModel.birthPlace}" />
</com.google.android.material.textfield.TextInputLayout>
@ -116,7 +118,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPostalAddress|textCapWords"
android:text="@{viewModel.address}" />
android:text="@={viewModel.address}" />
</com.google.android.material.textfield.TextInputLayout>
@ -131,7 +133,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text|textCapWords"
android:text="@{viewModel.city}" />
android:text="@={viewModel.city}" />
</com.google.android.material.textfield.TextInputLayout>
@ -146,7 +148,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text|textCapWords"
android:text="@{viewModel.postalCode}" />
android:text="@={viewModel.postalCode}" />
</com.google.android.material.textfield.TextInputLayout>
@ -161,7 +163,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="date"
android:text="@{viewModel.exitDate}" />
android:text="@={viewModel.exitDate}" />
</com.google.android.material.textfield.TextInputLayout>
@ -176,7 +178,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="time"
android:text="@{viewModel.exitHour}" />
android:text="@={viewModel.exitHour}" />
</com.google.android.material.textfield.TextInputLayout>
@ -193,6 +195,7 @@
style="@style/MaterialCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="@={viewModel.reason1}"
android:text="@string/reason_1" />
<com.google.android.material.checkbox.MaterialCheckBox
@ -200,6 +203,7 @@
style="@style/MaterialCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="@={viewModel.reason2}"
android:text="@string/reason_2" />
<com.google.android.material.checkbox.MaterialCheckBox
@ -207,6 +211,7 @@
style="@style/MaterialCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="@={viewModel.reason3}"
android:text="@string/reason_3" />
<com.google.android.material.checkbox.MaterialCheckBox
@ -214,6 +219,7 @@
style="@style/MaterialCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="@={viewModel.reason4}"
android:text="@string/reason_4" />
<com.google.android.material.checkbox.MaterialCheckBox
@ -221,6 +227,7 @@
style="@style/MaterialCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="@={viewModel.reason5}"
android:text="@string/reason_5" />
<com.google.android.material.checkbox.MaterialCheckBox
@ -228,6 +235,7 @@
style="@style/MaterialCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="@={viewModel.reason6}"
android:text="@string/reason_6" />
<com.google.android.material.checkbox.MaterialCheckBox
@ -235,6 +243,7 @@
style="@style/MaterialCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="@={viewModel.reason7}"
android:text="@string/reason_7" />
<com.google.android.material.button.MaterialButton

View File

@ -0,0 +1,78 @@
<?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"
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

@ -14,4 +14,10 @@
android:title="@string/title_attestations"
app:itemBackground="?attr/itemBackground" />
<item
android:id="@+id/navigation_info"
android:icon="@drawable/ic_info_24dp"
android:title="@string/title_info"
app:itemBackground="?attr/itemBackground" />
</menu>

View File

@ -17,4 +17,10 @@
android:label="@string/title_attestations"
tools:layout="@layout/fragment_attestations" />
<fragment
android:id="@+id/navigation_info"
android:name="fr.sanchezm.attestationsCovid19.ui.info.InfoFragment"
android:label="@string/title_info"
tools:layout="@layout/fragment_info" />
</navigation>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<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:textColor">@color/colorPrimary</item>
<item name="android:textSize">@dimen/textSize18sp</item>
<item name="android:justificationMode">inter_word</item>
</style>
</resources>

View File

@ -2,10 +2,14 @@
<string name="app_name">Attestation de déplacement dérogatoire</string>
<string name="title_add">Nouvelle Attestation</string>
<string name="title_attestations">Mes Attestations</string>
<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="error_cannot_create_attestation">Erreur lors de la génération de l\'attestation, tout les champs ne sont pas compléter</string>
<!-- Field for attestation -->
<string name="first_name">Prénom</string>
<string name="last_name">Nom</string>
<string name="birthday">Date de naissance</string>
@ -18,6 +22,7 @@
<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 dexercice de lactivité professionnelle, lorsqu\'ils sont indispensables à l\'exercice dactivité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 à lactivité 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>
@ -25,4 +30,13 @@
<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 dintérêt général sur demande de lautorité administrative.</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
<a href="https://www.sanchezm.fr/">Mathieu Sanchez</a>"</string>
<string name="version_number">Version :</string>
</resources>

View File

@ -34,7 +34,17 @@
<item name="android:textColor">@color/colorAccent</item>
</style>
<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:textColor">@color/colorPrimary</item>
<item name="android:textSize">@dimen/textSize18sp</item>
</style>
<dimen name="textSize18sp">18sp</dimen>
<dimen name="textInputCornerRadius">20dp</dimen>
<dimen name="margin20dp">20dp</dimen>
<dimen name="margin5dp">5dp</dimen>
<dimen name="emptySize">0dp</dimen>
</resources>