changes made for button separation for sample and buffer for better work flow

This commit is contained in:
Mariya
2024-03-16 12:54:12 +05:30
parent 007db1ca7d
commit 91361c7964
4 changed files with 43 additions and 9 deletions

View File

@@ -224,6 +224,16 @@ object Constants {
"HCV-001-0048",
"HCV-001-0049",
"HCV-001-0050",
"HCV-000-6001",
"HCV-000-6002",
"HCV-000-6003",
"HCV-000-6004",
"HCV-000-6005",
"HCV-000-6006",
"HCV-000-6007",
"HCV-000-6008",
"HCV-000-6009",
"HCV-000-6010",
)
const val password = "SMI@12345"

View File

@@ -1,5 +1,15 @@
package com.example.hpostesting.presentation.dashboard
// Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
// Notice: All information contained herein is, and remains
// the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
// if any. The intellectual and technical concepts contained
// herein are proprietary to ShanMukha Innovations Pvt. Ltd.
// and its suppliers and may be covered by Indian and Foreign Patents,
// patents in process, and are protected by trade secret or copyright law.
// Dissemination of this information or reproduction of this material
// is strictly forbidden unless prior written permission is obtained
// from ShanMukha Innovations Pvt. Ltd.
import android.annotation.SuppressLint
import android.app.AlertDialog
import android.app.DownloadManager
@@ -350,15 +360,16 @@ class HomeFragment : Fragment() {
hemoCubeViewModel.login(createLoginRequestData(userID, password))
isTokenAvailable = true
} else if (isTokenAvailable) {
isTokenAvailable = true
hemoCubeViewModel.startPeriodicCheckUpdate()
hemoCubeViewModel.checkUpdate(createCheckUpdateRequestData())
} else {
if (isTokenExpired(accessToken)) {
hemoCubeViewModel.login(createLoginRequestData(userID, password))
}
}
// else if (isTokenAvailable) {
// isTokenAvailable = true
// hemoCubeViewModel.startPeriodicCheckUpdate()
// hemoCubeViewModel.checkUpdate(createCheckUpdateRequestData())
// } else {
// if (isTokenExpired(accessToken)) {
// hemoCubeViewModel.login(createLoginRequestData(userID, password))
// }
// }
} else {
Toast.makeText(
requireContext(),

View File

@@ -459,6 +459,8 @@ class HemoCubeFragment : Fragment() {
activity?.runOnUiThread {
checkCuvetteSam = true
binding.btnRetryCheckCuvette.visibility = View.GONE
binding.btnPlacebuffer.visibility = View.GONE
binding.btnSamplestart.visibility = View.VISIBLE
}
}
resultData.contains("#AIN") && sampleClick && this.testStatusCode <= TestStatus.CUVETTE_ABSENTS.code -> {
@@ -473,6 +475,8 @@ class HemoCubeFragment : Fragment() {
activity?.runOnUiThread {
checkCuvette = true
binding.btnRetryCheckCuvette.visibility = View.GONE
binding.btnPlacebuffer.visibility = View.VISIBLE
binding.btnSamplestart.visibility = View.VISIBLE
}
}
resultData.contains("#AIN") && this.testStatusCode <= TestStatus.CUVETTE_ABSENT.code -> {
@@ -483,6 +487,11 @@ class HemoCubeFragment : Fragment() {
resultData.contains("#BS") && this.testStatusCode < TestStatus.BUFFER_STARTED.code -> {
hemoCubeViewModel.messages.postValue(getString(R.string.buffer_started))
this.testStatusCode = TestStatus.BUFFER_STARTED.code
activity?.runOnUiThread {
binding.btnPlacebuffer.visibility = View.GONE
binding.btnSamplestart.isClickable = false
binding.btnSamplestart.isEnabled = false
}
}
resultData.contains("#BC") && this.testStatusCode < TestStatus.BUFFER_COMPLETED.code -> {
@@ -493,6 +502,8 @@ class HemoCubeFragment : Fragment() {
binding.tvSubtitle4.text = getString(R.string.buffer_completed)
// binding.btnSamplestart.visibility = View.VISIBLE
binding.btnPlacebuffer.visibility = View.GONE
binding.btnSamplestart.isClickable = true
binding.btnSamplestart.isEnabled = true
}
this.testStatusCode = TestStatus.BUFFER_COMPLETED.code
@@ -672,6 +683,8 @@ class HemoCubeFragment : Fragment() {
activity?.runOnUiThread {
// binding.btnPlacebuffer.visibility = View.GONE
binding.btnRetryCheckCuvette.visibility = View.VISIBLE
binding.btnPlacebuffer.visibility = View.GONE
binding.btnSamplestart.visibility = View.GONE
}
}

View File

@@ -158,7 +158,7 @@
<Button
android:id="@+id/btn_placebuffer"
android:layout_width="wrap_content"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="24dp"