Преглед на файлове

-fixing null when get alert type
-add toast when there are message in response

ilhamitubagoes преди 4 години
родител
ревизия
51139531dc
променени са 1 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 9 0
      app/src/main/java/com/fusi24/rfid/ui/scanresult/ScanResultActivity.java

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

@@ -165,6 +165,11 @@ public class ScanResultActivity extends BaseActivity implements ScanResultView {
165 165
             tvProfileStatus.setText(R.string.label_status_passed);
166 166
             llProfileStatus.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
167 167
         } else {
168
+            if (dataResultRfid.getAlertType() == null){
169
+                tvProfileStatus.setText(R.string.label_status_not_passed);
170
+                llProfileStatus.setBackgroundColor(getResources().getColor(R.color.colorRedDark));
171
+            }
172
+
168 173
             if (dataResultRfid.getAlertType().equalsIgnoreCase("ERROR")){
169 174
                 tvProfileStatus.setText(R.string.label_status_not_passed);
170 175
                 llProfileStatus.setBackgroundColor(getResources().getColor(R.color.colorRedDark));
@@ -176,6 +181,10 @@ public class ScanResultActivity extends BaseActivity implements ScanResultView {
176 181
             }
177 182
         }
178 183
 
184
+        if (dataResultRfid.getMessage() != null){
185
+            Toast.makeText(this, dataResultRfid.getMessage(), Toast.LENGTH_SHORT).show();
186
+        }
187
+
179 188
         problemsList = dataResultRfid.getProblems();
180 189
         adapter.updateProblemList(problemsList);
181 190
         adapter.notifyDataSetChanged();