ソースを参照

-Perbaikan layout untuk bagian profil sesudah scan menjadi lebih simpel

ilhamitubagoes 4 年 前
コミット
6aa1e56710

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

@@ -130,11 +130,11 @@ public class ScanResultActivity extends BaseActivity implements ScanResultView {
130 130
     private void setStatusScan(){
131 131
         switch (Integer.parseInt(idCheckType)){
132 132
             case 649 :
133
-                binding.tvStatusScan.setBackground(getDrawable(R.drawable.bg_green));
133
+                binding.tvStatusScan.setBackground(getDrawable(R.drawable.bg_green_no_rad));
134 134
                 break;
135 135
             case 650 :
136 136
             default:
137
-                binding.tvStatusScan.setBackground(getDrawable(R.drawable.bg_blue));
137
+                binding.tvStatusScan.setBackground(getDrawable(R.drawable.bg_blue_no_rad));
138 138
                 break;
139 139
         }
140 140
         binding.tvStatusScan.setText(checkTypeName);

+ 1 - 1
app/src/main/res/drawable/bg_blue.xml

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <shape xmlns:android="http://schemas.android.com/apk/res/android" >
3 3
     <solid android:color="@color/colorBlueDark" />
4
-    <corners android:radius="15dp"/>
4
+    <corners android:radius="8dp"/>
5 5
 </shape>

+ 1 - 1
app/src/main/res/drawable/bg_green.xml

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <shape xmlns:android="http://schemas.android.com/apk/res/android" >
3 3
     <solid android:color="@color/colorPrimary" />
4
-    <corners android:radius="15dp"/>
4
+    <corners android:radius="8dp"/>
5 5
 </shape>

+ 4 - 0
app/src/main/res/drawable/bg_green_no_rad.xml

@@ -0,0 +1,4 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<shape xmlns:android="http://schemas.android.com/apk/res/android" >
3
+    <solid android:color="@color/colorPrimary" />
4
+</shape>

+ 76 - 68
app/src/main/res/layout/activity_scan_result_new.xml

@@ -1,9 +1,9 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2
-<LinearLayout
3
-    xmlns:android="http://schemas.android.com/apk/res/android"
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4 3
     xmlns:tools="http://schemas.android.com/tools"
5 4
     android:layout_width="match_parent"
6 5
     android:layout_height="match_parent"
6
+    xmlns:app="http://schemas.android.com/apk/res-auto"
7 7
     android:orientation="vertical"
8 8
     tools:context=".ui.scanresult.ScanResultActivity">
9 9
 
@@ -26,101 +26,109 @@
26 26
                 android:gravity="center"
27 27
                 android:layout_alignParentStart="true"
28 28
                 android:layout_alignParentEnd="true"
29
-                android:layout_marginTop="16dp"
30
-                android:layout_marginStart="8dp"
31
-                android:layout_marginEnd="8dp"
32 29
                 android:background="@drawable/bg_blue_no_rad"
33 30
                 tools:text="Check Out Karyawan" />
34 31
 
35
-            <LinearLayout
36
-                android:id="@+id/ll_profile_bio"
32
+            <androidx.cardview.widget.CardView
33
+                android:id="@+id/cv_profile_bio"
37 34
                 android:layout_width="match_parent"
38 35
                 android:layout_height="wrap_content"
36
+                android:elevation="12dp"
39 37
                 android:layout_below="@+id/tv_status_scan"
40
-                android:layout_margin="16dp"
41 38
                 android:orientation="vertical"
42
-                android:padding="12dp"
43
-                android:background="@drawable/bg_green">
39
+                app:cardCornerRadius="2dp"
40
+                app:cardUseCompatPadding="true">
44 41
 
45 42
                 <LinearLayout
43
+                    android:id="@+id/ll_profile_bio"
46 44
                     android:layout_width="match_parent"
47 45
                     android:layout_height="wrap_content"
48
-                    android:orientation="horizontal"
49
-                    tools:ignore="UselessParent">
50
-
51
-                    <ImageView
52
-                        android:id="@+id/iv_profile_image"
53
-                        android:layout_width="80dp"
54
-                        android:layout_height="80dp"
55
-                        android:layout_marginStart="0dp"
56
-                        android:layout_marginEnd="0dp"
57
-                        android:src="@drawable/ic_profile_default"
58
-                        android:contentDescription="@string/cd_image" />
46
+                    android:layout_below="@+id/tv_status_scan"
47
+                    android:layout_margin="2dp"
48
+                    android:orientation="vertical"
49
+                    android:padding="8dp">
59 50
 
60 51
                     <LinearLayout
61 52
                         android:layout_width="match_parent"
62 53
                         android:layout_height="wrap_content"
63
-                        android:orientation="vertical">
64
-
65
-                        <TextView
66
-                            android:id="@+id/tv_rfid_number"
67
-                            style="@style/CommonText"
68
-                            android:layout_width="match_parent"
69
-                            android:layout_height="wrap_content"
70
-                            android:layout_marginStart="8dp"
71
-                            android:gravity="start"
72
-                            tools:text="0009449244" />
73
-
74
-                        <TextView
75
-                            android:id="@+id/tv_profile_name"
76
-                            style="@style/CommonText"
77
-                            android:layout_width="match_parent"
78
-                            android:layout_height="wrap_content"
79
-                            android:layout_marginStart="8dp"
80
-                            android:gravity="start"
81
-                            tools:text="HADYAN EL AUFAR" />
82
-
83
-                        <TextView
84
-                            android:id="@+id/tv_structural_position"
85
-                            style="@style/CommonText"
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" />
65
+
66
+                        <LinearLayout
86 67
                             android:layout_width="match_parent"
87 68
                             android:layout_height="wrap_content"
88
-                            android:layout_marginStart="8dp"
89
-                            android:gravity="start"
90
-                            tools:text="IT System Development Specialist" />
91
-
92
-                        <TextView
93
-                            android:id="@+id/tv_functional_position"
94
-                            style="@style/CommonText"
95
-                            android:layout_width="match_parent"
96
-                            android:layout_height="wrap_content"
97
-                            android:layout_marginStart="8dp"
98
-                            android:gravity="start"
99
-                            tools:text="Engineer/Specialist" />
100
-
101
-                        <TextView
102
-                            android:id="@+id/tv_company_name"
103
-                            style="@style/CommonText"
104
-                            android:layout_width="match_parent"
105
-                            android:layout_height="wrap_content"
106
-                            android:layout_marginStart="8dp"
107
-                            android:gravity="start"
108
-                            tools:text="PT. Berau Coal Energy" />
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"
83
+                                android:layout_width="match_parent"
84
+                                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" />
115
+
116
+                        </LinearLayout>
109 117
 
110 118
                     </LinearLayout>
111 119
 
112 120
                 </LinearLayout>
113 121
 
114
-            </LinearLayout>
122
+            </androidx.cardview.widget.CardView>
115 123
 
116 124
             <LinearLayout
117 125
                 android:id="@+id/ll_profile_status"
118 126
                 android:layout_width="160dp"
119 127
                 android:layout_height="wrap_content"
120
-                android:layout_below="@id/ll_profile_bio"
128
+                android:layout_below="@id/cv_profile_bio"
121 129
                 android:layout_alignParentStart="true"
122 130
                 android:layout_alignParentEnd="true"
123
-                android:layout_marginTop="8dp"
131
+                android:layout_marginTop="16dp"
124 132
                 android:layout_marginBottom="16dp"
125 133
                 android:layout_marginStart="100dp"
126 134
                 android:layout_marginEnd="100dp"