Parcourir la source

-Perbaikan layout data dokument yang sudah tidak valid after scan

ilhamitubagoes il y a 4 ans
Parent
commit
ef4b5b3f79

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

@@ -103,10 +103,10 @@ public class ScanResultActivity extends BaseActivity implements ScanResultView {
103 103
         adapter = new ProblemGroupAdapter(this);
104 104
 
105 105
         LinearLayoutManager layoutManager = new LinearLayoutManager(this);
106
-        binding.rvDocumentProblem.setLayoutManager(layoutManager);
107
-        binding.rvDocumentProblem.setItemAnimator(new DefaultItemAnimator());
108
-        binding.rvDocumentProblem.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
109
-        binding.rvDocumentProblem.setAdapter(adapter);
106
+        binding.rvGroupProblem.setLayoutManager(layoutManager);
107
+        binding.rvGroupProblem.setItemAnimator(new DefaultItemAnimator());
108
+        binding.rvGroupProblem.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
109
+        binding.rvGroupProblem.setAdapter(adapter);
110 110
     }
111 111
 
112 112
     private void loadingdata() {

Fichier diff supprimé car celui-ci est trop grand
+ 5 - 0
app/src/main/res/drawable/ic_document_green.xml


+ 7 - 6
app/src/main/res/layout/activity_scan_result_new.xml

@@ -120,7 +120,8 @@
120 120
                 android:layout_below="@id/ll_profile_bio"
121 121
                 android:layout_alignParentStart="true"
122 122
                 android:layout_alignParentEnd="true"
123
-                android:layout_marginTop="16dp"
123
+                android:layout_marginTop="8dp"
124
+                android:layout_marginBottom="16dp"
124 125
                 android:layout_marginStart="100dp"
125 126
                 android:layout_marginEnd="100dp"
126 127
                 android:background="@color/colorPrimary">
@@ -150,13 +151,13 @@
150 151
                 tools:text="Karyawan ini sudah login pada pukul 16.32 WIB" />
151 152
 
152 153
             <androidx.recyclerview.widget.RecyclerView
153
-                android:id="@+id/rv_document_problem"
154
+                android:id="@+id/rv_group_problem"
154 155
                 android:layout_width="match_parent"
155 156
                 android:layout_height="wrap_content"
156 157
                 android:layout_margin="8dp"
157 158
                 android:layout_below="@+id/tv_message"
158
-                tools:listitem="@layout/row_document"
159
-                tools:itemCount="2"/>
159
+                tools:listitem="@layout/row_group"
160
+                tools:itemCount="1"/>
160 161
 
161 162
             <Button
162 163
                 android:id="@+id/btn_home"
@@ -164,7 +165,7 @@
164 165
                 android:background="@color/btn_home"
165 166
                 android:layout_width="120dp"
166 167
                 android:layout_height="wrap_content"
167
-                android:layout_below="@id/rv_document_problem"
168
+                android:layout_below="@id/rv_group_problem"
168 169
                 android:layout_alignParentStart="true"
169 170
                 android:layout_margin="16dp"
170 171
                 android:text="@string/label_home" />
@@ -175,7 +176,7 @@
175 176
                 android:background="@color/btn_scan_other"
176 177
                 android:layout_width="120dp"
177 178
                 android:layout_height="wrap_content"
178
-                android:layout_below="@+id/rv_document_problem"
179
+                android:layout_below="@+id/rv_group_problem"
179 180
                 android:layout_alignParentEnd="true"
180 181
                 android:layout_margin="16dp"
181 182
                 android:text="@string/label_scan_other" />

+ 69 - 41
app/src/main/res/layout/row_document.xml

@@ -1,46 +1,74 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
+<androidx.cardview.widget.CardView
3
+    xmlns:android="http://schemas.android.com/apk/res/android"
3 4
     xmlns:tools="http://schemas.android.com/tools"
4
-    android:orientation="horizontal"
5
-    android:layout_width="match_parent"
5
+    xmlns:app="http://schemas.android.com/apk/res-auto"
6
+    android:id="@+id/cv_document_problem"
7
+    android:layout_width="wrap_content"
6 8
     android:layout_height="wrap_content"
7
-    android:background="@color/backgroundLayoutGreyDark"
8
-    android:padding="16dp"
9
-    android:layout_margin="16dp">
10
-
11
-    <TextView
12
-        android:id="@+id/tv_document_name"
13
-        style="@style/DocumentText"
14
-        android:layout_width="70dp"
15
-        android:layout_height="wrap_content"
16
-        android:layout_marginStart="4dp"
17
-        android:layout_marginEnd="4dp"
18
-        android:layout_alignParentStart="true"
19
-        android:layout_centerVertical="true"
20
-        tools:text="ID CARD KARYAWAN" />
21
-
22
-    <TextView
23
-        android:id="@+id/tv_document_status"
24
-        style="@style/DocumentText"
25
-        android:layout_width="55dp"
26
-        android:layout_height="wrap_content"
27
-        android:layout_marginStart="4dp"
28
-        android:layout_marginEnd="4dp"
29
-        android:layout_alignParentStart="true"
30
-        android:layout_alignParentEnd="true"
31
-        android:layout_centerVertical="true"
32
-        android:gravity="center"
33
-        tools:text="NOT FOUND" />
34
-
35
-    <TextView
36
-        android:id="@+id/tv_document_date"
37
-        style="@style/DocumentText"
38
-        android:layout_width="55dp"
9
+    android:elevation="12dp"
10
+    app:cardCornerRadius="6dp"
11
+    app:cardElevation="5dp"
12
+    app:cardUseCompatPadding="true">
13
+
14
+    <LinearLayout
15
+        android:id="@+id/layout_my_leaderboard"
16
+        android:layout_width="match_parent"
39 17
         android:layout_height="wrap_content"
40
-        android:layout_marginStart="4dp"
41
-        android:layout_marginEnd="4dp"
42
-        android:layout_alignParentEnd="true"
43
-        android:layout_centerVertical="true"
44
-        tools:text="19 Nov 2019" />
18
+        android:layout_gravity="bottom|center_horizontal"
19
+        android:paddingTop="10dp"
20
+        android:paddingBottom="10dp">
21
+
22
+        <LinearLayout
23
+            android:layout_width="150dp"
24
+            android:layout_height="match_parent"
25
+            android:layout_marginStart="10dp"
26
+            android:gravity="center_vertical"
27
+            android:orientation="vertical">
28
+
29
+            <TextView
30
+                android:id="@+id/tv_document_name"
31
+                style="@style/MyTextLabel"
32
+                android:layout_width="150dp"
33
+                android:layout_height="0dp"
34
+                android:layout_weight="3"
35
+                tools:text="KMPD - SIMPER MARINE CERTIFICATION" />
36
+
37
+            <TextView
38
+                android:id="@+id/tv_document_status"
39
+                style="@style/MyTextData"
40
+                android:layout_width="150dp"
41
+                android:layout_height="wrap_content"
42
+                tools:text="NOT ACTIVE" />
43
+
44
+        </LinearLayout>
45
+
46
+        <RelativeLayout
47
+            android:layout_width="wrap_content"
48
+            android:layout_height="match_parent">
49
+
50
+            <LinearLayout
51
+                android:layout_width="wrap_content"
52
+                android:layout_height="wrap_content"
53
+                android:layout_alignParentEnd="true"
54
+                android:layout_marginEnd="15dp"
55
+                android:gravity="center_vertical"
56
+                android:layout_centerVertical="true"
57
+                android:orientation="vertical">
58
+
59
+                <TextView
60
+                    android:id="@+id/tv_document_date"
61
+                    style="@style/MyTextData"
62
+                    android:layout_width="135dp"
63
+                    android:layout_height="wrap_content"
64
+                    android:layout_gravity="center"
65
+                    android:gravity="center"
66
+                    android:scaleType="centerInside"
67
+                    android:src="@color/colorPrimary"
68
+                    tools:text="12 Nov 2020"/>
69
+
70
+            </LinearLayout>
71
+        </RelativeLayout>
45 72
 
46
-</RelativeLayout>
73
+    </LinearLayout>
74
+</androidx.cardview.widget.CardView>

+ 60 - 36
app/src/main/res/layout/row_group.xml

@@ -5,46 +5,70 @@
5 5
     android:layout_width="match_parent"
6 6
     android:layout_height="wrap_content">
7 7
 
8
-    <RelativeLayout
9
-        android:id="@+id/rl_group"
8
+    <androidx.cardview.widget.CardView
10 9
         android:layout_width="match_parent"
11 10
         android:layout_height="wrap_content"
12
-        android:background="@color/backgroundLayoutGrey"
13
-        android:padding="8dp"
14
-        android:layout_margin="16dp">
15
-
16
-        <TextView
17
-            android:id="@+id/tv_group_name"
18
-            style="@style/DocumentText"
19
-            android:layout_width="300dp"
20
-            android:layout_height="wrap_content"
21
-            android:layout_marginStart="4dp"
22
-            android:layout_marginEnd="4dp"
23
-            android:layout_alignParentStart="true"
24
-            android:gravity="center_vertical"
25
-            tools:text="ID CARD KARYAWAN" />
26
-
27
-        <ImageView
28
-            android:id="@+id/iv_chevron"
29
-            android:layout_width="15dp"
30
-            android:layout_height="15dp"
31
-            android:paddingStart="0dp"
32
-            android:paddingEnd="0dp"
33
-            android:layout_alignParentEnd="true"
34
-            android:gravity="center_vertical"
35
-            app:srcCompat="@drawable/chevron_down"
36
-            android:contentDescription="@string/cd_image" />
37
-
38
-        <androidx.recyclerview.widget.RecyclerView
39
-            android:id="@+id/rv_sub_group"
11
+        app:cardBackgroundColor="@color/backgroundLayoutGrey">
12
+
13
+        <RelativeLayout
14
+            android:id="@+id/rl_group"
40 15
             android:layout_width="match_parent"
41 16
             android:layout_height="wrap_content"
42
-            android:layout_below="@+id/tv_group_name"
43
-            android:layout_marginTop="8dp"
44
-            android:visibility="gone"
45
-            tools:listitem="@layout/row_document"
46
-            tools:itemCount="2"/>
17
+            android:padding="4dp"
18
+            android:layout_margin="8dp">
19
+
20
+            <LinearLayout
21
+                android:id="@+id/ll_groups"
22
+                android:layout_width="wrap_content"
23
+                android:layout_height="wrap_content"
24
+                android:maxWidth="300dp"
25
+                android:padding="1dp"
26
+                android:layout_marginStart="4dp"
27
+                android:layout_marginEnd="4dp"
28
+                android:layout_alignParentStart="true">
29
+
30
+                <ImageView
31
+                    android:layout_width="20dp"
32
+                    android:layout_height="20dp"
33
+                    android:layout_marginStart="4dp"
34
+                    android:layout_gravity="center_vertical"
35
+                    android:src="@drawable/ic_document_green"
36
+                    android:contentDescription="@string/cd_image" />
37
+
38
+                <TextView
39
+                    android:id="@+id/tv_group_name"
40
+                    style="@style/MyTextLabel"
41
+                    android:layout_width="wrap_content"
42
+                    android:layout_height="wrap_content"
43
+                    android:padding="8dp"
44
+                    android:gravity="center_vertical"
45
+                    tools:text="Izin Usaha" />
46
+
47
+            </LinearLayout>
48
+
49
+            <ImageView
50
+                android:id="@+id/iv_chevron"
51
+                android:layout_width="15dp"
52
+                android:layout_height="15dp"
53
+                android:paddingStart="0dp"
54
+                android:paddingEnd="0dp"
55
+                android:layout_alignParentEnd="true"
56
+                android:gravity="center_vertical"
57
+                app:srcCompat="@drawable/chevron_down"
58
+                android:contentDescription="@string/cd_image" />
59
+
60
+            <androidx.recyclerview.widget.RecyclerView
61
+                android:id="@+id/rv_sub_group"
62
+                android:layout_width="match_parent"
63
+                android:layout_height="wrap_content"
64
+                android:layout_below="@+id/ll_groups"
65
+                android:layout_marginTop="8dp"
66
+                android:visibility="gone"
67
+                tools:listitem="@layout/row_document"
68
+                tools:itemCount="2"/>
69
+
70
+        </RelativeLayout>
47 71
 
48
-    </RelativeLayout>
72
+    </androidx.cardview.widget.CardView>
49 73
 
50 74
 </ScrollView>

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

@@ -7,6 +7,8 @@
7 7
     <color name="colorRedDark">#C51616</color>
8 8
     <color name="colorGreenDark">#19771D</color>
9 9
     <color name="colorBlueDark">#195677</color>
10
+    <color name="greenSoft">#27AE5D</color>
11
+    <color name="greenDark">#249852</color>
10 12
 
11 13
     <color name="btn_home">#9CA7AE</color>
12 14
     <color name="btn_scan_other">#64A64B</color>

+ 18 - 0
app/src/main/res/values/dimens.xml

@@ -0,0 +1,18 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<resources xmlns:tools="http://schemas.android.com/tools">
3
+
4
+    <!-- Standard Metrics -->
5
+    <dimen name="spacing_large">24dp</dimen>
6
+    <dimen name="spacing_normal">8dp</dimen>
7
+    <dimen name="spacing_micro">4dp</dimen>
8
+    <dimen name="padding_small">8dp</dimen>
9
+    <dimen name="padding_normal">16dp</dimen>
10
+    <dimen name="padding_large">24dp</dimen>
11
+
12
+    <!-- App Primary Text Sizes -->
13
+    <dimen name="app_text_size_small">12sp</dimen>
14
+    <dimen name="app_text_size_medium">14sp</dimen>
15
+    <dimen name="app_text_size_large">19sp</dimen>
16
+    <dimen name="app_text_size_xlarge">21sp</dimen>
17
+
18
+</resources>

+ 11 - 0
app/src/main/res/values/styles.xml

@@ -42,6 +42,17 @@
42 42
         <item name="android:textColor">@color/colorBlack</item>
43 43
     </style>
44 44
 
45
+    <style name="MyTextLabel">
46
+        <item name="android:textSize">@dimen/app_text_size_medium</item>
47
+        <item name="android:textColor">@color/colorBlack</item>
48
+        <item name="android:textStyle">bold</item>
49
+    </style>
50
+
51
+    <style name="MyTextData">
52
+        <item name="android:textSize">@dimen/app_text_size_medium</item>
53
+        <item name="android:textColor">@color/grey</item>
54
+    </style>
55
+
45 56
     <style name="spinner_style">
46 57
         <item name="android:layout_width">match_parent</item>
47 58
         <item name="android:layout_height">wrap_content</item>