Changing attestation data to ArrayList

Adding PdfViewerActivity
Adding providePdfUtils in Injector
This commit is contained in:
Mathieu Sanchez
2020-04-16 14:32:46 +02:00
parent 9bbc364c11
commit f135425444
16 changed files with 240 additions and 28 deletions

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="?attr/itemBackground" />
<corners android:radius="10dip" />
<stroke
android:width="1dp"
android:color="@android:color/white" />
</shape>

View File

@ -0,0 +1,20 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000"
tools:context=".PdfViewerActivity">
<com.github.barteksc.pdfviewer.PDFView
android:id="@+id/pdfView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,34 @@
<?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_margin="10dp">
<TextView
android:id="@+id/people_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/people_item"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="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="5dp"
app:layout_constraintTop_toBottomOf="@+id/people_item"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/reason_item"
android:layout_marginTop="5dp"
app:layout_constraintTop_toBottomOf="@+id/date_item"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools"
android:paddingHorizontal="30dp"
android:paddingVertical="20dp">
<data>
<variable
@ -14,16 +16,28 @@
android:layout_height="match_parent"
tools:context=".ui.attestations.AttestationsFragment">
<com.google.android.material.button.MaterialButton
android:layout_width="wrap_content"
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="@{() -> viewModel.onClick()}"
android:text="@{viewModel.attestationName}"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="15dp"
android:text="@string/title_attestations"
android:textColor="?attr/colorPrimaryDark"
android:textSize="30sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/attestation_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -40,4 +40,9 @@
<string name="develop_by">"Développer avec ❤️ par
<a href="https://www.sanchezm.fr/">Mathieu Sanchez</a>"</string>
<string name="version_number">Version :</string>
<!-- Attestation Items -->
<string name="people_item">Personne :</string>
<string name="date_item">Date de sortie :</string>
<string name="reason_item">Raison(s) :</string>
</resources>