瀏覽代碼

-Add default check in when open home in toggle button

ilhamitubagoes 4 年之前
父節點
當前提交
546bedaeb0
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      app/src/main/java/com/fusi24/rfid/ui/home/HomeActivity.java

+ 5 - 0
app/src/main/java/com/fusi24/rfid/ui/home/HomeActivity.java

@@ -225,6 +225,11 @@ public class HomeActivity extends BaseActivity implements HomeView, StatusScanAd
225 225
             binding.rvStatusScan.setVisibility(View.VISIBLE);
226 226
         }
227 227
 
228
+        // Inisiasi pertama saat muncul halaman default true
229
+        binding.swStatusScan.setOn(true);
230
+        idCheckType = statusScanList.get(0).getId(); // <-- Check In Code (649)
231
+        checkTypeName = statusScanList.get(0).getName(); // <-- Check In Name
232
+
228 233
         binding.swStatusScan.setLabelOn(statusScanList.get(0).getName());
229 234
         binding.swStatusScan.setLabelOff(statusScanList.get(1).getName());
230 235