|
@@ -3,6 +3,7 @@ package com.fusi24.entryPermitScanner.adapter;
|
3
|
3
|
import android.content.Context;
|
4
|
4
|
import android.text.TextUtils;
|
5
|
5
|
import android.view.LayoutInflater;
|
|
6
|
+import android.view.View;
|
6
|
7
|
import android.view.ViewGroup;
|
7
|
8
|
import android.widget.Filter;
|
8
|
9
|
import android.widget.Filterable;
|
|
@@ -23,6 +24,7 @@ public class ProblemDocumentAdapter extends RecyclerView.Adapter<ProblemDocument
|
23
|
24
|
private Context context;
|
24
|
25
|
private List<DataProblems> problemsList;
|
25
|
26
|
private List<DataProblems> problemsListFiltered;
|
|
27
|
+ private Boolean isVisibility = false;
|
26
|
28
|
|
27
|
29
|
public ProblemDocumentAdapter(Context context, List<DataProblems> problemsList) {
|
28
|
30
|
this.context = context;
|
|
@@ -30,6 +32,14 @@ public class ProblemDocumentAdapter extends RecyclerView.Adapter<ProblemDocument
|
30
|
32
|
this.problemsListFiltered = problemsList;
|
31
|
33
|
}
|
32
|
34
|
|
|
35
|
+ public void setVisibility(Boolean visibility) {
|
|
36
|
+ if (visibility != null){
|
|
37
|
+ isVisibility = visibility;
|
|
38
|
+ }else {
|
|
39
|
+ isVisibility = false;
|
|
40
|
+ }
|
|
41
|
+ }
|
|
42
|
+
|
33
|
43
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
34
|
44
|
private RowDocumentBinding binding;
|
35
|
45
|
|
|
@@ -53,7 +63,15 @@ public class ProblemDocumentAdapter extends RecyclerView.Adapter<ProblemDocument
|
53
|
63
|
DataProblems problems = problemsListFiltered.get(position);
|
54
|
64
|
|
55
|
65
|
holder.binding.tvDocumentName.setText(problems.getDataDocumentType().getName());
|
56
|
|
- holder.binding.tvDocumentStatus.setText(problems.getReason());
|
|
66
|
+ if (isVisibility){
|
|
67
|
+ if (problems.getReason().equals("NOT FOUND")){
|
|
68
|
+ holder.binding.tvDocumentStatus.setVisibility(View.GONE);
|
|
69
|
+ }else {
|
|
70
|
+ holder.binding.tvDocumentStatus.setText(problems.getReason());
|
|
71
|
+ }
|
|
72
|
+ }else {
|
|
73
|
+ holder.binding.tvDocumentStatus.setText(problems.getReason());
|
|
74
|
+ }
|
57
|
75
|
if (problems.getExpiryDate() != null){
|
58
|
76
|
holder.binding.tvDocumentDate.setText(DateHelper.convertStringToMyPattern(problems.getExpiryDate(), "yyyy-MM-dd", "dd MMM yyyy"));
|
59
|
77
|
} else {
|