Explorar el Código

+ Hide input for ID Permit (Izin Masuk)
+ Change font for kategori Pekerjaan
+ Make Button Home and scan Other to stack in bottom screen device

ilhamitubagoes hace 4 años
padre
commit
611d8fb168

+ 17 - 18
app/src/main/java/com/fusi24/entryPermitScanner/ui/home/HomeActivity.java

@@ -12,8 +12,6 @@ import android.telephony.TelephonyManager;
12 12
 import android.view.Menu;
13 13
 import android.view.MenuItem;
14 14
 import android.view.View;
15
-import android.widget.AdapterView;
16
-import android.widget.ArrayAdapter;
17 15
 import android.widget.TextView;
18 16
 import android.widget.Toast;
19 17
 
@@ -23,7 +21,6 @@ import androidx.core.app.ActivityCompat;
23 21
 import androidx.recyclerview.widget.DefaultItemAnimator;
24 22
 import androidx.recyclerview.widget.LinearLayoutManager;
25 23
 
26
-import com.annimon.stream.Collectors;
27 24
 import com.annimon.stream.Stream;
28 25
 import com.fusi24.entryPermitScanner.BuildConfig;
29 26
 import com.fusi24.entryPermitScanner.R;
@@ -128,7 +125,9 @@ public class HomeActivity extends BaseActivity implements HomeView, StatusScanAd
128 125
         binding.refresh.setRefreshing(false);
129 126
         ActivityCompat.requestPermissions(this, Constant.PERMISSIONS_RFID, 1000);
130 127
 
131
-        entryPermitList = new ArrayList<>();
128
+        binding.llPermit.setVisibility(View.GONE);
129
+
130
+        //entryPermitList = new ArrayList<>();
132 131
         statusScanList = new ArrayList<>();
133 132
 
134 133
         scanAdapter = new StatusScanAdapter(this, this);
@@ -156,11 +155,11 @@ public class HomeActivity extends BaseActivity implements HomeView, StatusScanAd
156 155
             siteAdapter.notifyDataSetChanged();
157 156
         }
158 157
 
159
-        if (getSessionManager().getPermitList() != null) {
158
+        /*if (getSessionManager().getPermitList() != null) {
160 159
             entryPermitList.clear();
161 160
             entryPermitList.addAll(getSessionManager().getPermitList());
162 161
         }
163
-        setDataPermit();
162
+        setDataPermit();*/
164 163
 
165 164
         Gson gson = new Gson();
166 165
         System.out.println("Developer Gate : " + gson.toJson(getSessionManager().getGate()));
@@ -169,14 +168,15 @@ public class HomeActivity extends BaseActivity implements HomeView, StatusScanAd
169 168
     }
170 169
 
171 170
     private void getDataFromService(){
172
-        presenter.getEntryPermit();
171
+        //presenter.getEntryPermit();
173 172
         presenter.getStatusScan();
174 173
         presenter.getDataDevice(idDevice);
175 174
     }
176 175
 
177 176
     private void initEvent(){
178 177
 
179
-        binding.spinnerPermit.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
178
+        // Hide Permintaan dari User
179
+        /*binding.spinnerPermit.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
180 180
             @Override
181 181
             public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
182 182
                 dataEntryPermit = (DataEntryPermit) parent.getItemAtPosition(position);
@@ -186,14 +186,14 @@ public class HomeActivity extends BaseActivity implements HomeView, StatusScanAd
186 186
             public void onNothingSelected(AdapterView<?> parent) {
187 187
                 dataEntryPermit = (DataEntryPermit) parent.getSelectedItem();
188 188
             }
189
-        });
189
+        });*/
190 190
 
191 191
         binding.btnScan.setOnClickListener(v -> {
192 192
 
193
-            if (binding.spinnerPermit.getSelectedItem() == null){
193
+            /*if (binding.spinnerPermit.getSelectedItem() == null){
194 194
                 Toast.makeText(this, "Data Permit Belum Terpilih", Toast.LENGTH_SHORT).show();
195 195
                 return;
196
-            }
196
+            }*/
197 197
 
198 198
             if (idCheckType == null){
199 199
                 Toast.makeText(this, "Status Scan Belum Terpilih", Toast.LENGTH_SHORT).show();
@@ -201,15 +201,14 @@ public class HomeActivity extends BaseActivity implements HomeView, StatusScanAd
201 201
             }
202 202
 
203 203
             Intent intent = new Intent(this, ScanActivity.class);
204
-            intent.putExtra(ScanActivity.ID_PERMIT, String.valueOf(dataEntryPermit.getId()));
204
+            //intent.putExtra(ScanActivity.ID_PERMIT, String.valueOf(dataEntryPermit.getId()));
205
+            intent.putExtra(ScanActivity.ID_PERMIT, "1"); // Hardcode ID Permit ==> 1 even UNUSEFUL
205 206
             intent.putExtra(ScanActivity.ID_DEVICE, idDevice);
206 207
             intent.putExtra(ScanActivity.ID_CHECK_TYPE, idCheckType);
207 208
             intent.putExtra(ScanActivity.CHECK_TYPE_NAME, checkTypeName);
208 209
             startActivity(intent);
209 210
         });
210
-
211 211
         binding.refresh.setOnRefreshListener(this::getDataFromService);
212
-
213 212
     }
214 213
 
215 214
     @Override
@@ -220,8 +219,8 @@ public class HomeActivity extends BaseActivity implements HomeView, StatusScanAd
220 219
 
221 220
     @Override
222 221
     public void showDataPermit(List<DataEntryPermit> dataEntryPermitList) {
223
-        binding.refresh.setRefreshing(false);
224
-        getSessionManager().setPermitList(dataEntryPermitList);
222
+        /*binding.refresh.setRefreshing(false);
223
+        getSessionManager().setPermitList(dataEntryPermitList);*/
225 224
     }
226 225
 
227 226
     @Override
@@ -251,11 +250,11 @@ public class HomeActivity extends BaseActivity implements HomeView, StatusScanAd
251 250
         loadingData();
252 251
     }
253 252
 
254
-    private void setDataPermit(){
253
+    /*private void setDataPermit(){
255 254
         ArrayAdapter<DataEntryPermit> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item,
256 255
                 Stream.of(entryPermitList).filter(DataEntryPermit::getActive).collect(Collectors.toList()));
257 256
         binding.spinnerPermit.setAdapter(adapter);
258
-    }
257
+    }*/
259 258
 
260 259
     private void setDataStatusScan(Integer size){
261 260
         if (size <= 2){

+ 161 - 153
app/src/main/res/layout/activity_scan_result_new.xml

@@ -1,195 +1,203 @@
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:layout_width="match_parent"
5 5
     android:layout_height="match_parent"
6 6
     xmlns:app="http://schemas.android.com/apk/res-auto"
7
-    android:orientation="vertical"
8 7
     tools:context=".ui.scanresult.ScanResultActivity">
9 8
 
10
-    <include layout="@layout/default_toolbar"/>
11
-
12
-    <ScrollView
9
+    <LinearLayout
13 10
         android:layout_width="match_parent"
14
-        android:layout_height="match_parent">
11
+        android:layout_height="wrap_content"
12
+        android:orientation="vertical">
13
+
14
+        <include layout="@layout/default_toolbar"/>
15 15
 
16
-        <RelativeLayout
16
+        <ScrollView
17
+            android:id="@+id/scrollView"
17 18
             android:layout_width="match_parent"
18 19
             android:layout_height="wrap_content">
19 20
 
20
-            <TextView
21
-                android:id="@+id/tv_status_scan"
22
-                style="@style/CommonText"
23
-                android:layout_width="match_parent"
24
-                android:layout_height="wrap_content"
25
-                android:padding="4dp"
26
-                android:gravity="center"
27
-                android:layout_alignParentStart="true"
28
-                android:layout_alignParentEnd="true"
29
-                android:background="@drawable/bg_blue_no_rad"
30
-                tools:text="Check Out Karyawan" />
31
-
32
-            <androidx.cardview.widget.CardView
33
-                android:id="@+id/cv_profile_bio"
21
+            <RelativeLayout
34 22
                 android:layout_width="match_parent"
35
-                android:layout_height="wrap_content"
36
-                android:elevation="12dp"
37
-                android:layout_below="@+id/tv_status_scan"
38
-                android:orientation="vertical"
39
-                app:cardCornerRadius="2dp"
40
-                app:cardUseCompatPadding="true">
23
+                android:layout_height="wrap_content">
41 24
 
42
-                <LinearLayout
43
-                    android:id="@+id/ll_profile_bio"
25
+                <TextView
26
+                    android:id="@+id/tv_status_scan"
27
+                    style="@style/CommonText"
28
+                    android:layout_width="match_parent"
29
+                    android:layout_height="wrap_content"
30
+                    android:padding="4dp"
31
+                    android:gravity="center"
32
+                    android:layout_alignParentStart="true"
33
+                    android:layout_alignParentEnd="true"
34
+                    android:background="@drawable/bg_blue_no_rad"
35
+                    tools:text="Check Out Karyawan" />
36
+
37
+                <androidx.cardview.widget.CardView
38
+                    android:id="@+id/cv_profile_bio"
44 39
                     android:layout_width="match_parent"
45 40
                     android:layout_height="wrap_content"
41
+                    android:elevation="12dp"
46 42
                     android:layout_below="@+id/tv_status_scan"
47
-                    android:layout_margin="2dp"
48 43
                     android:orientation="vertical"
49
-                    android:padding="8dp">
44
+                    app:cardCornerRadius="2dp"
45
+                    app:cardUseCompatPadding="true">
50 46
 
51 47
                     <LinearLayout
48
+                        android:id="@+id/ll_profile_bio"
52 49
                         android:layout_width="match_parent"
53 50
                         android:layout_height="wrap_content"
54
-                        android:orientation="horizontal"
55
-                        tools:ignore="UselessParent">
56
-
57
-                        <ImageView
58
-                            android:id="@+id/iv_profile_image"
59
-                            android:layout_width="80dp"
60
-                            android:layout_height="80dp"
61
-                            android:layout_marginStart="0dp"
62
-                            android:layout_marginEnd="0dp"
63
-                            android:src="@drawable/ic_profile_default"
64
-                            android:contentDescription="@string/cd_image" />
51
+                        android:layout_below="@+id/tv_status_scan"
52
+                        android:layout_margin="2dp"
53
+                        android:orientation="vertical"
54
+                        android:padding="8dp">
65 55
 
66 56
                         <LinearLayout
67 57
                             android:layout_width="match_parent"
68 58
                             android:layout_height="wrap_content"
69
-                            android:orientation="vertical">
70
-
71
-                            <TextView
72
-                                android:id="@+id/tv_rfid_number"
73
-                                style="@style/MyTextLabel"
74
-                                android:layout_width="match_parent"
75
-                                android:layout_height="wrap_content"
76
-                                android:layout_marginStart="8dp"
77
-                                android:gravity="start"
78
-                                tools:text="0009449244" />
79
-
80
-                            <TextView
81
-                                android:id="@+id/tv_profile_name"
82
-                                style="@style/MyTextLabel"
59
+                            android:orientation="horizontal"
60
+                            tools:ignore="UselessParent">
61
+
62
+                            <ImageView
63
+                                android:id="@+id/iv_profile_image"
64
+                                android:layout_width="80dp"
65
+                                android:layout_height="80dp"
66
+                                android:layout_marginStart="0dp"
67
+                                android:layout_marginEnd="0dp"
68
+                                android:src="@drawable/ic_profile_default"
69
+                                android:contentDescription="@string/cd_image" />
70
+
71
+                            <LinearLayout
83 72
                                 android:layout_width="match_parent"
84 73
                                 android:layout_height="wrap_content"
85
-                                android:layout_marginStart="8dp"
86
-                                android:gravity="start"
87
-                                tools:text="HADYAN EL AUFAR" />
88
-
89
-                            <TextView
90
-                                android:id="@+id/tv_structural_position"
91
-                                style="@style/MyTextData"
92
-                                android:layout_width="match_parent"
93
-                                android:layout_height="wrap_content"
94
-                                android:layout_marginStart="8dp"
95
-                                android:gravity="start"
96
-                                tools:text="IT System Development Specialist" />
97
-
98
-                            <TextView
99
-                                android:id="@+id/tv_functional_position"
100
-                                style="@style/MyTextData"
101
-                                android:layout_width="match_parent"
102
-                                android:layout_height="wrap_content"
103
-                                android:layout_marginStart="8dp"
104
-                                android:gravity="start"
105
-                                tools:text="Engineer/Specialist" />
106
-
107
-                            <TextView
108
-                                android:id="@+id/tv_company_name"
109
-                                style="@style/MyTextData"
110
-                                android:layout_width="match_parent"
111
-                                android:layout_height="wrap_content"
112
-                                android:layout_marginStart="8dp"
113
-                                android:gravity="start"
114
-                                tools:text="PT. Berau Coal Energy" />
74
+                                android:orientation="vertical">
75
+
76
+                                <TextView
77
+                                    android:id="@+id/tv_rfid_number"
78
+                                    style="@style/MyTextLabel"
79
+                                    android:layout_width="match_parent"
80
+                                    android:layout_height="wrap_content"
81
+                                    android:layout_marginStart="8dp"
82
+                                    android:gravity="start"
83
+                                    tools:text="0009449244" />
84
+
85
+                                <TextView
86
+                                    android:id="@+id/tv_profile_name"
87
+                                    style="@style/MyTextLabel"
88
+                                    android:layout_width="match_parent"
89
+                                    android:layout_height="wrap_content"
90
+                                    android:layout_marginStart="8dp"
91
+                                    android:gravity="start"
92
+                                    tools:text="HADYAN EL AUFAR" />
93
+
94
+                                <TextView
95
+                                    android:id="@+id/tv_structural_position"
96
+                                    style="@style/MyTextData"
97
+                                    android:layout_width="match_parent"
98
+                                    android:layout_height="wrap_content"
99
+                                    android:layout_marginStart="8dp"
100
+                                    android:gravity="start"
101
+                                    tools:text="IT System Development Specialist" />
102
+
103
+                                <TextView
104
+                                    android:id="@+id/tv_functional_position"
105
+                                    style="@style/MyTextData"
106
+                                    android:layout_width="match_parent"
107
+                                    android:layout_height="wrap_content"
108
+                                    android:layout_marginStart="8dp"
109
+                                    android:gravity="start"
110
+                                    tools:text="Engineer/Specialist" />
111
+
112
+                                <TextView
113
+                                    android:id="@+id/tv_company_name"
114
+                                    style="@style/MyTextData"
115
+                                    android:layout_width="match_parent"
116
+                                    android:layout_height="wrap_content"
117
+                                    android:layout_marginStart="8dp"
118
+                                    android:gravity="start"
119
+                                    tools:text="PT. Berau Coal Energy" />
120
+
121
+                            </LinearLayout>
115 122
 
116 123
                         </LinearLayout>
117 124
 
118 125
                     </LinearLayout>
119 126
 
120
-                </LinearLayout>
127
+                </androidx.cardview.widget.CardView>
121 128
 
122
-            </androidx.cardview.widget.CardView>
123
-
124
-            <LinearLayout
125
-                android:id="@+id/ll_profile_status"
126
-                android:layout_width="160dp"
127
-                android:layout_height="wrap_content"
128
-                android:layout_below="@id/cv_profile_bio"
129
-                android:layout_alignParentStart="true"
130
-                android:layout_alignParentEnd="true"
131
-                android:layout_marginTop="16dp"
132
-                android:layout_marginBottom="16dp"
133
-                android:layout_marginStart="100dp"
134
-                android:layout_marginEnd="100dp"
135
-                android:background="@color/greenPassed">
129
+                <LinearLayout
130
+                    android:id="@+id/ll_profile_status"
131
+                    android:layout_width="160dp"
132
+                    android:layout_height="wrap_content"
133
+                    android:layout_below="@id/cv_profile_bio"
134
+                    android:layout_alignParentStart="true"
135
+                    android:layout_alignParentEnd="true"
136
+                    android:layout_marginTop="16dp"
137
+                    android:layout_marginBottom="16dp"
138
+                    android:layout_marginStart="100dp"
139
+                    android:layout_marginEnd="100dp"
140
+                    android:background="@color/greenPassed">
141
+
142
+                    <TextView
143
+                        android:id="@+id/tv_profile_status"
144
+                        style="@style/CommonText"
145
+                        android:layout_width="match_parent"
146
+                        android:layout_height="wrap_content"
147
+                        android:padding="8dp"
148
+                        android:gravity="center"
149
+                        tools:text="PASSED" />
150
+
151
+                </LinearLayout>
136 152
 
137 153
                 <TextView
138
-                    android:id="@+id/tv_profile_status"
154
+                    android:id="@+id/tv_message"
139 155
                     style="@style/CommonText"
140 156
                     android:layout_width="match_parent"
141 157
                     android:layout_height="wrap_content"
158
+                    android:textColor="@color/colorBlack"
159
+                    android:layout_below="@id/ll_profile_status"
160
+                    android:layout_margin="16dp"
142 161
                     android:padding="8dp"
143 162
                     android:gravity="center"
144
-                    tools:text="PASSED" />
145
-
146
-            </LinearLayout>
163
+                    android:visibility="gone"
164
+                    tools:text="Karyawan ini sudah login pada pukul 16.32 WIB" />
147 165
 
148
-            <TextView
149
-                android:id="@+id/tv_message"
150
-                style="@style/CommonText"
151
-                android:layout_width="match_parent"
152
-                android:layout_height="wrap_content"
153
-                android:textColor="@color/colorBlack"
154
-                android:layout_below="@id/ll_profile_status"
155
-                android:layout_margin="16dp"
156
-                android:padding="8dp"
157
-                android:gravity="center"
158
-                android:visibility="gone"
159
-                tools:text="Karyawan ini sudah login pada pukul 16.32 WIB" />
160
-
161
-            <androidx.recyclerview.widget.RecyclerView
162
-                android:id="@+id/rv_group_problem"
163
-                android:layout_width="match_parent"
164
-                android:layout_height="wrap_content"
165
-                android:layout_margin="8dp"
166
-                android:layout_below="@+id/tv_message"
167
-                tools:listitem="@layout/row_group"
168
-                tools:itemCount="1"/>
169
-
170
-            <Button
171
-                android:id="@+id/btn_home"
172
-                style="@style/ButtonCommon"
173
-                android:background="@color/btn_home"
174
-                android:layout_width="120dp"
175
-                android:layout_height="wrap_content"
176
-                android:layout_below="@id/rv_group_problem"
177
-                android:layout_alignParentStart="true"
178
-                android:layout_margin="16dp"
179
-                android:text="@string/label_home" />
180
-
181
-            <Button
182
-                android:id="@+id/btn_scan_again"
183
-                style="@style/ButtonCommon"
184
-                android:background="@color/btn_scan_other"
185
-                android:layout_width="120dp"
186
-                android:layout_height="wrap_content"
187
-                android:layout_below="@+id/rv_group_problem"
188
-                android:layout_alignParentEnd="true"
189
-                android:layout_margin="16dp"
190
-                android:text="@string/label_scan_other" />
191
-        </RelativeLayout>
192
-
193
-    </ScrollView>
194
-
195
-</LinearLayout>
166
+                <androidx.recyclerview.widget.RecyclerView
167
+                    android:id="@+id/rv_group_problem"
168
+                    android:layout_width="match_parent"
169
+                    android:layout_height="wrap_content"
170
+                    android:layout_margin="8dp"
171
+                    android:layout_below="@+id/tv_message"
172
+                    tools:listitem="@layout/row_group"
173
+                    tools:itemCount="1"/>
174
+
175
+            </RelativeLayout>
176
+
177
+        </ScrollView>
178
+
179
+    </LinearLayout>
180
+
181
+    <Button
182
+        android:id="@+id/btn_home"
183
+        style="@style/ButtonCommon"
184
+        android:background="@color/btn_home"
185
+        android:layout_width="120dp"
186
+        android:layout_height="wrap_content"
187
+        android:layout_alignParentStart="true"
188
+        android:layout_alignParentBottom="true"
189
+        android:layout_margin="16dp"
190
+        android:text="@string/label_home" />
191
+
192
+    <Button
193
+        android:id="@+id/btn_scan_again"
194
+        style="@style/ButtonCommon"
195
+        android:background="@color/btn_scan_other"
196
+        android:layout_width="120dp"
197
+        android:layout_height="wrap_content"
198
+        android:layout_alignParentEnd="true"
199
+        android:layout_alignParentBottom="true"
200
+        android:layout_margin="16dp"
201
+        android:text="@string/label_scan_other" />
202
+
203
+</RelativeLayout>

+ 2 - 2
app/src/main/res/layout/row_group.xml

@@ -9,7 +9,7 @@
9 9
         android:layout_width="match_parent"
10 10
         android:layout_height="wrap_content"
11 11
         android:layout_marginBottom="8dp"
12
-        app:cardBackgroundColor="@color/backgroundLayoutGrey">
12
+        app:cardBackgroundColor="@color/backgroundLayoutGreySoft">
13 13
 
14 14
         <RelativeLayout
15 15
             android:id="@+id/rl_group"
@@ -39,7 +39,7 @@
39 39
 
40 40
                 <TextView
41 41
                     android:id="@+id/tv_group_name"
42
-                    style="@style/MyTextLabel"
42
+                    style="@style/MyTextData"
43 43
                     android:layout_width="wrap_content"
44 44
                     android:layout_height="wrap_content"
45 45
                     android:padding="8dp"

+ 1 - 0
app/src/main/res/values/colors.xml

@@ -18,6 +18,7 @@
18 18
     <color name="backgroundInner">#FFFFFF</color>
19 19
     <color name="backgroundOuter">#F5F5F5</color>
20 20
     <color name="backgroundCanvas">#f2f2f9</color>
21
+    <color name="backgroundLayoutGreySoft">#EFEFF4</color>
21 22
     <color name="backgroundLayoutGrey">#E3E3E9</color>
22 23
     <color name="backgroundLayoutGreyDark">#B4B4B8</color>
23 24
     <color name="backgroundDocument">#E3E3E9</color>