Compare commits
6 Commits
logoutAuto
...
Bloodgroup
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94ae7310f4 | ||
|
|
c3810b9a92 | ||
|
|
47c6bba0d7 | ||
|
|
5fe18c9d3d | ||
|
|
5349376815 | ||
|
|
4ca17c0fa6 |
@@ -20,7 +20,4 @@ interface HemoCubeDao {
|
|||||||
|
|
||||||
@Query("DELETE FROM hemo_cube_test_table WHERE _id = :id")
|
@Query("DELETE FROM hemo_cube_test_table WHERE _id = :id")
|
||||||
suspend fun deleteById(id: String)
|
suspend fun deleteById(id: String)
|
||||||
|
|
||||||
@Query("UPDATE hemo_cube_test_table SET localFlag = :newValue WHERE _id = :id")
|
|
||||||
suspend fun updateFieldById(id: String, newValue: Boolean)
|
|
||||||
}
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.example.hpostesting.data.model.patient
|
|
||||||
|
|
||||||
data class BufferCheckData(
|
|
||||||
var kitno: String = "",
|
|
||||||
var deviceId: String? = "",
|
|
||||||
var appVersion:String? = "",
|
|
||||||
var deviceSerialNumber: String = "",
|
|
||||||
var deviceType: String = "HEMOCUBE",
|
|
||||||
var resultData: String = "",
|
|
||||||
var led1Buffer: Double? = null,
|
|
||||||
var led2Buffer: Double? = null,
|
|
||||||
var led1Sample: Double? = null,
|
|
||||||
var led2Sample: Double? = null,
|
|
||||||
var led1Average: Double? = null,
|
|
||||||
var led2Average: Double? = null,
|
|
||||||
var deviceRatio: Double? = null,
|
|
||||||
var calculatedRatio: Double? = null,
|
|
||||||
var classificationResult: String = ""
|
|
||||||
)
|
|
||||||
@@ -1,19 +1,25 @@
|
|||||||
package com.example.hpostesting.data.repository
|
package com.example.hpostesting.data.repository
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
import androidx.room.Room
|
||||||
|
import com.example.hpostesting.data.dao.MyDatabase
|
||||||
import com.example.hpostesting.data.model.PendingUploads
|
import com.example.hpostesting.data.model.PendingUploads
|
||||||
import com.example.hpostesting.data.model.Response
|
import com.example.hpostesting.data.model.Response
|
||||||
import com.example.hpostesting.data.model.patient.BufferCheckData
|
|
||||||
import com.example.hpostesting.data.model.patient.DeviceData
|
import com.example.hpostesting.data.model.patient.DeviceData
|
||||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||||
import com.example.hpostesting.data.model.patient.UserData
|
import com.example.hpostesting.data.model.patient.UserData
|
||||||
|
import com.google.android.datatransport.runtime.dagger.Provides
|
||||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||||
import com.google.firebase.firestore.FirebaseFirestore
|
import com.google.firebase.firestore.FirebaseFirestore
|
||||||
import com.google.firebase.firestore.ktx.firestore
|
import com.google.firebase.firestore.ktx.firestore
|
||||||
import com.google.firebase.ktx.Firebase
|
import com.google.firebase.ktx.Firebase
|
||||||
import com.google.firebase.storage.ktx.storage
|
import com.google.firebase.storage.ktx.storage
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.tasks.await
|
import kotlinx.coroutines.tasks.await
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import javax.inject.Singleton
|
||||||
|
|
||||||
class DatabaseRepository : Repository {
|
class DatabaseRepository : Repository {
|
||||||
|
|
||||||
@@ -51,16 +57,6 @@ class DatabaseRepository : Repository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun addTestToDatabaseforBufferCheck(data: BufferCheckData?): Response<String> {
|
|
||||||
return try {
|
|
||||||
db.collection("buffers").add(data!!).await()
|
|
||||||
Response.Success(data!!.kitno)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Firebase.crashlytics.recordException(e)
|
|
||||||
Response.Error(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun uploadFileToStorage(patientID: String, filePath: String): Response<Boolean> {
|
suspend fun uploadFileToStorage(patientID: String, filePath: String): Response<Boolean> {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ package com.example.hpostesting.presentation.adapter
|
|||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.AlertDialog
|
import android.app.AlertDialog
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Context.INPUT_METHOD_SERVICE
|
|
||||||
import android.view.inputmethod.InputMethodManager
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
@@ -16,6 +14,8 @@ import com.example.hpostesting.data.DataHolder
|
|||||||
import com.example.hpostesting.data.model.patient.UserData
|
import com.example.hpostesting.data.model.patient.UserData
|
||||||
import com.firebase.ui.firestore.FirestoreRecyclerAdapter
|
import com.firebase.ui.firestore.FirestoreRecyclerAdapter
|
||||||
import com.firebase.ui.firestore.FirestoreRecyclerOptions
|
import com.firebase.ui.firestore.FirestoreRecyclerOptions
|
||||||
|
import com.google.firebase.firestore.ktx.firestore
|
||||||
|
import com.google.firebase.ktx.Firebase
|
||||||
import `in`.sminnovations.hpostesting.R
|
import `in`.sminnovations.hpostesting.R
|
||||||
import `in`.sminnovations.hpostesting.databinding.UserItemViewBinding
|
import `in`.sminnovations.hpostesting.databinding.UserItemViewBinding
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
@@ -23,9 +23,8 @@ import java.util.Calendar
|
|||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import android.widget.AutoCompleteTextView
|
import android.widget.AutoCompleteTextView
|
||||||
import androidx.core.content.ContextCompat.getSystemService
|
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||||
import androidx.core.content.getSystemService
|
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||||
import androidx.fragment.app.FragmentActivity
|
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||||
import com.google.firebase.firestore.FirebaseFirestore
|
import com.google.firebase.firestore.FirebaseFirestore
|
||||||
|
|
||||||
@@ -36,7 +35,6 @@ class UserListAdapter(
|
|||||||
options: FirestoreRecyclerOptions<UserData>,
|
options: FirestoreRecyclerOptions<UserData>,
|
||||||
private val view: View,
|
private val view: View,
|
||||||
private val batLevel: Int,
|
private val batLevel: Int,
|
||||||
private val requireActivity: FragmentActivity
|
|
||||||
) : FirestoreRecyclerAdapter<UserData, UserListAdapter.OrderItemViewHolder>(options) {
|
) : FirestoreRecyclerAdapter<UserData, UserListAdapter.OrderItemViewHolder>(options) {
|
||||||
|
|
||||||
class OrderItemViewHolder(val binding: UserItemViewBinding) :
|
class OrderItemViewHolder(val binding: UserItemViewBinding) :
|
||||||
@@ -54,7 +52,7 @@ class UserListAdapter(
|
|||||||
userName.text = "Name: ${model.name}"
|
userName.text = "Name: ${model.name}"
|
||||||
userId.text = "User ID:${model._id}"
|
userId.text = "User ID:${model._id}"
|
||||||
if (model.incubationTime == "") {
|
if (model.incubationTime == "") {
|
||||||
btnBlood.visibility = View.VISIBLE
|
|
||||||
} else {
|
} else {
|
||||||
userId.text =
|
userId.text =
|
||||||
"User ID:${model._id} \n Time: ${isBetween15And30Minutes(model.incubationTime)} \n Started at: ${
|
"User ID:${model._id} \n Time: ${isBetween15And30Minutes(model.incubationTime)} \n Started at: ${
|
||||||
@@ -64,7 +62,7 @@ class UserListAdapter(
|
|||||||
).parse(model.incubationTime)!!
|
).parse(model.incubationTime)!!
|
||||||
)
|
)
|
||||||
}"
|
}"
|
||||||
btnBlood.visibility = View.GONE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -77,18 +75,6 @@ class UserListAdapter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
holder.binding.btnBlood.setOnClickListener {
|
holder.binding.btnBlood.setOnClickListener {
|
||||||
val view: View? = requireActivity.currentFocus
|
|
||||||
|
|
||||||
// on below line checking if view is not null.
|
|
||||||
if (view != null) {
|
|
||||||
// on below line we are creating a variable
|
|
||||||
// for input manager and initializing it.
|
|
||||||
val inputMethodManager =
|
|
||||||
context.getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
|
|
||||||
|
|
||||||
// on below line hiding our keyboard.
|
|
||||||
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
|
|
||||||
}
|
|
||||||
val inflater = LayoutInflater.from(context)
|
val inflater = LayoutInflater.from(context)
|
||||||
val dialogView = inflater.inflate(R.layout.dialog_custom, null)
|
val dialogView = inflater.inflate(R.layout.dialog_custom, null)
|
||||||
|
|
||||||
@@ -119,11 +105,7 @@ class UserListAdapter(
|
|||||||
val document = userdata.documents[0]
|
val document = userdata.documents[0]
|
||||||
db.collection("patientData")
|
db.collection("patientData")
|
||||||
.document(document.id)
|
.document(document.id)
|
||||||
.update("bloodGroup", bloodGroup,
|
.update("bloodGroup", bloodGroup)
|
||||||
"incubationTime", SimpleDateFormat(
|
|
||||||
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
|
||||||
).format(Calendar.getInstance().time).toString()
|
|
||||||
)
|
|
||||||
.addOnSuccessListener {
|
.addOnSuccessListener {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
context,
|
context,
|
||||||
@@ -131,6 +113,24 @@ class UserListAdapter(
|
|||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
btnBlood.visibility = View.GONE
|
btnBlood.visibility = View.GONE
|
||||||
|
Firebase.firestore.collection("patientData").whereEqualTo("_id", model._id).get()
|
||||||
|
.addOnSuccessListener { data ->
|
||||||
|
if (data.documents.isNotEmpty()) {
|
||||||
|
data.documents.forEach { userData ->
|
||||||
|
Firebase.firestore.collection("patientData").document(userData.id)
|
||||||
|
.update(
|
||||||
|
"incubationTime", SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
|
).format(Calendar.getInstance().time).toString()
|
||||||
|
).addOnSuccessListener {
|
||||||
|
Toast.makeText(
|
||||||
|
view.context, "Incubation started", Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
startListening()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.addOnFailureListener { e ->
|
.addOnFailureListener { e ->
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
@@ -168,27 +168,7 @@ class UserListAdapter(
|
|||||||
alertDialog.show()
|
alertDialog.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
btnStartIncubation.setOnClickListener {
|
|
||||||
// it.visibility = View.GONE
|
|
||||||
// Firebase.firestore.collection("patientData").whereEqualTo("_id", model._id).get()
|
|
||||||
// .addOnSuccessListener { data ->
|
|
||||||
// if (data.documents.isNotEmpty()) {
|
|
||||||
// data.documents.forEach { userData ->
|
|
||||||
// Firebase.firestore.collection("patientData").document(userData.id)
|
|
||||||
// .update(
|
|
||||||
// "incubationTime", SimpleDateFormat(
|
|
||||||
// "yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
|
||||||
// ).format(Calendar.getInstance().time).toString()
|
|
||||||
// ).addOnSuccessListener {
|
|
||||||
// Toast.makeText(
|
|
||||||
// view.context, "Incubation started", Toast.LENGTH_SHORT
|
|
||||||
// ).show()
|
|
||||||
// startListening()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
userCard.setOnClickListener {
|
userCard.setOnClickListener {
|
||||||
if (batLevel < 40) {
|
if (batLevel < 40) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
@@ -249,4 +229,11 @@ class UserListAdapter(
|
|||||||
|
|
||||||
return diffMillis / (60 * 1000)
|
return diffMillis / (60 * 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,26 +1,21 @@
|
|||||||
package com.example.hpostesting.presentation.buffercheck
|
package com.example.hpostesting.presentation.buffercheck
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.inputmethod.InputMethodManager
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.core.content.ContextCompat
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import com.example.hpostesting.data.DataHolder
|
import com.example.hpostesting.data.DataHolder
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||||
import com.example.hpostesting.data.model.patient.BufferCheckData
|
|
||||||
import com.example.hpostesting.data.model.patient.DeviceData
|
import com.example.hpostesting.data.model.patient.DeviceData
|
||||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||||
import com.example.hpostesting.presentation.UsbServiceListener
|
import com.example.hpostesting.presentation.UsbServiceListener
|
||||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||||
import com.example.hpostesting.presentation.utils.MyDialogListener
|
import com.example.hpostesting.presentation.utils.MyDialogListener
|
||||||
import com.example.hpostesting.presentation.utils.UIUtils
|
import com.example.hpostesting.presentation.utils.UIUtils
|
||||||
@@ -37,8 +32,6 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
private lateinit var sharedPreferences: SharedPreferences
|
private lateinit var sharedPreferences: SharedPreferences
|
||||||
private var currentDeviceData: DeviceData? = null
|
private var currentDeviceData: DeviceData? = null
|
||||||
private var resultData: String = ""
|
private var resultData: String = ""
|
||||||
private var kitno: String = ""
|
|
||||||
private var isOnline = false
|
|
||||||
private val messages = MutableLiveData<String>()
|
private val messages = MutableLiveData<String>()
|
||||||
private var isTestOngoing = false
|
private var isTestOngoing = false
|
||||||
private var startListening = MutableLiveData(false)
|
private var startListening = MutableLiveData(false)
|
||||||
@@ -58,42 +51,15 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun initViews() {
|
private fun initViews() {
|
||||||
|
binding.btnKit.visibility = View.GONE
|
||||||
binding.nameEditText.setText("SMI/SC/")
|
binding.btnSubmit.visibility = View.GONE
|
||||||
|
binding.etBloodGroup.visibility = View.GONE
|
||||||
binding.btnGo.setOnClickListener {
|
|
||||||
val serialNumber = binding.nameEditText.text.toString().trim()
|
|
||||||
if (serialNumber.isNotEmpty() && isSerialValid(serialNumber)) {
|
|
||||||
kitno = serialNumber
|
|
||||||
listenToHemoCube()
|
listenToHemoCube()
|
||||||
startBufferProcess()
|
startBufferProcess()
|
||||||
} else {
|
|
||||||
Toast.makeText(context, "Invalid KIT Number", Toast.LENGTH_LONG).show()
|
|
||||||
return@setOnClickListener
|
|
||||||
}
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.tvSubtitle2.visibility = View.GONE
|
|
||||||
binding.etAbhaId.visibility = View.GONE
|
|
||||||
binding.tvTitle.visibility = View.GONE
|
|
||||||
binding.tvTitle2.visibility = View.GONE
|
|
||||||
binding.btnGo.visibility = View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.btnSubmit.isEnabled = true
|
|
||||||
binding.btnSubmit.isClickable = true
|
|
||||||
}
|
|
||||||
binding.btnSubmit.setOnClickListener {
|
|
||||||
|
|
||||||
}
|
|
||||||
binding.btnSubmit.isEnabled = false
|
|
||||||
binding.btnSubmit.isClickable = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun observeViewModel() {
|
private fun observeViewModel() {
|
||||||
|
|
||||||
hemoCubeViewModel.deviceData.observe(viewLifecycleOwner) {
|
hemoCubeViewModel.deviceData.observe(viewLifecycleOwner) {
|
||||||
currentDeviceData = it
|
currentDeviceData = it
|
||||||
}
|
}
|
||||||
@@ -103,20 +69,11 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
hemoCubeViewModel.getDeviceData(sharedPreferences.getString(Constants.USER_ID, ""))
|
hemoCubeViewModel.getDeviceData(sharedPreferences.getString(Constants.USER_ID, ""))
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
requireContext(), "No internet connection avaiable", Toast.LENGTH_SHORT
|
requireContext(),
|
||||||
|
"No internet connection avaiable",
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
isOnline = isNetworkAvailable
|
|
||||||
}
|
|
||||||
hemoCubeViewModel.fireBaseUpload.observe(viewLifecycleOwner) { result ->
|
|
||||||
if (result == "Success") {
|
|
||||||
showToast("Kit result uploaded successfully")
|
|
||||||
}
|
|
||||||
if (result == "Local") {
|
|
||||||
showToast("Kit result uploading failed, note it down manually")
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.progressBar.visibility = View.GONE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
messages.observe(viewLifecycleOwner) {
|
messages.observe(viewLifecycleOwner) {
|
||||||
@@ -161,14 +118,10 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
resultData += fullReadOutput.toString()
|
resultData += fullReadOutput.toString()
|
||||||
|
|
||||||
when {
|
when {
|
||||||
|
stringData.contains("ERROR 500") -> showError500Dialog()
|
||||||
|
stringData.contains("ERROR 501") -> showError501Dialog()
|
||||||
stringData.contains("#Buffer Completed") -> showStartSampleDialog()
|
stringData.contains("#Buffer Completed") -> showStartSampleDialog()
|
||||||
stringData.contains("#Sample Completed") -> {
|
stringData.contains("#Sample Completed") -> fetchResult()
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.btnSubmit.isEnabled = true
|
|
||||||
binding.btnSubmit.isClickable = true
|
|
||||||
}
|
|
||||||
fetchResult()
|
|
||||||
}
|
|
||||||
|
|
||||||
stringData.contains("RESULT") || resultData.contains("REND") -> {
|
stringData.contains("RESULT") || resultData.contains("REND") -> {
|
||||||
var validString: String
|
var validString: String
|
||||||
@@ -190,6 +143,40 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun showError500Dialog() {
|
||||||
|
UIUtils.createAlertDialog(requireContext(),
|
||||||
|
"BUFFER ERROR",
|
||||||
|
"Do you want to continue with existing buffer?",
|
||||||
|
getString(R.string.noo),
|
||||||
|
"Yes",
|
||||||
|
object : MyDialogListener {
|
||||||
|
override fun onClickNegativeButton() {}
|
||||||
|
|
||||||
|
override fun onClickPositiveButton() {
|
||||||
|
listenToHemoCube()
|
||||||
|
startBufferProcess()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun showError501Dialog() {
|
||||||
|
UIUtils.createAlertDialog(requireContext(),
|
||||||
|
"SAMPLE ERROR",
|
||||||
|
"Do you want to continue with Sample?",
|
||||||
|
getString(R.string.noo),
|
||||||
|
"Yes",
|
||||||
|
object : MyDialogListener {
|
||||||
|
override fun onClickNegativeButton() {}
|
||||||
|
|
||||||
|
override fun onClickPositiveButton() {
|
||||||
|
listenToHemoCube()
|
||||||
|
startSampleProcess()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
private fun showStartSampleDialog() {
|
private fun showStartSampleDialog() {
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
UIUtils.createAlertDialog(requireContext(),
|
UIUtils.createAlertDialog(requireContext(),
|
||||||
@@ -212,7 +199,6 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
try {
|
try {
|
||||||
val result = validString.split(" ")
|
val result = validString.split(" ")
|
||||||
if (result.size == 8) {
|
if (result.size == 8) {
|
||||||
val deviceSerialNo = result[2]
|
|
||||||
val led1BufferForDevice = result[3].toDoubleOrNull()
|
val led1BufferForDevice = result[3].toDoubleOrNull()
|
||||||
val led2BufferForDevice = result[4].toDoubleOrNull()
|
val led2BufferForDevice = result[4].toDoubleOrNull()
|
||||||
val led1Sample = result[5].toDoubleOrNull()
|
val led1Sample = result[5].toDoubleOrNull()
|
||||||
@@ -220,23 +206,9 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
val led1Average = log10(led1BufferForDevice?.div(led1Sample!!) ?: 0.0)
|
val led1Average = log10(led1BufferForDevice?.div(led1Sample!!) ?: 0.0)
|
||||||
val led2Average = log10(led2BufferForDevice?.div(led2Sample!!) ?: 0.0)
|
val led2Average = log10(led2BufferForDevice?.div(led2Sample!!) ?: 0.0)
|
||||||
val deviceRatio = led1Average / led2Average
|
val deviceRatio = led1Average / led2Average
|
||||||
val calculatedRatio = 0.14
|
val calculatedRatio = calculateRatio(deviceRatio)
|
||||||
val classificationResult = findResult(calculatedRatio)
|
val classificationResult = findResult(calculatedRatio)
|
||||||
messages.postValue(classificationResult)
|
messages.postValue(classificationResult)
|
||||||
val bufferData = BufferCheckData(
|
|
||||||
kitno = kitno,
|
|
||||||
led1Buffer = led1BufferForDevice,
|
|
||||||
led2Buffer = led2BufferForDevice,
|
|
||||||
led1Average = led1Average,
|
|
||||||
led2Average = led2Average,
|
|
||||||
led1Sample = led1Sample,
|
|
||||||
led2Sample = led2Sample,
|
|
||||||
deviceRatio = deviceRatio,
|
|
||||||
calculatedRatio = calculatedRatio,
|
|
||||||
classificationResult = classificationResult,
|
|
||||||
deviceSerialNumber = deviceSerialNo
|
|
||||||
)
|
|
||||||
hemoCubeViewModel.uploadHemoCubeResultToDatabaseforbuffercheckN(bufferData)
|
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
@@ -273,7 +245,8 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
|
|
||||||
private fun startBufferProcess() {
|
private fun startBufferProcess() {
|
||||||
|
|
||||||
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.startBuffer,
|
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(
|
||||||
|
HemoCubeCommands.startBuffer,
|
||||||
object : UsbServiceListener {
|
object : UsbServiceListener {
|
||||||
override fun onUsbRead(data: ByteArray?) {}
|
override fun onUsbRead(data: ByteArray?) {}
|
||||||
|
|
||||||
@@ -284,7 +257,8 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
|
|
||||||
private fun startSampleProcess() {
|
private fun startSampleProcess() {
|
||||||
|
|
||||||
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.startSample,
|
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(
|
||||||
|
HemoCubeCommands.startSample,
|
||||||
object : UsbServiceListener {
|
object : UsbServiceListener {
|
||||||
override fun onUsbRead(data: ByteArray?) {}
|
override fun onUsbRead(data: ByteArray?) {}
|
||||||
|
|
||||||
@@ -295,7 +269,8 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
|
|
||||||
private fun fetchResult() {
|
private fun fetchResult() {
|
||||||
|
|
||||||
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.getSample,
|
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(
|
||||||
|
HemoCubeCommands.getSample,
|
||||||
object : UsbServiceListener {
|
object : UsbServiceListener {
|
||||||
override fun onUsbRead(data: ByteArray?) {}
|
override fun onUsbRead(data: ByteArray?) {}
|
||||||
|
|
||||||
@@ -325,15 +300,6 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isSerialValid(s: String): Boolean {
|
|
||||||
if (s.length != 17) {
|
|
||||||
binding.nameEditText.error = getString(R.string.invalid_kit)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private fun isValidResult(line: String): String {
|
private fun isValidResult(line: String): String {
|
||||||
return if (line.contains("RESULT") && line.split(" ").size == 8) {
|
return if (line.contains("RESULT") && line.split(" ").size == 8) {
|
||||||
line
|
line
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ class HomeFragment : Fragment() {
|
|||||||
|
|
||||||
rvAdapter = view?.let {
|
rvAdapter = view?.let {
|
||||||
UserListAdapter(requireContext(), hemoCubeViewModel, recyclerViewOptions,
|
UserListAdapter(requireContext(), hemoCubeViewModel, recyclerViewOptions,
|
||||||
it, batLevel, requireActivity())
|
it, batLevel)
|
||||||
}!!
|
}!!
|
||||||
binding.rvOrder.adapter = rvAdapter
|
binding.rvOrder.adapter = rvAdapter
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ class HomeFragment : Fragment() {
|
|||||||
batLevel = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)
|
batLevel = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)
|
||||||
|
|
||||||
rvAdapter = view?.let {
|
rvAdapter = view?.let {
|
||||||
UserListAdapter(requireContext(), hemoCubeViewModel, recyclerViewOptions, it, batLevel, requireActivity())
|
UserListAdapter(requireContext(), hemoCubeViewModel, recyclerViewOptions, it, batLevel)
|
||||||
}!!
|
}!!
|
||||||
binding.rvOrder.adapter = rvAdapter
|
binding.rvOrder.adapter = rvAdapter
|
||||||
rvAdapter.startListening()
|
rvAdapter.startListening()
|
||||||
@@ -258,7 +258,7 @@ class HomeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
|
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
|
||||||
val uploadDataVisibility = if (userDataList.any { !it.localFlag }) View.VISIBLE else View.GONE
|
val uploadDataVisibility = if (userDataList.isEmpty()) View.GONE else View.VISIBLE
|
||||||
binding.uploadData.visibility = uploadDataVisibility
|
binding.uploadData.visibility = uploadDataVisibility
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,15 +297,17 @@ class HomeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
|
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
|
||||||
|
if (userDataList.isEmpty()) {
|
||||||
|
dialog.dismiss()
|
||||||
|
} else {
|
||||||
userDataList.forEach { userData ->
|
userDataList.forEach { userData ->
|
||||||
if (!userData.localFlag) {
|
|
||||||
userData.localFlag = true
|
userData.localFlag = true
|
||||||
hemoCubeViewModel.bulkAddResultTestToDb(userData)
|
hemoCubeViewModel.bulkAddResultTestToDb(userData)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun deleteIncompleteRegistrations(userDataList: List<UserData>) {
|
private fun deleteIncompleteRegistrations(userDataList: List<UserData>) {
|
||||||
userDataList.forEach { userData ->
|
userDataList.forEach { userData ->
|
||||||
|
|||||||
@@ -65,22 +65,22 @@ class HemoCubeFragment : Fragment() {
|
|||||||
|
|
||||||
private fun initViews() {
|
private fun initViews() {
|
||||||
binding.btnSubmit.setOnClickListener {
|
binding.btnSubmit.setOnClickListener {
|
||||||
// val bloodGroupText = binding.etBloodGroup.text.toString()
|
val bloodGroupText = binding.etBloodGroup.text.toString()
|
||||||
// if (bloodGroupText.isEmpty()) {
|
if (bloodGroupText.isEmpty()) {
|
||||||
// binding.etBloodGroup.error = "Please enter your blood group"
|
binding.etBloodGroup.error = "Please enter your blood group"
|
||||||
// } else {
|
} else {
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
binding.progressBar.visibility = View.VISIBLE
|
binding.progressBar.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
hemoCubeViewModel.uploadHemoCubeResultToDatabase(
|
hemoCubeViewModel.uploadHemoCubeResultToDatabase(
|
||||||
isOnline, true, sharedPreferences.getString(Constants.KIT_NUMBER, "")
|
isOnline, true, sharedPreferences.getString(Constants.KIT_NUMBER, "")
|
||||||
)
|
)
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
if (isTestOngoing) {
|
if (isTestOngoing) {
|
||||||
// binding.btnKit.visibility = View.GONE
|
binding.btnKit.visibility = View.GONE
|
||||||
// binding.btnKit.isEnabled = false
|
binding.btnKit.isEnabled = false
|
||||||
// binding.btnKit.isClickable = false
|
binding.btnKit.isClickable = false
|
||||||
|
|
||||||
}
|
}
|
||||||
binding.btnSubmit.isEnabled = false
|
binding.btnSubmit.isEnabled = false
|
||||||
@@ -90,81 +90,75 @@ class HemoCubeFragment : Fragment() {
|
|||||||
binding.tvName.text = "Name: ${testDetails?.name}\n ID: ${testDetails?._id}"
|
binding.tvName.text = "Name: ${testDetails?.name}\n ID: ${testDetails?._id}"
|
||||||
Log.e("nametext",binding.tvName.text.toString())
|
Log.e("nametext",binding.tvName.text.toString())
|
||||||
|
|
||||||
// binding.btnKit.setOnClickListener {
|
binding.btnKit.setOnClickListener {
|
||||||
// if (isTestOngoing) {
|
if (isTestOngoing) {
|
||||||
// val title = "WARNING"
|
val title = "WARNING"
|
||||||
// val message = "There is a on going test, do you want to stop it"
|
val message = "There is a on going test, do you want to stop it"
|
||||||
// val negativeText = getString(R.string.no)
|
val negativeText = getString(R.string.no)
|
||||||
// val positiveText = "Yes"
|
val positiveText = "Yes"
|
||||||
//
|
|
||||||
// UIUtils.createAlertDialog(requireContext(),
|
UIUtils.createAlertDialog(requireContext(),
|
||||||
// title,
|
title,
|
||||||
// message,
|
message,
|
||||||
// negativeText,
|
negativeText,
|
||||||
// positiveText,
|
positiveText,
|
||||||
// object : MyDialogListener {
|
object : MyDialogListener {
|
||||||
// override fun onClickNegativeButton() {
|
override fun onClickNegativeButton() {
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// override fun onClickPositiveButton() {
|
|
||||||
// resetKitCount()
|
|
||||||
// val intent = Intent(context, KitScanActivity::class.java)
|
|
||||||
// startActivity(intent)
|
|
||||||
// (activity as HemocubeActivity).finish()
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// resetKitCount()
|
|
||||||
// val intent = Intent(context, KitScanActivity::class.java)
|
|
||||||
// startActivity(intent)
|
|
||||||
// (activity as HemocubeActivity).finish()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// private suspend fun checkBloodGroup() {
|
override fun onClickPositiveButton() {
|
||||||
// binding.apply {
|
resetKitCount()
|
||||||
// val bloodGroup = etBloodGroup.text.toString()
|
val intent = Intent(context, KitScanActivity::class.java)
|
||||||
// if (bloodGroup.isEmpty()) {
|
startActivity(intent)
|
||||||
// etBloodGroup.error = "Please enter your blood group"
|
(activity as HemocubeActivity).finish()
|
||||||
// } else {
|
}
|
||||||
// val db: FirebaseFirestore = Firebase.firestore
|
})
|
||||||
// val userdata = db.collection("patientData")
|
} else {
|
||||||
// .whereEqualTo("_id", hemoCubeViewModel.testDetails?._id).get().await()
|
resetKitCount()
|
||||||
// if (userdata.documents.isNotEmpty()) {
|
val intent = Intent(context, KitScanActivity::class.java)
|
||||||
// db.collection("patientData").document(userdata.documents[0].id)
|
startActivity(intent)
|
||||||
// .update("bloodGroup", bloodGroup)
|
(activity as HemocubeActivity).finish()
|
||||||
// withContext(Dispatchers.Main) {
|
}
|
||||||
// val i = Intent(
|
}
|
||||||
// requireContext().applicationContext, DashboardActivity::class.java
|
}
|
||||||
// )
|
|
||||||
// startActivity(i)
|
|
||||||
// (activity as HemocubeActivity).finish()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
private fun observeViewModel() {
|
private suspend fun checkBloodGroup() {
|
||||||
hemoCubeViewModel.fireBaseUpload.observe(viewLifecycleOwner) { result ->
|
binding.apply {
|
||||||
if (result == "Success") {
|
val bloodGroup = etBloodGroup.text.toString()
|
||||||
showToast("Test Results Uploaded Successfully")
|
if (bloodGroup.isEmpty()) {
|
||||||
|
etBloodGroup.error = "Please enter your blood group"
|
||||||
|
} else {
|
||||||
|
val db: FirebaseFirestore = Firebase.firestore
|
||||||
|
val userdata = db.collection("patientData")
|
||||||
|
.whereEqualTo("_id", hemoCubeViewModel.testDetails?._id).get().await()
|
||||||
|
if (userdata.documents.isNotEmpty()) {
|
||||||
|
db.collection("patientData").document(userdata.documents[0].id)
|
||||||
|
.update("bloodGroup", bloodGroup)
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
val i = Intent(
|
val i = Intent(
|
||||||
requireContext().applicationContext, DashboardActivity::class.java
|
requireContext().applicationContext, DashboardActivity::class.java
|
||||||
)
|
)
|
||||||
startActivity(i)
|
startActivity(i)
|
||||||
(activity as HemocubeActivity).finish()
|
(activity as HemocubeActivity).finish()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun observeViewModel() {
|
||||||
|
hemoCubeViewModel.fireBaseUpload.observe(viewLifecycleOwner) { result ->
|
||||||
|
if (result == "Success") {
|
||||||
|
showToast("Test Results Uploaded Successfully")
|
||||||
|
lifecycleScope.launch {
|
||||||
|
checkBloodGroup()
|
||||||
|
}
|
||||||
|
}
|
||||||
if (result == "Local") {
|
if (result == "Local") {
|
||||||
showToast("Internet not available, test details stored locally")
|
showToast("Internet not available, test details stored locally")
|
||||||
startActivity(Intent(requireActivity(), DashboardActivity::class.java))
|
startActivity(Intent(requireActivity(), DashboardActivity::class.java))
|
||||||
}
|
}
|
||||||
if (result == "Error") {
|
|
||||||
showToast("Error uploading data, test details stored locally")
|
|
||||||
startActivity(Intent(requireActivity(), DashboardActivity::class.java))
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.progressBar.visibility = View.GONE
|
binding.progressBar.visibility = View.GONE
|
||||||
}
|
}
|
||||||
@@ -182,7 +176,7 @@ class HemoCubeFragment : Fragment() {
|
|||||||
val coefficient1 = coefficients[0]
|
val coefficient1 = coefficients[0]
|
||||||
val coefficient2 = coefficients[1]
|
val coefficient2 = coefficients[1]
|
||||||
val result = coefficient1 * coefficient2
|
val result = coefficient1 * coefficient2
|
||||||
// showToast("coefficients: $coefficient1, $coefficient2")
|
showToast("coefficients: $coefficient1, $coefficient2")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isOnline = isNetworkAvailable
|
isOnline = isNetworkAvailable
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import com.example.hpostesting.data.NetworkStatusLiveData
|
|||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.data.dao.HemoCubeDao
|
import com.example.hpostesting.data.dao.HemoCubeDao
|
||||||
import com.example.hpostesting.data.model.Response
|
import com.example.hpostesting.data.model.Response
|
||||||
import com.example.hpostesting.data.model.patient.BufferCheckData
|
|
||||||
import com.example.hpostesting.data.model.patient.DeviceData
|
import com.example.hpostesting.data.model.patient.DeviceData
|
||||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||||
@@ -70,13 +69,6 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fun uploadHemoCubeResultToDatabaseforbuffercheckN(bufferCheckData: BufferCheckData) =
|
|
||||||
viewModelScope.launch {
|
|
||||||
addResultTestToDbforbuffercheck(bufferCheckData)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getDeviceData(deviceId: String?) = viewModelScope.launch {
|
fun getDeviceData(deviceId: String?) = viewModelScope.launch {
|
||||||
deviceData.postValue(deviceId?.let { repository.getDeviceDataById(it) })
|
deviceData.postValue(deviceId?.let { repository.getDeviceDataById(it) })
|
||||||
}
|
}
|
||||||
@@ -120,32 +112,6 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
Log.i("Testdb", "Data uploaded to Firestore successfully")
|
Log.i("Testdb", "Data uploaded to Firestore successfully")
|
||||||
fireBaseUpload.postValue("Success")
|
fireBaseUpload.postValue("Success")
|
||||||
testDetails.localFlag = true
|
|
||||||
hemoCubeDao.insertAll(testDetails)
|
|
||||||
}
|
|
||||||
|
|
||||||
is Response.Error -> {
|
|
||||||
Log.e("Testdb", "Error uploading data to Firestore: $response")
|
|
||||||
fireBaseUpload.postValue("Error")
|
|
||||||
hemoCubeDao.insertAll(testDetails)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Log.e("Testdb", "Exception during data upload: ${e.message}")
|
|
||||||
fireBaseUpload.postValue("Error")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private fun addResultTestToDbforbuffercheck(bufferCheckData: BufferCheckData) {
|
|
||||||
viewModelScope.launch {
|
|
||||||
try {
|
|
||||||
|
|
||||||
when (val response = repository.addTestToDatabaseforBufferCheck(bufferCheckData)) {
|
|
||||||
is Response.Success -> {
|
|
||||||
Log.i("Testdb", "Data uploaded to Firestore successfully")
|
|
||||||
fireBaseUpload.postValue("Success")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
is Response.Error -> {
|
is Response.Error -> {
|
||||||
@@ -168,7 +134,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
when (repository.addTestToDatabase(userData)) {
|
when (repository.addTestToDatabase(userData)) {
|
||||||
is Response.Success -> {
|
is Response.Success -> {
|
||||||
fireBaseBulkUpload.postValue("Success")
|
fireBaseBulkUpload.postValue("Success")
|
||||||
updateLocalFlag(userData._id)
|
deleteById(userData._id)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
@@ -178,10 +144,6 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateLocalFlag(userId: String) = viewModelScope.launch {
|
|
||||||
hemoCubeDao.updateFieldById(id = userId, true)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun deleteById(userId: String) = viewModelScope.launch {
|
fun deleteById(userId: String) = viewModelScope.launch {
|
||||||
hemoCubeDao.deleteById(id = userId)
|
hemoCubeDao.deleteById(id = userId)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.example.hpostesting.presentation.hemocube
|
package com.example.hpostesting.presentation.hemocube
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
import android.content.BroadcastReceiver
|
import android.content.BroadcastReceiver
|
||||||
import android.content.ComponentName
|
import android.content.ComponentName
|
||||||
@@ -8,7 +7,6 @@ import android.content.Context
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.IntentFilter
|
import android.content.IntentFilter
|
||||||
import android.content.ServiceConnection
|
import android.content.ServiceConnection
|
||||||
import android.content.SharedPreferences
|
|
||||||
import android.hardware.usb.UsbDevice
|
import android.hardware.usb.UsbDevice
|
||||||
import android.hardware.usb.UsbDeviceConnection
|
import android.hardware.usb.UsbDeviceConnection
|
||||||
import android.hardware.usb.UsbManager
|
import android.hardware.usb.UsbManager
|
||||||
@@ -19,14 +17,10 @@ import android.view.Menu
|
|||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.content.ContentProviderCompat.requireContext
|
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.view.get
|
import androidx.core.view.get
|
||||||
import androidx.navigation.fragment.findNavController
|
|
||||||
import com.example.hpostesting.data.DataHolder
|
import com.example.hpostesting.data.DataHolder
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
|
||||||
import com.example.hpostesting.presentation.dashboard.ui.LoginFragment
|
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.presentation.testRight.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
@@ -39,7 +33,7 @@ open class HemocubeActivity : AppCompatActivity() {
|
|||||||
private lateinit var binding: ActivityHemocubeBinding
|
private lateinit var binding: ActivityHemocubeBinding
|
||||||
private val viewModel by viewModels<HemoCubeViewModel>()
|
private val viewModel by viewModels<HemoCubeViewModel>()
|
||||||
private var myMenu: Menu? = null
|
private var myMenu: Menu? = null
|
||||||
private lateinit var sharedPreference: SharedPreferences
|
|
||||||
private lateinit var mDriver: UsbSerialDriver
|
private lateinit var mDriver: UsbSerialDriver
|
||||||
private var mConnection: UsbDeviceConnection? = null
|
private var mConnection: UsbDeviceConnection? = null
|
||||||
lateinit var mService: UsbService
|
lateinit var mService: UsbService
|
||||||
@@ -87,11 +81,8 @@ open class HemocubeActivity : AppCompatActivity() {
|
|||||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
setupListener()
|
setupListener()
|
||||||
connectUsb(false)
|
connectUsb(false)
|
||||||
applicationContext.getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SuspiciousIndentation")
|
|
||||||
private fun setupListener() {
|
private fun setupListener() {
|
||||||
DataHolder.usbConnected.observe(this) {
|
DataHolder.usbConnected.observe(this) {
|
||||||
Log.d("USB OBSERVE", "HemoCube called -> $it")
|
Log.d("USB OBSERVE", "HemoCube called -> $it")
|
||||||
@@ -101,7 +92,6 @@ open class HemocubeActivity : AppCompatActivity() {
|
|||||||
} else {
|
} else {
|
||||||
myMenu?.get(0)?.icon =
|
myMenu?.get(0)?.icon =
|
||||||
ContextCompat.getDrawable(this, R.drawable.ic_baseline_usb_off_24)
|
ContextCompat.getDrawable(this, R.drawable.ic_baseline_usb_off_24)
|
||||||
logoutUser()
|
|
||||||
Toast.makeText(this, "Device is Disconnected", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Device is Disconnected", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,16 +185,4 @@ open class HemocubeActivity : AppCompatActivity() {
|
|||||||
viewModel.isServiceConnected = false
|
viewModel.isServiceConnected = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun logoutUser() {
|
|
||||||
val intent = Intent(this, DashboardActivity::class.java)
|
|
||||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
|
||||||
startActivity(intent)
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/cl_parent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
|
||||||
android:id="@+id/my_toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
app:titleTextColor="#FFFFFF"
|
|
||||||
android:elevation="4dp"
|
|
||||||
app:menu="@menu/my_menu"
|
|
||||||
android:theme="@style/ToolbarTheme"
|
|
||||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/fg_hc_buffer_check"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/my_toolbar"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
tools:context=".presentation.buffercheck.HemocubeBufferCheckActivity">
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
</layout>
|
|
||||||
@@ -1,187 +0,0 @@
|
|||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
tools:context="com.example.hpostesting.presentation.buffercheck.HemoCubeBufferCheckFragment">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/cl_parent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_title"
|
|
||||||
style="@style/title1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="24dp"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:text="@string/Instructions"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_subtitle2"
|
|
||||||
style="@style/title2"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="24dp"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:text="@string/step4"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
|
||||||
|
|
||||||
<!-- <TextView-->
|
|
||||||
<!-- android:id="@+id/tv_subtitle3"-->
|
|
||||||
<!-- style="@style/title2"-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:layout_marginHorizontal="24dp"-->
|
|
||||||
<!-- android:layout_marginTop="16dp"-->
|
|
||||||
<!-- android:text="@string/step5"-->
|
|
||||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
|
||||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
|
||||||
<!-- app:layout_constraintTop_toBottomOf="@id/tv_subtitle2" />-->
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_name"
|
|
||||||
style="@style/title2"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="24dp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/btn_submit" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_subtitle4"
|
|
||||||
style="@style/title1_1"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="80dp"
|
|
||||||
android:layout_marginHorizontal="24dp"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="@color/red"
|
|
||||||
android:textSize="18sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle2" />
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <Button-->
|
|
||||||
<!-- android:visibility="gone"-->
|
|
||||||
<!-- android:id="@+id/btn_samplestart"-->
|
|
||||||
<!-- android:layout_width="wrap_content"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:layout_marginHorizontal="16dp"-->
|
|
||||||
<!-- android:layout_marginTop="24dp"-->
|
|
||||||
<!-- android:clickable="false"-->
|
|
||||||
<!-- android:text="@string/Start_Sample"-->
|
|
||||||
<!-- android:textColor="@color/white"-->
|
|
||||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
|
||||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
|
||||||
<!-- app:layout_constraintTop_toBottomOf="@id/til_blood_group" />-->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <Button-->
|
|
||||||
<!-- android:id="@+id/btn_placebuffer"-->
|
|
||||||
<!-- android:layout_width="wrap_content"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:layout_marginHorizontal="16dp"-->
|
|
||||||
<!-- android:layout_marginTop="24dp"-->
|
|
||||||
<!-- android:clickable="false"-->
|
|
||||||
<!-- android:text="@string/place_buffer"-->
|
|
||||||
<!-- android:textColor="@color/white"-->
|
|
||||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
|
||||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
|
||||||
<!-- app:layout_constraintTop_toBottomOf="@id/btn_submit" />-->
|
|
||||||
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btn_submit"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="16dp"
|
|
||||||
android:layout_marginTop="24dp"
|
|
||||||
android:clickable="false"
|
|
||||||
android:text="@string/submit"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
|
||||||
|
|
||||||
<!-- <com.google.android.material.textfield.TextInputLayout-->
|
|
||||||
<!-- android:id="@+id/til_blood_group"-->
|
|
||||||
<!-- style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"-->
|
|
||||||
<!-- android:layout_width="match_parent"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:layout_marginHorizontal="24dp"-->
|
|
||||||
<!-- android:layout_marginTop="16dp"-->
|
|
||||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
|
||||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
|
||||||
<!-- app:layout_constraintTop_toBottomOf="@id/tv_subtitle4">-->
|
|
||||||
|
|
||||||
<!-- <AutoCompleteTextView-->
|
|
||||||
<!-- android:id="@+id/et_blood_group"-->
|
|
||||||
<!-- android:layout_width="match_parent"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:hint="@string/select_blood_group"-->
|
|
||||||
<!-- android:inputType="none"-->
|
|
||||||
<!-- android:labelFor="@id/til_blood_group"-->
|
|
||||||
<!-- app:simpleItems="@array/blood_group" />-->
|
|
||||||
|
|
||||||
<!-- </com.google.android.material.textfield.TextInputLayout>-->
|
|
||||||
|
|
||||||
<!-- <Button-->
|
|
||||||
<!-- android:id="@+id/btn_kit"-->
|
|
||||||
<!-- android:layout_width="wrap_content"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:layout_margin="10dp"-->
|
|
||||||
<!-- android:text="@string/new_kit"-->
|
|
||||||
<!-- android:textColor="@color/white"-->
|
|
||||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
|
||||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
|
||||||
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
|
||||||
|
|
||||||
<!-- <Button-->
|
|
||||||
<!-- android:id="@+id/btn_buffer"-->
|
|
||||||
<!-- android:layout_width="wrap_content"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:text="@string/new_buffer"-->
|
|
||||||
<!-- android:textColor="@color/white"-->
|
|
||||||
<!-- android:layout_margin="10dp"-->
|
|
||||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
|
||||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
|
||||||
<!-- app:layout_constraintEnd_toStartOf="@id/btn_kit"/>-->
|
|
||||||
|
|
||||||
<!-- <Button-->
|
|
||||||
<!-- android:id="@+id/btn_read"-->
|
|
||||||
<!-- android:layout_width="wrap_content"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:text="@string/read"-->
|
|
||||||
<!-- android:layout_margin="16dp"-->
|
|
||||||
<!-- android:clickable="false"-->
|
|
||||||
<!-- app:layout_constraintTop_toBottomOf="@id/btn_set_reference"-->
|
|
||||||
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
|
||||||
|
|
||||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/progressBar"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:elevation="12dp"
|
|
||||||
android:indeterminate="true"
|
|
||||||
android:indeterminateDrawable="@drawable/progressbar_drawable"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</layout>
|
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="24dp"
|
android:layout_marginHorizontal="24dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="@string/step4"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||||
@@ -44,7 +45,6 @@
|
|||||||
<!-- app:layout_constraintTop_toBottomOf="@id/tv_subtitle2" />-->
|
<!-- app:layout_constraintTop_toBottomOf="@id/tv_subtitle2" />-->
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
style="@style/title2"
|
style="@style/title2"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
android:layout_marginHorizontal="24dp"
|
android:layout_marginHorizontal="24dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
tools:ignore="MissingConstraints" />
|
app:layout_constraintTop_toBottomOf="@+id/btn_submit" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_subtitle4"
|
android:id="@+id/tv_subtitle4"
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/et_abha_id" />
|
app:layout_constraintTop_toBottomOf="@id/tv_subtitle2" />
|
||||||
|
|
||||||
|
|
||||||
<!-- <Button-->
|
<!-- <Button-->
|
||||||
@@ -98,55 +98,7 @@
|
|||||||
<!-- app:layout_constraintTop_toBottomOf="@id/btn_submit" />-->
|
<!-- app:layout_constraintTop_toBottomOf="@id/btn_submit" />-->
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_title2"
|
|
||||||
style="@style/title1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="24dp"
|
|
||||||
android:layout_marginTop="48dp"
|
|
||||||
android:text="@string/enter_kit_serial_number_manually"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
tools:ignore="MissingConstraints" />
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:id="@+id/et_abha_id"
|
|
||||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/btn_go"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_title2">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
|
||||||
android:id="@+id/name_edit_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:maxLength="17"
|
|
||||||
android:inputType="text"
|
|
||||||
android:hint="@string/serial_number" />
|
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/btn_go"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="24dp"
|
|
||||||
android:text="@string/go"
|
|
||||||
app:cornerRadius="16dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/et_abha_id"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="1.0"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/et_abha_id"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/et_abha_id" />
|
|
||||||
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/btn_submit"
|
android:id="@+id/btn_submit"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -157,40 +109,40 @@
|
|||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
app:layout_constraintTop_toBottomOf="@id/til_blood_group" />
|
||||||
|
|
||||||
<!-- <com.google.android.material.textfield.TextInputLayout-->
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
<!-- android:id="@+id/til_blood_group"-->
|
android:id="@+id/til_blood_group"
|
||||||
<!-- style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"-->
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||||
<!-- android:layout_width="match_parent"-->
|
android:layout_width="match_parent"
|
||||||
<!-- android:layout_height="wrap_content"-->
|
android:layout_height="wrap_content"
|
||||||
<!-- android:layout_marginHorizontal="24dp"-->
|
android:layout_marginHorizontal="24dp"
|
||||||
<!-- android:layout_marginTop="16dp"-->
|
android:layout_marginTop="16dp"
|
||||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
<!-- app:layout_constraintTop_toBottomOf="@id/tv_subtitle4">-->
|
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4">
|
||||||
|
|
||||||
<!-- <AutoCompleteTextView-->
|
<AutoCompleteTextView
|
||||||
<!-- android:id="@+id/et_blood_group"-->
|
android:id="@+id/et_blood_group"
|
||||||
<!-- android:layout_width="match_parent"-->
|
android:layout_width="match_parent"
|
||||||
<!-- android:layout_height="wrap_content"-->
|
android:layout_height="wrap_content"
|
||||||
<!-- android:hint="@string/select_blood_group"-->
|
android:hint="@string/select_blood_group"
|
||||||
<!-- android:inputType="none"-->
|
android:inputType="none"
|
||||||
<!-- android:labelFor="@id/til_blood_group"-->
|
android:labelFor="@id/til_blood_group"
|
||||||
<!-- app:simpleItems="@array/blood_group" />-->
|
app:simpleItems="@array/blood_group" />
|
||||||
|
|
||||||
<!-- </com.google.android.material.textfield.TextInputLayout>-->
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<!-- <Button-->
|
<Button
|
||||||
<!-- android:id="@+id/btn_kit"-->
|
android:id="@+id/btn_kit"
|
||||||
<!-- android:layout_width="wrap_content"-->
|
android:layout_width="wrap_content"
|
||||||
<!-- android:layout_height="wrap_content"-->
|
android:layout_height="wrap_content"
|
||||||
<!-- android:layout_margin="10dp"-->
|
android:layout_margin="10dp"
|
||||||
<!-- android:text="@string/new_kit"-->
|
android:text="@string/new_kit"
|
||||||
<!-- android:textColor="@color/white"-->
|
android:textColor="@color/white"
|
||||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<!-- <Button-->
|
<!-- <Button-->
|
||||||
<!-- android:id="@+id/btn_buffer"-->
|
<!-- android:id="@+id/btn_buffer"-->
|
||||||
@@ -229,6 +181,7 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
</layout>
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@@ -72,16 +72,7 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@id/userId"
|
app:layout_constraintTop_toBottomOf="@id/userId"
|
||||||
tools:text="Test Status: Completed"/>
|
tools:text="Test Status: Completed"/>
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btn_startIncubation"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="16dp"
|
|
||||||
android:text="@string/start_incubation"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/btn_blood"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/btn_blood" />
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_blood"
|
android:id="@+id/btn_blood"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -89,7 +80,6 @@
|
|||||||
android:layout_marginHorizontal="16dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:text="@string/blood_group"
|
android:text="@string/blood_group"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/btn_startIncubation"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/teststatus" />
|
app:layout_constraintTop_toBottomOf="@id/teststatus" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user