From 91361c79648e83f0a7546081ef79c7f274e02bae Mon Sep 17 00:00:00 2001 From: Mariya Date: Sat, 16 Mar 2024 12:54:12 +0530 Subject: [PATCH] changes made for button separation for sample and buffer for better work flow --- .../hpostesting/data/constant/Constants.kt | 10 +++++++ .../presentation/dashboard/HomeFragment.kt | 27 +++++++++++++------ .../presentation/hemocube/HemoCubeFragment.kt | 13 +++++++++ .../layout/fragment_hemo_cube_reference.xml | 2 +- 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/example/hpostesting/data/constant/Constants.kt b/app/src/main/java/com/example/hpostesting/data/constant/Constants.kt index 3c613cb..a468d6d 100644 --- a/app/src/main/java/com/example/hpostesting/data/constant/Constants.kt +++ b/app/src/main/java/com/example/hpostesting/data/constant/Constants.kt @@ -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" 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 c9eaea5..b92bc36 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 @@ -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(), diff --git a/app/src/main/java/com/example/hpostesting/presentation/hemocube/HemoCubeFragment.kt b/app/src/main/java/com/example/hpostesting/presentation/hemocube/HemoCubeFragment.kt index cfe5d24..6b0af59 100644 --- a/app/src/main/java/com/example/hpostesting/presentation/hemocube/HemoCubeFragment.kt +++ b/app/src/main/java/com/example/hpostesting/presentation/hemocube/HemoCubeFragment.kt @@ -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 } } diff --git a/app/src/main/res/layout/fragment_hemo_cube_reference.xml b/app/src/main/res/layout/fragment_hemo_cube_reference.xml index 921a6d6..8670265 100644 --- a/app/src/main/res/layout/fragment_hemo_cube_reference.xml +++ b/app/src/main/res/layout/fragment_hemo_cube_reference.xml @@ -158,7 +158,7 @@