Przeglądaj źródła

-Fixing document adapter

ilhamitubagoes 4 lat temu
rodzic
commit
b963aa9482

+ 5 - 2
app/src/main/java/com/fusi24/rfid/adapter/ProblemDocumentAdapter.java

@@ -53,8 +53,11 @@ public class ProblemDocumentAdapter extends RecyclerView.Adapter<ProblemDocument
53 53
 
54 54
         holder.binding.tvDocumentName.setText(problems.getDataDocumentType().getName());
55 55
         holder.binding.tvDocumentStatus.setText(problems.getReason());
56
-        holder.binding.tvDocumentDate.setText(DateHelper.convertDateToReadableDate(problems.getDataDocumentType().getUpdateDate()));
57
-
56
+        if (problems.getExpiryDate() != null){
57
+            holder.binding.tvDocumentDate.setText(DateHelper.convertDateToReadableDate(problems.getExpiryDate()));
58
+        } else {
59
+            holder.binding.tvDocumentDate.setText("");
60
+        }
58 61
     }
59 62
 
60 63
     @Override

+ 9 - 2
app/src/main/res/layout/row_document.xml

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
     xmlns:tools="http://schemas.android.com/tools"
4 4
     android:orientation="horizontal"
5 5
     android:layout_width="match_parent"
@@ -15,6 +15,8 @@
15 15
         android:layout_height="wrap_content"
16 16
         android:layout_marginStart="4dp"
17 17
         android:layout_marginEnd="4dp"
18
+        android:layout_alignParentStart="true"
19
+        android:layout_centerVertical="true"
18 20
         tools:text="ID CARD KARYAWAN" />
19 21
 
20 22
     <TextView
@@ -24,6 +26,9 @@
24 26
         android:layout_height="wrap_content"
25 27
         android:layout_marginStart="4dp"
26 28
         android:layout_marginEnd="4dp"
29
+        android:layout_alignParentStart="true"
30
+        android:layout_alignParentEnd="true"
31
+        android:layout_centerVertical="true"
27 32
         android:gravity="center"
28 33
         tools:text="NOT FOUND" />
29 34
 
@@ -34,6 +39,8 @@
34 39
         android:layout_height="wrap_content"
35 40
         android:layout_marginStart="4dp"
36 41
         android:layout_marginEnd="4dp"
42
+        android:layout_alignParentEnd="true"
43
+        android:layout_centerVertical="true"
37 44
         tools:text="1-Jul-2019" />
38 45
 
39
-</LinearLayout>
46
+</RelativeLayout>