Browse Source

fixing code

ilhamitubagoes 5 years ago
parent
commit
fcd474763f

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+  </component>
6
+</project>

+ 1 - 11
app/src/main/java/com/fusi24/rfid/adapter/ScanResultAdapter.java

@@ -12,7 +12,6 @@ import androidx.recyclerview.widget.RecyclerView;
12
 import com.fusi24.rfid.R;
12
 import com.fusi24.rfid.R;
13
 import com.fusi24.rfid.data.model.DataProblems;
13
 import com.fusi24.rfid.data.model.DataProblems;
14
 import com.fusi24.rfid.util.DateHelper;
14
 import com.fusi24.rfid.util.DateHelper;
15
-import com.google.gson.Gson;
16
 
15
 
17
 import java.util.ArrayList;
16
 import java.util.ArrayList;
18
 import java.util.List;
17
 import java.util.List;
@@ -24,18 +23,13 @@ public class ScanResultAdapter extends RecyclerView.Adapter<ScanResultAdapter.Vi
24
 
23
 
25
     private Context context;
24
     private Context context;
26
     private List<DataProblems> problemsList;
25
     private List<DataProblems> problemsList;
27
-    private Gson gson = new Gson();
28
 
26
 
29
     public ScanResultAdapter(Context context) {
27
     public ScanResultAdapter(Context context) {
30
         this.context = context;
28
         this.context = context;
31
         this.problemsList = new ArrayList<>();
29
         this.problemsList = new ArrayList<>();
32
     }
30
     }
33
 
31
 
34
-    public List<DataProblems> getProblemsList() {
35
-        return problemsList;
36
-    }
37
-
38
-    public void setProblemsList(List<DataProblems> problemsList) {
32
+    private void setProblemsList(List<DataProblems> problemsList) {
39
         this.problemsList = problemsList;
33
         this.problemsList = problemsList;
40
     }
34
     }
41
 
35
 
@@ -70,12 +64,8 @@ public class ScanResultAdapter extends RecyclerView.Adapter<ScanResultAdapter.Vi
70
     @Override
64
     @Override
71
     public void onBindViewHolder(@NonNull ScanResultAdapter.ViewHolder holder, int position) {
65
     public void onBindViewHolder(@NonNull ScanResultAdapter.ViewHolder holder, int position) {
72
 
66
 
73
-        System.out.println("DEVELOPER 3 : " + gson.toJson(problemsList));
74
-
75
         DataProblems problems = problemsList.get(position);
67
         DataProblems problems = problemsList.get(position);
76
 
68
 
77
-        System.out.println("DEVELOPER 4 : " + gson.toJson(problems));
78
-
79
         holder.tvDocumentName.setText(problems.getDataDocumentType().getName());
69
         holder.tvDocumentName.setText(problems.getDataDocumentType().getName());
80
         holder.tvDocumentStatus.setText(problems.getReason());
70
         holder.tvDocumentStatus.setText(problems.getReason());
81
         holder.tvDocumentDate.setText(DateHelper.convertDateToReadableDate(problems.getDataDocumentType().getUpdateDate()));
71
         holder.tvDocumentDate.setText(DateHelper.convertDateToReadableDate(problems.getDataDocumentType().getUpdateDate()));

+ 0 - 2
app/src/main/java/com/fusi24/rfid/ui/scanresult/ScanResultActivity.java

@@ -21,7 +21,6 @@ import com.fusi24.rfid.base.BaseActivity;
21
 import com.fusi24.rfid.config.Constant;
21
 import com.fusi24.rfid.config.Constant;
22
 import com.fusi24.rfid.data.model.DataProblems;
22
 import com.fusi24.rfid.data.model.DataProblems;
23
 import com.fusi24.rfid.data.model.DataResultRfid;
23
 import com.fusi24.rfid.data.model.DataResultRfid;
24
-import com.google.gson.Gson;
25
 
24
 
26
 import java.util.ArrayList;
25
 import java.util.ArrayList;
27
 import java.util.List;
26
 import java.util.List;
@@ -63,7 +62,6 @@ public class ScanResultActivity extends BaseActivity implements ScanResultView {
63
     private ScanResultAdapter adapter;
62
     private ScanResultAdapter adapter;
64
     private List<DataProblems> problemsList;
63
     private List<DataProblems> problemsList;
65
     private String numberRfid;
64
     private String numberRfid;
66
-    private Gson gson = new Gson();
67
 
65
 
68
     @Override
66
     @Override
69
     protected void onCreate(Bundle savedInstanceState) {
67
     protected void onCreate(Bundle savedInstanceState) {