Browse Source

-Fixing document adapter

ilhamitubagoes 4 years ago
parent
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
         holder.binding.tvDocumentName.setText(problems.getDataDocumentType().getName());
54
         holder.binding.tvDocumentName.setText(problems.getDataDocumentType().getName());
55
         holder.binding.tvDocumentStatus.setText(problems.getReason());
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
     @Override
63
     @Override

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

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