Selaa lähdekoodia

-Fixing String and sorting site by id

ilhamitubagoes 4 vuotta sitten
vanhempi
commit
7f64eae5f2

+ 3 - 1
app/src/main/java/com/fusi24/rfid/ui/home/HomeActivity.java

@@ -23,6 +23,7 @@ import androidx.core.app.ActivityCompat;
23 23
 import androidx.recyclerview.widget.DefaultItemAnimator;
24 24
 import androidx.recyclerview.widget.LinearLayoutManager;
25 25
 
26
+import com.annimon.stream.Stream;
26 27
 import com.fusi24.rfid.BuildConfig;
27 28
 import com.fusi24.rfid.R;
28 29
 import com.fusi24.rfid.SplashScreenActivity;
@@ -33,6 +34,7 @@ import com.fusi24.rfid.config.Constant;
33 34
 import com.fusi24.rfid.data.entity.DataDetail;
34 35
 import com.fusi24.rfid.data.entity.DataDevice;
35 36
 import com.fusi24.rfid.data.entity.DataEntryPermit;
37
+import com.fusi24.rfid.data.entity.DataSite;
36 38
 import com.fusi24.rfid.databinding.ActivityHomeBinding;
37 39
 import com.fusi24.rfid.ui.ScanActivity;
38 40
 
@@ -207,7 +209,7 @@ public class HomeActivity extends BaseActivity implements HomeView, StatusScanAd
207 209
     @Override
208 210
     public void showDataDevice(List<DataDevice> dataDevices) {
209 211
         binding.tvGateName.setText(dataDevices.get(0).getGate().getName());
210
-        siteAdapter.updateSiteList(dataDevices.get(0).getGate().getSites());
212
+        siteAdapter.updateSiteList(Stream.of(dataDevices.get(0).getGate().getSites()).sortBy(DataSite::getId).toList());
211 213
         siteAdapter.notifyDataSetChanged();
212 214
     }
213 215
 

+ 0 - 128
app/src/main/res/layout/activity_scan_result.xml

@@ -1,128 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<ScrollView
3
-    xmlns:android="http://schemas.android.com/apk/res/android"
4
-    xmlns:tools="http://schemas.android.com/tools"
5
-    android:layout_width="match_parent"
6
-    android:layout_height="match_parent"
7
-    tools:context=".ui.scanresult.ScanResultActivity">
8
-
9
-    <RelativeLayout
10
-        android:layout_width="match_parent"
11
-        android:layout_height="wrap_content">
12
-
13
-    <TextView
14
-        android:id="@+id/tv_rfid_number"
15
-        android:layout_width="match_parent"
16
-        android:layout_height="wrap_content"
17
-        android:layout_margin="8dp"
18
-        tools:text="@string/app_name" />
19
-
20
-    <de.hdodenhof.circleimageview.CircleImageView
21
-        android:id="@+id/iv_profile_image"
22
-        android:layout_width="80dp"
23
-        android:layout_height="80dp"
24
-        android:layout_below="@+id/tv_rfid_number"
25
-        android:layout_alignParentStart="true"
26
-        android:layout_alignParentEnd="true"
27
-        android:layout_marginStart="0dp"
28
-        android:layout_marginEnd="0dp"
29
-        android:layout_marginTop="16dp"
30
-        android:src="@drawable/ic_profile_default"/>
31
-
32
-    <LinearLayout
33
-        android:id="@+id/ll_profile_bio"
34
-        android:layout_width="match_parent"
35
-        android:layout_height="wrap_content"
36
-        android:layout_margin="16dp"
37
-        android:layout_below="@id/iv_profile_image"
38
-        android:orientation="vertical"
39
-        android:padding="12dp"
40
-        android:background="@drawable/bg_green">
41
-
42
-        <TextView
43
-            android:id="@+id/tv_profile_name"
44
-            style="@style/CommonText"
45
-            android:layout_width="match_parent"
46
-            android:layout_height="wrap_content"
47
-            android:gravity="center"
48
-            tools:text="HADYAN EL AUFAR" />
49
-
50
-        <TextView
51
-            android:id="@+id/tv_structural_position"
52
-            style="@style/CommonText"
53
-            android:layout_width="match_parent"
54
-            android:layout_height="wrap_content"
55
-            android:gravity="center"
56
-            tools:text="IT System Development Specialist" />
57
-
58
-        <TextView
59
-            android:id="@+id/tv_functional_position"
60
-            style="@style/CommonText"
61
-            android:layout_width="match_parent"
62
-            android:layout_height="wrap_content"
63
-            android:gravity="center"
64
-            tools:text="Engineer/Specialist" />
65
-
66
-        <TextView
67
-            android:id="@+id/tv_company_name"
68
-            style="@style/CommonText"
69
-            android:layout_width="match_parent"
70
-            android:layout_height="wrap_content"
71
-            android:gravity="center"
72
-            tools:text="PT. Berau Coal Energy" />
73
-
74
-    </LinearLayout>
75
-
76
-    <LinearLayout
77
-        android:id="@+id/ll_profile_status"
78
-        android:layout_width="160dp"
79
-        android:layout_height="wrap_content"
80
-        android:layout_below="@id/ll_profile_bio"
81
-        android:layout_alignParentStart="true"
82
-        android:layout_alignParentEnd="true"
83
-        android:layout_marginTop="16dp"
84
-        android:layout_marginStart="100dp"
85
-        android:layout_marginEnd="100dp"
86
-        android:background="@color/colorPrimary">
87
-
88
-        <TextView
89
-            android:id="@+id/tv_profile_status"
90
-            style="@style/CommonText"
91
-            android:layout_width="match_parent"
92
-            android:layout_height="wrap_content"
93
-            android:padding="8dp"
94
-            android:gravity="center"
95
-            tools:text="PASSED" />
96
-
97
-    </LinearLayout>
98
-
99
-    <androidx.recyclerview.widget.RecyclerView
100
-        android:id="@+id/rv_document_problem"
101
-        android:layout_width="match_parent"
102
-        android:layout_height="wrap_content"
103
-        android:layout_margin="16dp"
104
-        android:layout_below="@+id/ll_profile_status"
105
-        tools:listitem="@layout/row_document" />
106
-
107
-        <Button
108
-            android:id="@+id/btn_home"
109
-            style="@style/ButtonCommon"
110
-            android:layout_width="120dp"
111
-            android:layout_height="wrap_content"
112
-            android:layout_below="@id/rv_document_problem"
113
-            android:layout_alignParentStart="true"
114
-            android:layout_margin="16dp"
115
-            android:text="@string/label_home" />
116
-
117
-        <Button
118
-            android:id="@+id/btn_scan_again"
119
-            style="@style/ButtonCommon"
120
-            android:layout_width="120dp"
121
-            android:layout_height="wrap_content"
122
-            android:layout_below="@+id/rv_document_problem"
123
-            android:layout_alignParentEnd="true"
124
-            android:layout_margin="16dp"
125
-            android:text="@string/label_scan_other" />
126
-    </RelativeLayout>
127
-
128
-</ScrollView>

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -25,7 +25,7 @@
25 25
     <string name="error_security">You do not have read/write permission to the serialport.</string>
26 26
     <string name="error_unknown">The serial port can not be opened for an unknown reason.</string>
27 27
     <string name="error_scan_id">Mohon maaf sistem sedang sibuk</string>
28
-    <string name="error_only_security">Oops……… \n sepertinya anda bukan Security</string>
28
+    <string name="error_only_security">Oops……… \n anda gagal login</string>
29 29
     <string name="label_number_rfid">Nomor RFID Gun</string>
30 30
     <string name="label_number_rfid_card">Nomor RFID Card</string>
31 31
     <string name="label_employee_name">Nama Karyawan</string>