Browse Source

-Perbaikan layout (Padding, Margin, Color)

ilhamitubagoes 4 years ago
parent
commit
0b93ce85b8

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

@@ -9,7 +9,6 @@ import android.widget.Toast;
9
 
9
 
10
 import androidx.appcompat.widget.Toolbar;
10
 import androidx.appcompat.widget.Toolbar;
11
 import androidx.recyclerview.widget.DefaultItemAnimator;
11
 import androidx.recyclerview.widget.DefaultItemAnimator;
12
-import androidx.recyclerview.widget.DividerItemDecoration;
13
 import androidx.recyclerview.widget.LinearLayoutManager;
12
 import androidx.recyclerview.widget.LinearLayoutManager;
14
 
13
 
15
 import com.annimon.stream.Collectors;
14
 import com.annimon.stream.Collectors;
@@ -105,7 +104,6 @@ public class ScanResultActivity extends BaseActivity implements ScanResultView {
105
         LinearLayoutManager layoutManager = new LinearLayoutManager(this);
104
         LinearLayoutManager layoutManager = new LinearLayoutManager(this);
106
         binding.rvGroupProblem.setLayoutManager(layoutManager);
105
         binding.rvGroupProblem.setLayoutManager(layoutManager);
107
         binding.rvGroupProblem.setItemAnimator(new DefaultItemAnimator());
106
         binding.rvGroupProblem.setItemAnimator(new DefaultItemAnimator());
108
-        binding.rvGroupProblem.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
109
         binding.rvGroupProblem.setAdapter(adapter);
107
         binding.rvGroupProblem.setAdapter(adapter);
110
     }
108
     }
111
 
109
 
@@ -167,22 +165,22 @@ public class ScanResultActivity extends BaseActivity implements ScanResultView {
167
 
165
 
168
         if (dataResultRfid.getPassed()) {
166
         if (dataResultRfid.getPassed()) {
169
             binding.tvProfileStatus.setText(R.string.label_status_passed);
167
             binding.tvProfileStatus.setText(R.string.label_status_passed);
170
-            binding.llProfileStatus.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
168
+            binding.llProfileStatus.setBackgroundColor(getResources().getColor(R.color.greenPassed));
171
         } else {
169
         } else {
172
             if (dataResultRfid.getAlertType() != null) {
170
             if (dataResultRfid.getAlertType() != null) {
173
                 if (dataResultRfid.getAlertType().equalsIgnoreCase("ERROR")) {
171
                 if (dataResultRfid.getAlertType().equalsIgnoreCase("ERROR")) {
174
                     binding.tvProfileStatus.setText(R.string.label_status_not_passed);
172
                     binding.tvProfileStatus.setText(R.string.label_status_not_passed);
175
-                    binding.llProfileStatus.setBackgroundColor(getResources().getColor(R.color.colorRedDark));
173
+                    binding.llProfileStatus.setBackgroundColor(getResources().getColor(R.color.redNotPassed));
176
                 }
174
                 }
177
 
175
 
178
                 if (dataResultRfid.getAlertType().equalsIgnoreCase("WARNING")) {
176
                 if (dataResultRfid.getAlertType().equalsIgnoreCase("WARNING")) {
179
                     binding.tvProfileStatus.setText(R.string.label_status_not_valid);
177
                     binding.tvProfileStatus.setText(R.string.label_status_not_valid);
180
-                    binding.llProfileStatus.setBackgroundColor(getResources().getColor(R.color.colorRedDark));
178
+                    binding.llProfileStatus.setBackgroundColor(getResources().getColor(R.color.redNotPassed));
181
                 }
179
                 }
182
 
180
 
183
             } else {
181
             } else {
184
                 binding.tvProfileStatus.setText(R.string.label_status_not_passed);
182
                 binding.tvProfileStatus.setText(R.string.label_status_not_passed);
185
-                binding.llProfileStatus.setBackgroundColor(getResources().getColor(R.color.colorRedDark));
183
+                binding.llProfileStatus.setBackgroundColor(getResources().getColor(R.color.redNotPassed));
186
             }
184
             }
187
         }
185
         }
188
 
186
 

+ 1 - 1
app/src/main/res/layout/activity_scan_result_new.xml

@@ -124,7 +124,7 @@
124
                 android:layout_marginBottom="16dp"
124
                 android:layout_marginBottom="16dp"
125
                 android:layout_marginStart="100dp"
125
                 android:layout_marginStart="100dp"
126
                 android:layout_marginEnd="100dp"
126
                 android:layout_marginEnd="100dp"
127
-                android:background="@color/colorPrimary">
127
+                android:background="@color/greenPassed">
128
 
128
 
129
                 <TextView
129
                 <TextView
130
                     android:id="@+id/tv_profile_status"
130
                     android:id="@+id/tv_profile_status"

+ 1 - 0
app/src/main/res/layout/row_group.xml

@@ -8,6 +8,7 @@
8
     <androidx.cardview.widget.CardView
8
     <androidx.cardview.widget.CardView
9
         android:layout_width="match_parent"
9
         android:layout_width="match_parent"
10
         android:layout_height="wrap_content"
10
         android:layout_height="wrap_content"
11
+        android:layout_marginBottom="8dp"
11
         app:cardBackgroundColor="@color/backgroundLayoutGrey">
12
         app:cardBackgroundColor="@color/backgroundLayoutGrey">
12
 
13
 
13
         <RelativeLayout
14
         <RelativeLayout

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

@@ -7,6 +7,8 @@
7
     <color name="colorRedDark">#C51616</color>
7
     <color name="colorRedDark">#C51616</color>
8
     <color name="colorGreenDark">#19771D</color>
8
     <color name="colorGreenDark">#19771D</color>
9
     <color name="colorBlueDark">#195677</color>
9
     <color name="colorBlueDark">#195677</color>
10
+    <color name="redNotPassed">#E15555</color>
11
+    <color name="greenPassed">#54BC5A</color>
10
     <color name="greenSoft">#27AE5D</color>
12
     <color name="greenSoft">#27AE5D</color>
11
     <color name="greenDark">#249852</color>
13
     <color name="greenDark">#249852</color>
12
 
14
 
@@ -18,6 +20,7 @@
18
     <color name="backgroundCanvas">#f2f2f9</color>
20
     <color name="backgroundCanvas">#f2f2f9</color>
19
     <color name="backgroundLayoutGrey">#E3E3E9</color>
21
     <color name="backgroundLayoutGrey">#E3E3E9</color>
20
     <color name="backgroundLayoutGreyDark">#B4B4B8</color>
22
     <color name="backgroundLayoutGreyDark">#B4B4B8</color>
23
+    <color name="backgroundDocument">#E3E3E9</color>
21
 
24
 
22
     <color name="colorWhite">#FFFFFF</color>
25
     <color name="colorWhite">#FFFFFF</color>
23
     <color name="colorBlack">#000000</color>
26
     <color name="colorBlack">#000000</color>