diff --git a/app/src/main/java/com/example/hpostesting/presentation/adapter/UserListAdapter.kt b/app/src/main/java/com/example/hpostesting/presentation/adapter/UserListAdapter.kt index cd52b4d..2226011 100644 --- a/app/src/main/java/com/example/hpostesting/presentation/adapter/UserListAdapter.kt +++ b/app/src/main/java/com/example/hpostesting/presentation/adapter/UserListAdapter.kt @@ -190,14 +190,14 @@ class UserListAdapter( // } } userCard.setOnClickListener { - if (batLevel < 40) { - Toast.makeText( - view.context, - "Battery level is low than 40%, please charge the device to continue testing", - Toast.LENGTH_SHORT - ).show() - return@setOnClickListener - } +// if (batLevel < 40) { +// Toast.makeText( +// view.context, +// "Battery level is low than 40%, please charge the device to continue testing", +// Toast.LENGTH_SHORT +// ).show() +// return@setOnClickListener +// } if (model.testStatus != null) { if (model.testStatus!!) { Toast.makeText( diff --git a/app/src/main/java/com/example/hpostesting/presentation/dashboard/HomeFragment.kt b/app/src/main/java/com/example/hpostesting/presentation/dashboard/HomeFragment.kt index 1a6995f..df738e3 100644 --- a/app/src/main/java/com/example/hpostesting/presentation/dashboard/HomeFragment.kt +++ b/app/src/main/java/com/example/hpostesting/presentation/dashboard/HomeFragment.kt @@ -137,10 +137,10 @@ class HomeFragment : Fragment() { val dateFormat = SimpleDateFormat("yyyy-MM-dd") val currentDate = Date() val formattedDate = dateFormat.format(currentDate) - val query = Firebase.firestore.collection("patientData") - .whereGreaterThanOrEqualTo("createdAt", formattedDate) - .orderBy("createdAt", Query.Direction.DESCENDING) -// val query = Firebase.firestore.collection("patientData").whereEqualTo("testStatus", false) +// val query = Firebase.firestore.collection("patientData") +// .whereGreaterThanOrEqualTo("createdAt", formattedDate) +// .orderBy("createdAt", Query.Direction.DESCENDING) + val query = Firebase.firestore.collection("patientData").whereEqualTo("testStatus", false) query.get().addOnSuccessListener { if (it.documents.isEmpty()) { binding.pendingTest.visibility = View.VISIBLE diff --git a/app/src/main/java/com/example/hpostesting/presentation/testRight/UsbService.kt b/app/src/main/java/com/example/hpostesting/presentation/testRight/UsbService.kt index 5d3aab2..6f5e98e 100644 --- a/app/src/main/java/com/example/hpostesting/presentation/testRight/UsbService.kt +++ b/app/src/main/java/com/example/hpostesting/presentation/testRight/UsbService.kt @@ -34,7 +34,7 @@ class UsbService : Service() { fun connect(driver: UsbSerialDriver, connection: UsbDeviceConnection) { mPort = driver.ports[0] // Most devices have just one port (port 0) mPort.open(connection) - mPort.setParameters(115200, 8, UsbSerialPort.STOPBITS_1, UsbSerialPort.PARITY_NONE) + mPort.setParameters(9600, 8, UsbSerialPort.STOPBITS_1, UsbSerialPort.PARITY_NONE) isUsbConnected = true Log.d(TAG, "My Usb Connected ${mPort.driver}")