Merge remote-tracking branch 'origin/dev-assurance-empty-check' into dev

This commit is contained in:
Pritimay Sarkar
2024-02-16 09:28:48 +05:30
2 changed files with 13 additions and 13 deletions

View File

@@ -13,6 +13,7 @@ import android.widget.AdapterView
import android.widget.ArrayAdapter import android.widget.ArrayAdapter
import android.widget.Spinner import android.widget.Spinner
import android.widget.Toast import android.widget.Toast
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
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
@@ -117,9 +118,6 @@ class AssuranceControlsFragment : Fragment() {
id: Long, id: Long,
) { ) {
val selectedValue: String = volumeOptions[position] val selectedValue: String = volumeOptions[position]
if (!selectedValue.equals("Select volume")) {
DataHolder.hemoCubeTestData!!.volume = selectedValue
}
} }
override fun onNothingSelected(parent: AdapterView<*>?) { override fun onNothingSelected(parent: AdapterView<*>?) {
@@ -143,17 +141,19 @@ class AssuranceControlsFragment : Fragment() {
volumeSpinner.setSelection(volumePosition) volumeSpinner.setSelection(volumePosition)
binding.btnSubmit.setOnClickListener { binding.btnSubmit.setOnClickListener {
val selectedSolution = DataHolder.hemoCubeTestData!!.solution val selectedSolution = binding.spinnerSolutions.selectedItem.toString()
val selectedVolume = DataHolder.hemoCubeTestData!!.volume val selectedConcentration = binding.spinnerConcentration.selectedItem.toString()
if (selectedSolution == "Select solution" || selectedVolume == "Select volume") {
Toast.makeText( // Check if any of the selections are default values
requireContext(), if (selectedSolution == "Select solution") {
"Please select both solution and volume", Toast.makeText(requireContext(), "Please select a solution", Toast.LENGTH_LONG).show()
Toast.LENGTH_SHORT return@setOnClickListener // Prevent further execution
).show()
return@setOnClickListener
} }
if (selectedConcentration == "Select concentration") {
Toast.makeText(requireContext(), "Please select a concentration", Toast.LENGTH_LONG).show()
return@setOnClickListener // Prevent further execution
}
DataHolder.hemoCubeTestData!!.quickCapture = true DataHolder.hemoCubeTestData!!.quickCapture = true
val currentUnixTime = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val currentUnixTime = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Instant.now().epochSecond Instant.now().epochSecond

View File

@@ -156,7 +156,7 @@ class HomeFragment : Fragment() {
thresholds = Constants.BUFFER_INTENSITY_THRESHOLDS[userData.deviceId].toString(), thresholds = Constants.BUFFER_INTENSITY_THRESHOLDS[userData.deviceId].toString(),
interpretation = userData.classificationResult, interpretation = userData.classificationResult,
testId = userData._id, testId = userData._id,
testTime = userData.testTime, testTime = "2024-02-08 16:33:56",//userData.testTime,
collectionTime = "2024-02-08 16:33:56",//userData.testTime, collectionTime = "2024-02-08 16:33:56",//userData.testTime,
expiryTime = "2024-02-08 16:33:56"//userData.testTime, expiryTime = "2024-02-08 16:33:56"//userData.testTime,
) )