Compare commits
42 Commits
ui-ux
...
dev-new-co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8721b7f27 | ||
|
|
ab26d0228d | ||
|
|
d012b9edda | ||
|
|
721ac5d53c | ||
|
|
75acfc34bd | ||
|
|
d365bbcfe0 | ||
|
|
31ed1edd0b | ||
|
|
d62fafb129 | ||
|
|
8ba574aeac | ||
|
|
d8cb0bd96e | ||
|
|
75c6269e4a | ||
|
|
1e4f801774 | ||
|
|
d701ee4f6d | ||
|
|
e4b237bb9a | ||
|
|
372489330a | ||
|
|
0c10e5a920 | ||
|
|
045bda26ff | ||
|
|
b31e5e6c06 | ||
|
|
53c36d3cf9 | ||
|
|
f922f585b5 | ||
|
|
1742363f1a | ||
|
|
ba9564d867 | ||
|
|
1aaf2ba485 | ||
|
|
85756a7052 | ||
|
|
0141c2791e | ||
|
|
a52538e72d | ||
|
|
78cc79eef8 | ||
|
|
c9d0c440e3 | ||
|
|
99da2fc094 | ||
|
|
20f408230e | ||
|
|
c8d5d41c81 | ||
|
|
210c9fed5d | ||
|
|
b68ec45642 | ||
|
|
1e5afa0a5c | ||
|
|
80ab69c772 | ||
|
|
f7dc879c75 | ||
|
|
e8b5d12db5 | ||
|
|
626dd380ab | ||
|
|
70b0b93f57 | ||
|
|
5cdc156f33 | ||
|
|
71d298cd69 | ||
|
|
bb6f4ee859 |
@@ -19,8 +19,8 @@ android {
|
||||
applicationId "in.sminnovations.hpostesting.dev"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 114
|
||||
versionName "2.1.114"
|
||||
versionCode 120
|
||||
versionName "2.1.120"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
<application
|
||||
android:name="com.example.hpostesting.HPOSTestingApplication"
|
||||
android:largeHeap="true"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
@@ -64,12 +65,14 @@
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.assurance.AssuranceControlsActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar"/>
|
||||
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.hemocube.HemocubeActivity"
|
||||
android:exported="false"
|
||||
android:noHistory="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:parentActivityName="com.example.hpostesting.presentation.MainActivity"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
@@ -113,7 +116,7 @@
|
||||
|
||||
|
||||
<service
|
||||
android:name="com.example.hpostesting.presentation.testRight.UsbService"
|
||||
android:name="com.example.hpostesting.util.UsbService"
|
||||
android:enabled="true"
|
||||
android:exported="false" />
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ object Constants {
|
||||
const val DOCUMENT_ID_FOR_UPDATE ="2o71vBKLqdgEKYtFG8Lb"
|
||||
const val ABHA_APP_PACKAGE = "in.ndhm.phr"
|
||||
|
||||
const val MOLBIO_INTEGRATION = false
|
||||
const val MOLBIO_INTEGRATION = true
|
||||
const val deviceProvisionEmail = "HPOS_provisioner@bigtec.co.in"
|
||||
const val deviceProvisionPassword = "f2ab0e7f9d69"
|
||||
const val DEVICE_ID_API = "deviceIDAPI"
|
||||
@@ -55,6 +55,7 @@ object Constants {
|
||||
const val USER_ID = "usernameId"
|
||||
|
||||
const val QUICK_CAPTURE_SOLUTION = "SOLUTION"
|
||||
const val QUICK_CAPTURE_FOR_ADMIN = "ADMIN"
|
||||
const val QUICK_CAPTURE_CONCENTRATION = "CONCENTRATION"
|
||||
const val QUICK_CAPTURE_VOLUME = "VOLUME"
|
||||
const val QUICK_CAPTURE_READING_PER_SAMPLE = "READING_PER_SAMPLE"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.hpostesting.data
|
||||
package com.example.hpostesting.data.constant
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
@@ -15,4 +15,5 @@ enum class HemoCubeCommands(val command: String) {
|
||||
SECOND_GAIN_COMMAND("U\r"),
|
||||
THIRD_GAIN_COMMAND("V\r"),
|
||||
FORTH_GAIN_COMMAND("W\r"),
|
||||
CHECK_CUVETTE_COMMAND("L\r"),
|
||||
}
|
||||
@@ -10,8 +10,12 @@ enum class TestStatus(val code: Double) {
|
||||
FIRST_EMPTY_AIR_READING_PRINT_COMPLETED(4.4),
|
||||
EPROM_ADC_RETRIEVAL_STARTED(4.5),
|
||||
EPROM_ADC_RETRIEVAL_COMPLETED(4.6),
|
||||
BUFFER_STARTED(4.7),
|
||||
BUFFER_COMPLETED(5.0),
|
||||
CUVETTE_ABSENT(4.7),
|
||||
CUVETTE_PRESENT(4.8),
|
||||
CUVETTE_ABSENTS(7.7),
|
||||
CUVETTE_PRESENTS(7.8),
|
||||
BUFFER_STARTED(4.9),
|
||||
BUFFER_COMPLETED(5.1),
|
||||
BUFFER_PRINT_STARTED(6.0),
|
||||
BUFFER_PRINT_COMPLETED(7.0),
|
||||
SAMPLE_STARTED(8.0),
|
||||
|
||||
@@ -5,6 +5,7 @@ import androidx.room.Dao
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import androidx.room.Update
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
@Dao
|
||||
@@ -30,7 +31,7 @@ interface HemoCubeDao {
|
||||
@Query("UPDATE hemo_cube_test_table SET isCSVCreated = :newValue WHERE _id = :id")
|
||||
suspend fun updateCSVFieldById(id: String, newValue: Boolean)
|
||||
|
||||
@Query("SELECT * from hemo_cube_test_table WHERE molbioFlag = :status")
|
||||
suspend fun getPendingUser(status: Boolean): List<HemoCubeTestData>
|
||||
@Query("SELECT * from hemo_cube_test_table WHERE localFlag = 0")
|
||||
fun getPendingUser(): LiveData<List<HemoCubeTestData>>
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import com.example.hpostesting.data.model.patient.UserData
|
||||
|
||||
@Database(
|
||||
entities = [UserData::class, HemoCubeTestData::class, DeviceData::class, BufferCheckData::class],
|
||||
version = 27,
|
||||
version = 30,
|
||||
exportSchema = false
|
||||
)
|
||||
@TypeConverters(Converters::class)
|
||||
|
||||
@@ -11,4 +11,6 @@ interface LocalFileDataSource {
|
||||
fun exportDataToCSV(
|
||||
fileName: String, dataList: List<HemoCubeTestData>,
|
||||
): Boolean
|
||||
fun backUpDataToCSV(fileName: String, dataList: List<HemoCubeTestData>)
|
||||
|
||||
}
|
||||
@@ -89,8 +89,9 @@ class LocalFileDataSourceImpl @Inject constructor() : LocalFileDataSource {
|
||||
)
|
||||
csvWriter.writeNext(header)
|
||||
|
||||
// Write data rows
|
||||
for (data in dataList) {
|
||||
// Filter and write data rows where testStatus is true
|
||||
val filteredDataList = dataList.filter { it.testStatus == true }
|
||||
for (data in filteredDataList) {
|
||||
val row = arrayOf(
|
||||
data._id,
|
||||
data.name,
|
||||
@@ -152,6 +153,127 @@ class LocalFileDataSourceImpl @Inject constructor() : LocalFileDataSource {
|
||||
}
|
||||
}
|
||||
|
||||
override fun backUpDataToCSV(fileName: String, dataList: List<HemoCubeTestData>) {
|
||||
try {
|
||||
val filePath = File(getExternalStorageDirectory(), fileName)
|
||||
val writer = FileWriter(filePath)
|
||||
val csvWriter = CSVWriter(writer)
|
||||
// Write CSV header
|
||||
val header = arrayOf(
|
||||
"_id",
|
||||
"name",
|
||||
"incubationTime",
|
||||
"bloodGroup",
|
||||
"birthYear", // Include other fields from the data class
|
||||
"state",
|
||||
"abhaId",
|
||||
"userImageURL",
|
||||
"location",
|
||||
"reportUploadTime",
|
||||
"testType",
|
||||
"testTime",
|
||||
"testStatus",
|
||||
"gender",
|
||||
"localFlag", // Add more fields as necessary
|
||||
"deviceId",
|
||||
"appVersion",
|
||||
"deviceSerialNumber",
|
||||
"deviceType",
|
||||
"kitSerial",
|
||||
"resultData",
|
||||
"led1Buffer",
|
||||
"led2Buffer",
|
||||
"led3Buffer",
|
||||
"led4Buffer",
|
||||
"led1Sample",
|
||||
"led2Sample",
|
||||
"led3Sample",
|
||||
"led4Sample",
|
||||
"led1Average",
|
||||
"led2Average",
|
||||
"led3Average",
|
||||
"led4Average",
|
||||
"abs1",
|
||||
"abs2",
|
||||
"abs3",
|
||||
"abs4",
|
||||
"deviceRatio",
|
||||
"calculatedRatio",
|
||||
"predictedDenovixRatio",
|
||||
"coefficients",
|
||||
"classificationResult",
|
||||
"prdClassification",
|
||||
"errorMessages",
|
||||
"batteryLevel",
|
||||
"batteryCapacity",
|
||||
"batteryMaxCapacity",
|
||||
"batteryTemperature",
|
||||
"batteryVoltage"
|
||||
)
|
||||
csvWriter.writeNext(header)
|
||||
|
||||
// Filter and write data rows where testStatus is true
|
||||
val filteredDataList = dataList.filter { it.testStatus == true }
|
||||
for (data in filteredDataList) {
|
||||
val row = arrayOf(
|
||||
data._id,
|
||||
data.name,
|
||||
data.incubationTime,
|
||||
data.bloodGroup,
|
||||
data.birthYear, // Include other fields similarly
|
||||
data.state,
|
||||
data.abhaId,
|
||||
data.userImageURL,
|
||||
data.location?.toString(),
|
||||
data.reportUploadTime ?: "",
|
||||
data.testType ?: "",
|
||||
data.testTime ?: "",
|
||||
data.testStatus?.toString() ?: "",
|
||||
data.gender,
|
||||
data.localFlag.toString(),
|
||||
data.deviceId ?: "",
|
||||
data.appVersion ?: "",
|
||||
data.deviceSerialNumber,
|
||||
data.deviceType,
|
||||
data.kitSerial,
|
||||
data.resultData,
|
||||
data.led1Buffer?.toString() ?: "",
|
||||
data.led2Buffer?.toString() ?: "",
|
||||
data.led3Buffer?.toString() ?: "",
|
||||
data.led4Buffer?.toString() ?: "",
|
||||
data.led1Sample?.toString() ?: "",
|
||||
data.led2Sample?.toString() ?: "",
|
||||
data.led3Sample?.toString() ?: "",
|
||||
data.led4Sample?.toString() ?: "",
|
||||
data.led1Average?.toString() ?: "",
|
||||
data.led2Average?.toString() ?: "",
|
||||
data.led3Average?.toString() ?: "",
|
||||
data.led4Average?.toString() ?: "",
|
||||
data.abs1?.toString() ?: "",
|
||||
data.abs2?.toString() ?: "",
|
||||
data.abs3?.toString() ?: "",
|
||||
data.abs4?.toString() ?: "",
|
||||
data.deviceRatio?.toString() ?: "",
|
||||
data.calculatedRatio?.toString() ?: "",
|
||||
data.predictedDenovixRatio?.toString() ?: "",
|
||||
data.coefficients ?: "",
|
||||
data.classificationResult,
|
||||
data.prdClassification,
|
||||
data.errorMessages,
|
||||
data.batteryLevel,
|
||||
data.batteryCapacity,
|
||||
data.batteryMaxCapacity,
|
||||
data.batteryTemperature,
|
||||
data.batteryVoltage
|
||||
)
|
||||
csvWriter.writeNext(row)
|
||||
}
|
||||
writer.close()
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getExternalStorageDirectory(): File {
|
||||
val folder = File(Environment.getExternalStorageDirectory(), "HposFolder")
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@ import androidx.room.PrimaryKey
|
||||
|
||||
@Entity(tableName = "hemo_cube_test_table")
|
||||
data class HemoCubeTestData(
|
||||
@PrimaryKey
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
var sampleid: Int = 0,
|
||||
var _id: String = "",
|
||||
var name: String = "",
|
||||
var incubationTime: String = "",
|
||||
@@ -89,6 +90,7 @@ data class HemoCubeTestData(
|
||||
var quickCapture: Boolean = false,
|
||||
var solution: String? = "",
|
||||
var concentration: String? = "",
|
||||
var filter: String? = "",
|
||||
var volume: String? = "",
|
||||
var isCSVCreated: Boolean = false,
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.example.hpostesting.data.repository
|
||||
|
||||
import android.net.Uri
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.api.MolbioAuthApi
|
||||
import com.example.hpostesting.data.api.MolbioResultApi
|
||||
import com.example.hpostesting.data.model.PendingUploads
|
||||
@@ -109,20 +109,7 @@ class DatabaseRepository @Inject constructor(
|
||||
}
|
||||
|
||||
override suspend fun addTestToDatabase(data: UserData?): Response<String> {
|
||||
return try {
|
||||
val userdata =
|
||||
db.collection("patientData").whereEqualTo("_id", data!!._id).get().await()
|
||||
if (userdata.documents.isNotEmpty()) {
|
||||
userdata.documents.forEach {
|
||||
db.collection("patientData").document(it.id).update("testStatus", true)
|
||||
}
|
||||
}
|
||||
db.collection("testData").add(data).await()
|
||||
Response.Success(data._id)
|
||||
} catch (e: Exception) {
|
||||
Firebase.crashlytics.recordException(e)
|
||||
Response.Error(e)
|
||||
}
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override suspend fun addTestToDatabaseforBufferCheck(data: BufferCheckData?): Response<String> {
|
||||
@@ -247,4 +234,22 @@ class DatabaseRepository @Inject constructor(
|
||||
override fun <UserData> addTestToDatabase(testDetails: UserData): Any {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override suspend fun addTestToDatabasefornew(data: HemoCubeTestData?): Response<String> {
|
||||
return try {
|
||||
val userdata =
|
||||
db.collection("patientData").whereEqualTo("_id", data!!._id).get().await()
|
||||
if (userdata.documents.isNotEmpty()) {
|
||||
userdata.documents.forEach {
|
||||
db.collection("patientData").document(it.id).update("testStatus", true)
|
||||
}
|
||||
}
|
||||
db.collection("testData").add(data).await()
|
||||
Response.Success(data._id)
|
||||
} catch (e: Exception) {
|
||||
Firebase.crashlytics.recordException(e)
|
||||
Response.Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.example.hpostesting.data.repository
|
||||
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.model.Response
|
||||
import com.example.hpostesting.data.model.devicediagnostics.DeviceDiagnosticsRequest
|
||||
import com.example.hpostesting.data.model.devicediagnostics.DeviceDiagnosticsResponse
|
||||
@@ -25,6 +25,7 @@ import okhttp3.ResponseBody
|
||||
|
||||
interface Repository {
|
||||
suspend fun addTestToDatabase(data: HemoCubeTestData?): Response<String>
|
||||
suspend fun addTestToDatabasefornew(data: HemoCubeTestData?): Response<String>
|
||||
|
||||
suspend fun addTestToDatabase(data: UserData?): Response<String>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.hpostesting.domain.di
|
||||
package com.example.hpostesting.di
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
@@ -7,7 +7,7 @@ import android.content.res.AssetManager
|
||||
import androidx.room.Room
|
||||
import com.example.hpostesting.data.api.MolbioAuthApi
|
||||
import com.example.hpostesting.data.api.MolbioResultApi
|
||||
import com.example.hpostesting.data.api.PropertyProvider
|
||||
import com.example.hpostesting.util.PropertyProvider
|
||||
import com.example.hpostesting.data.dao.HemoCubeBufferDao
|
||||
import com.example.hpostesting.data.dao.HemoCubeDao
|
||||
import com.example.hpostesting.data.dao.MyDatabase
|
||||
@@ -22,8 +22,8 @@ import com.example.hpostesting.domain.LogFileManager
|
||||
import com.example.hpostesting.domain.LogFileManagerImpl
|
||||
import com.example.hpostesting.domain.SaveRawData
|
||||
import com.example.hpostesting.domain.SaveRawDataTest
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.UsbServiceListenerImpl
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListenerImpl
|
||||
import com.example.hpostesting.util.PropertyProviderImpl
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
@@ -147,7 +147,7 @@ object AppModule {
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideRetrofit(
|
||||
propertyProvider: PropertyProvider,@Named("Auth") client: OkHttpClient
|
||||
propertyProvider: PropertyProvider, @Named("Auth") client: OkHttpClient
|
||||
): Retrofit {
|
||||
return Retrofit.Builder().baseUrl(propertyProvider.getProperty("BASE_URL")).client(client)
|
||||
.addConverterFactory(GsonConverterFactory.create()).build()
|
||||
@@ -10,7 +10,7 @@ import android.view.View
|
||||
import android.widget.EditText
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||
|
||||
@@ -17,7 +17,7 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.example.hpostesting.presentation
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
|
||||
class MainViewModel : ViewModel() {
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||
import com.example.hpostesting.util.MyUtils
|
||||
|
||||
@@ -11,7 +11,7 @@ import androidx.navigation.findNavController
|
||||
import androidx.recyclerview.widget.AsyncListDiffer
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
|
||||
@@ -14,7 +14,7 @@ import androidx.fragment.app.FragmentActivity
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.Glide
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||
import com.firebase.ui.firestore.FirestoreRecyclerAdapter
|
||||
|
||||
@@ -13,9 +13,8 @@ import android.widget.AdapterView
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.Spinner
|
||||
import android.widget.Toast
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
import com.example.hpostesting.presentation.hemocube.HemocubeActivity
|
||||
@@ -45,7 +44,6 @@ class AssuranceControlsFragment : Fragment() {
|
||||
|
||||
private fun initViews() {
|
||||
// binding.btnSubmit.visibility = View.GONE
|
||||
|
||||
val solutionSpinner: Spinner = binding.spinnerSolutions
|
||||
val solutionOptions = arrayOf("Select solution", "Tartrazine", "Acid Red")
|
||||
val solutionAdapter =
|
||||
@@ -124,6 +122,27 @@ class AssuranceControlsFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
val adminspinner: Spinner = binding.spinnerAdmin
|
||||
val adminOptions = arrayOf("Select options", "Sickle-Cert-Buffer", "1 Abs Holo Filter", "0.25 Abs Holo Filter", "Air Blank")
|
||||
val adminAdapter =
|
||||
ArrayAdapter(requireContext(), R.layout.simple_spinner_item, adminOptions)
|
||||
adminAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
adminspinner.adapter =adminAdapter
|
||||
adminspinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(
|
||||
parent: AdapterView<*>?,
|
||||
view: View?,
|
||||
position: Int,
|
||||
id: Long,
|
||||
) {
|
||||
val selectedValue: String = adminOptions[position]
|
||||
|
||||
}
|
||||
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {
|
||||
}
|
||||
}
|
||||
// load saved values
|
||||
val savedSolution =
|
||||
sharedPreferences.getString(Constants.QUICK_CAPTURE_SOLUTION, "").toString()
|
||||
@@ -140,18 +159,30 @@ class AssuranceControlsFragment : Fragment() {
|
||||
val volumePosition = getPositionOfValue(savedVolume, volumeOptions.toList())
|
||||
volumeSpinner.setSelection(volumePosition)
|
||||
|
||||
|
||||
val foradmin =
|
||||
sharedPreferences.getString(Constants.QUICK_CAPTURE_FOR_ADMIN, "").toString()
|
||||
val adminPosition = getPositionOfValue(foradmin, adminOptions.toList())
|
||||
adminspinner.setSelection(adminPosition)
|
||||
|
||||
binding.btnSubmit.setOnClickListener {
|
||||
val selectedSolution = binding.spinnerSolutions.selectedItem.toString()
|
||||
val selectedConcentration = binding.spinnerConcentration.selectedItem.toString()
|
||||
val selectedadminOption = binding.spinnerAdmin.selectedItem.toString()
|
||||
|
||||
// Check if any of the selections are default values
|
||||
if (selectedSolution == "Select solution") {
|
||||
Toast.makeText(requireContext(), "Please select a solution", Toast.LENGTH_LONG).show()
|
||||
return@setOnClickListener // Prevent further execution
|
||||
}
|
||||
// if (selectedSolution == "Select solution") {
|
||||
// Toast.makeText(requireContext(), "Please select a solution", Toast.LENGTH_LONG).show()
|
||||
// return@setOnClickListener // Prevent further execution
|
||||
// }
|
||||
//
|
||||
// if (selectedConcentration == "Select concentration") {
|
||||
// Toast.makeText(requireContext(), "Please select a concentration", Toast.LENGTH_LONG).show()
|
||||
// return@setOnClickListener // Prevent further execution
|
||||
// }
|
||||
|
||||
if (selectedConcentration == "Select concentration") {
|
||||
Toast.makeText(requireContext(), "Please select a concentration", Toast.LENGTH_LONG).show()
|
||||
if (selectedadminOption == "Select options") {
|
||||
Toast.makeText(requireContext(), "Please select a option", Toast.LENGTH_LONG).show()
|
||||
return@setOnClickListener // Prevent further execution
|
||||
}
|
||||
DataHolder.hemoCubeTestData!!.quickCapture = true
|
||||
@@ -163,7 +194,14 @@ class AssuranceControlsFragment : Fragment() {
|
||||
DataHolder.hemoCubeTestData!!._id = currentUnixTime.toString() + "SMI"
|
||||
DataHolder.hemoCubeTestData!!.solution = binding.spinnerSolutions.selectedItem.toString()
|
||||
DataHolder.hemoCubeTestData!!.concentration = binding.spinnerConcentration.selectedItem.toString()
|
||||
DataHolder.hemoCubeTestData!!.name = "${DataHolder.hemoCubeTestData!!.solution} ${DataHolder.hemoCubeTestData!!.concentration} ${DataHolder.hemoCubeTestData!!.volume}"
|
||||
DataHolder.hemoCubeTestData!!.filter = binding.spinnerAdmin.selectedItem.toString()
|
||||
if(binding.spinnerAdmin.selectedItem.toString().equals("Select options")){
|
||||
Toast.makeText(requireContext(), "Please select a option", Toast.LENGTH_LONG).show()
|
||||
}else {
|
||||
DataHolder.hemoCubeTestData!!.name = DataHolder.hemoCubeTestData!!.filter.toString()
|
||||
}
|
||||
|
||||
|
||||
|
||||
DataHolder.selectedTest = UserData()
|
||||
DataHolder.selectedTest?._id = DataHolder.hemoCubeTestData!!._id
|
||||
@@ -176,6 +214,7 @@ class AssuranceControlsFragment : Fragment() {
|
||||
DataHolder.hemoCubeTestData!!.concentration
|
||||
)
|
||||
putString(Constants.QUICK_CAPTURE_VOLUME, DataHolder.hemoCubeTestData!!.volume)
|
||||
putString(Constants.QUICK_CAPTURE_FOR_ADMIN, DataHolder.hemoCubeTestData!!.filter)
|
||||
apply()
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.testRight.UsbService
|
||||
import com.example.hpostesting.util.UsbService
|
||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.data.model.diagnostics.DiagnosticsData
|
||||
import com.example.hpostesting.data.model.patient.DeviceData
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||
import com.google.firebase.ktx.Firebase
|
||||
import `in`.sminnovations.hpostesting.databinding.FragmentAutoDacBinding
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.example.hpostesting.presentation.blank
|
||||
|
||||
class BlankActivity {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.example.hpostesting.presentation.blank
|
||||
|
||||
class BlankFragment {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.example.hpostesting.presentation.blank
|
||||
|
||||
class BlankViewModel {
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import com.example.hpostesting.data.constant.Constants
|
||||
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.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||
|
||||
@@ -20,11 +20,11 @@ import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||
import com.example.hpostesting.presentation.testRight.UsbService
|
||||
import com.example.hpostesting.util.UsbService
|
||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@@ -20,10 +20,10 @@ import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.testRight.UsbService
|
||||
import com.example.hpostesting.util.UsbService
|
||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.data.model.calibration.CalibrationData
|
||||
import com.example.hpostesting.data.model.patient.DeviceData
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||
import com.google.firebase.ktx.Firebase
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.example.hpostesting.presentation.dashboard
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.BatteryManager
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.example.hpostesting.presentation.adapter.OfflineUserListAdapter
|
||||
import com.example.hpostesting.presentation.adapter.UserListAdapter
|
||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||
import com.example.hpostesting.presentation.testRight.TestRightViewModel
|
||||
import `in`.sminnovations.hpostesting.R
|
||||
import `in`.sminnovations.hpostesting.databinding.FragmentActivitiesBinding
|
||||
import `in`.sminnovations.hpostesting.databinding.FragmentHomeBinding
|
||||
|
||||
class ActivitiesFragment : Fragment() {
|
||||
private lateinit var binding: FragmentActivitiesBinding
|
||||
private val hemoCubeViewModel: HemoCubeViewModel by activityViewModels()
|
||||
private lateinit var adapter: OfflineUserListAdapter
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?,
|
||||
): View {
|
||||
binding = FragmentActivitiesBinding.inflate(inflater, container, false)
|
||||
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
hemoCubeViewModel.allPendingUserToUpload.observe(viewLifecycleOwner) { userData ->
|
||||
|
||||
if (userData.isNotEmpty()) {
|
||||
binding.rvOrderOffline.visibility = View.VISIBLE
|
||||
binding.noDataText.visibility = View.GONE
|
||||
val bm =
|
||||
requireContext().getSystemService(Context.BATTERY_SERVICE) as BatteryManager
|
||||
val batLevel: Int = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)
|
||||
adapter = OfflineUserListAdapter(binding.root, batLevel)
|
||||
adapter.differ.submitList(userData)
|
||||
binding.rvOrderOffline.adapter = adapter
|
||||
}else{
|
||||
binding.rvOrderOffline.visibility = View.GONE
|
||||
binding.noDataText.visibility = View.VISIBLE
|
||||
Log.d("Activities","Nothing to show")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.example.hpostesting.presentation.dashboard
|
||||
|
||||
import android.app.DownloadManager
|
||||
import android.content.BroadcastReceiver
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.SharedPreferences
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
@@ -21,23 +20,21 @@ import androidx.navigation.ui.AppBarConfiguration
|
||||
import androidx.navigation.ui.navigateUp
|
||||
import androidx.navigation.ui.setupActionBarWithNavController
|
||||
import androidx.navigation.ui.setupWithNavController
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.data.model.patient.DeviceData
|
||||
import com.example.hpostesting.presentation.NatsManager
|
||||
import com.example.hpostesting.data.model.updates.DeviceUpdateRequest
|
||||
import com.example.hpostesting.presentation.utils.NatsManager
|
||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||
import com.example.hpostesting.presentation.jig.JigActivity
|
||||
import com.google.android.material.navigation.NavigationView
|
||||
import com.google.firebase.appdistribution.FirebaseAppDistribution
|
||||
import com.google.firebase.appdistribution.FirebaseAppDistributionException
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||
import com.google.firebase.firestore.ktx.firestore
|
||||
import com.google.firebase.ktx.Firebase
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import `in`.sminnovations.hpostesting.BuildConfig
|
||||
import `in`.sminnovations.hpostesting.R
|
||||
import `in`.sminnovations.hpostesting.databinding.ActivityDashboardBinding
|
||||
import okhttp3.ResponseBody
|
||||
import java.io.File
|
||||
|
||||
interface NatsMessageCallback {
|
||||
@@ -53,7 +50,7 @@ open interface IDataCollector: NatsMessageCallback {
|
||||
class DashboardActivity : AppCompatActivity(), IDataCollector {
|
||||
|
||||
val TAG = "DashboardActivity"
|
||||
private var isRegistered= false
|
||||
private var isRegistered = false
|
||||
private lateinit var appBarConfiguration: AppBarConfiguration
|
||||
private lateinit var binding: ActivityDashboardBinding
|
||||
lateinit var sharedPreferences: SharedPreferences
|
||||
@@ -62,7 +59,7 @@ class DashboardActivity : AppCompatActivity(), IDataCollector {
|
||||
private var downloadId: Long = 0
|
||||
// TODO: Remove hemocube viewmodel
|
||||
private val hemocubeViewModel: HemoCubeViewModel by viewModels()
|
||||
|
||||
private lateinit var sharedPreference: SharedPreferences
|
||||
override fun attachBaseContext(newBase: Context?) {
|
||||
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||
LanguageManager.setLocale(newBase, languageCode)
|
||||
@@ -75,6 +72,7 @@ class DashboardActivity : AppCompatActivity(), IDataCollector {
|
||||
Log.d(TAG, "Received message on topic $topic: $message")
|
||||
}
|
||||
|
||||
@SuppressLint("SetWorldReadable")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
@@ -86,6 +84,9 @@ class DashboardActivity : AppCompatActivity(), IDataCollector {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
nats.connect()
|
||||
}
|
||||
val versionName = getAppVersion(this@DashboardActivity) + " [ " + getAppEnvironment(this@DashboardActivity) + " ]"
|
||||
binding.appBarDashboard.versionName.text = versionName
|
||||
|
||||
|
||||
val deviceId = sharedPreferences.getString(Constants.DEVICE_ID, "")
|
||||
|
||||
@@ -96,15 +97,22 @@ class DashboardActivity : AppCompatActivity(), IDataCollector {
|
||||
when (result) {
|
||||
is Result.Success -> {
|
||||
// Handle success
|
||||
val apkUrl = result.data
|
||||
// val apkUrl = "https://dl.dropboxusercontent.com/s/fi/1c3nn7t0co431hicl3hrt/app-debug.apk?rlkey=e4uf13ty1dpcked614vy1aaqp&dl=0"
|
||||
initiateUpdate(apkUrl.toString())
|
||||
Log.d("ApI", "APK URL: $apkUrl")
|
||||
// Toast.makeText(
|
||||
// this,
|
||||
// "APK UPLOAD ${result.data}",
|
||||
// Toast.LENGTH_SHORT
|
||||
// ).show()
|
||||
val apk = result.data
|
||||
val file = File(getExternalFilesDir("Updates"), "update.apk")
|
||||
file.setReadable(true, false) // Ensure the file is readable
|
||||
apk.byteStream().use { input ->
|
||||
file.outputStream().use { output ->
|
||||
input.copyTo(output)
|
||||
}
|
||||
}
|
||||
Log.d("Responsebodyformat", "Responsebodyformat: ")
|
||||
installApk(file)
|
||||
Log.e("ApI", "APK URL: $apk")
|
||||
Toast.makeText(
|
||||
this,
|
||||
"${result.data}",
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
|
||||
is Result.Error -> {
|
||||
@@ -129,7 +137,7 @@ class DashboardActivity : AppCompatActivity(), IDataCollector {
|
||||
|
||||
appBarConfiguration = AppBarConfiguration(
|
||||
setOf(
|
||||
R.id.nav_home, R.id.nav_profile, R.id.nav_settings
|
||||
R.id.nav_home, R.id.nav_profile, R.id.nav_activity,R.id.nav_settings
|
||||
), drawerLayout
|
||||
)
|
||||
setupActionBarWithNavController(navController, appBarConfiguration)
|
||||
@@ -154,55 +162,15 @@ class DashboardActivity : AppCompatActivity(), IDataCollector {
|
||||
return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
|
||||
}
|
||||
|
||||
private fun initiateUpdate(url: String) {
|
||||
val apkUrl = url
|
||||
if (!isValidHttpUrl(apkUrl)) {
|
||||
return
|
||||
}
|
||||
|
||||
val request = DownloadManager.Request(Uri.parse(apkUrl))
|
||||
request.setTitle("App Update")
|
||||
request.setDescription("Downloading update...")
|
||||
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)
|
||||
request.setDestinationInExternalFilesDir(this, "Updates", "update.apk")
|
||||
|
||||
val downloadManager = getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
|
||||
downloadId = downloadManager.enqueue(request)
|
||||
|
||||
// Register a BroadcastReceiver to receive the download complete event
|
||||
val filter = IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
isRegistered = true
|
||||
registerReceiver(downloadReceiver, filter, RECEIVER_EXPORTED)
|
||||
}
|
||||
}
|
||||
private fun extractApkUrl(responseBody: ResponseBody): String {
|
||||
return responseBody.string()
|
||||
}
|
||||
private fun isValidHttpUrl(url: String): Boolean {
|
||||
return url.startsWith("http://") || url.startsWith("https://")
|
||||
}
|
||||
private val downloadReceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
val id = intent?.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1)
|
||||
if (id == downloadId) {
|
||||
installApk()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun installApk() {
|
||||
val file = File(getExternalFilesDir("Updates"), "update.apk")
|
||||
file.setReadable(true, false) // Ensure the file is readable
|
||||
|
||||
private fun installApk(file: File) {
|
||||
val pInfo = baseContext.packageManager.getPackageInfo(baseContext.packageName, 0)
|
||||
val uri: Uri = FileProvider.getUriForFile(
|
||||
this,
|
||||
"in.sminnovations.hpostesting.dev.fileprovider",
|
||||
"${BuildConfig.APPLICATION_ID}.fileprovider",
|
||||
file
|
||||
)
|
||||
|
||||
// Create an intent to install the APK
|
||||
val installIntent = Intent(Intent.ACTION_INSTALL_PACKAGE)
|
||||
installIntent.data = uri
|
||||
installIntent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION or
|
||||
@@ -218,14 +186,13 @@ class DashboardActivity : AppCompatActivity(), IDataCollector {
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
try {
|
||||
if (isRegistered){
|
||||
unregisterReceiver(downloadReceiver)
|
||||
if(isRegistered) {
|
||||
try {
|
||||
// unregisterReceiver(downloadReceiver)
|
||||
} catch (e: Exception) {
|
||||
Log.d("HomeFragment", e.toString())
|
||||
}
|
||||
}catch (e: IllegalArgumentException){
|
||||
Log.e("HOmeFragment",e.toString())
|
||||
}
|
||||
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
@@ -278,6 +245,30 @@ class DashboardActivity : AppCompatActivity(), IDataCollector {
|
||||
override fun setResponse(response: String) {
|
||||
responses = responses+response+"\n"
|
||||
println(responses)
|
||||
Log.d("DashBoardActResponse",response)
|
||||
// if (response.contains("checkUpdate")) {
|
||||
// hemocubeViewModel.deviceUpdate(createDeviceUpdateRequestData())
|
||||
// }
|
||||
}
|
||||
|
||||
private fun createDeviceUpdateRequestData(): DeviceUpdateRequest {
|
||||
return DeviceUpdateRequest(
|
||||
serial_no = sharedPreference.getString(Constants.DEVICE_ID, "")
|
||||
)
|
||||
}
|
||||
private fun getAppVersion(context: Context): String {
|
||||
return try {
|
||||
val pInfo = context.packageManager.getPackageInfo(context.packageName, 0)
|
||||
pInfo.versionName
|
||||
} catch (e: PackageManager.NameNotFoundException) {
|
||||
"N/A"
|
||||
}
|
||||
}
|
||||
private fun getAppEnvironment(context: Context): String {
|
||||
return try {
|
||||
val pInfo = context.packageManager.getPackageInfo(context.packageName, 0)
|
||||
pInfo.packageName.substringAfterLast('.')
|
||||
} catch (e: PackageManager.NameNotFoundException) {
|
||||
"N/A"
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -21,13 +21,13 @@ import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.api.DeviceCommunicationHandler
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.testRight.UsbService
|
||||
import com.example.hpostesting.presentation.utils.DeviceCommunicationHandler
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.util.UsbService
|
||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@@ -12,7 +12,7 @@ import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||
import com.google.firebase.ktx.Firebase
|
||||
|
||||
@@ -20,13 +20,13 @@ import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.api.DeviceCommunicationHandler
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.testRight.UsbService
|
||||
import com.example.hpostesting.presentation.utils.DeviceCommunicationHandler
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.util.UsbService
|
||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@@ -12,12 +12,12 @@ import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.data.model.deviceprovision.DeviceProvisionRequest
|
||||
import com.example.hpostesting.data.model.patient.DeviceData
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||
import com.google.firebase.ktx.Firebase
|
||||
@@ -116,7 +116,10 @@ class DeviceProvisionFragment : Fragment() {
|
||||
password = response.data.data?.credentials?.password.toString(),
|
||||
deviceProvisionResponse = response.data.data.toString(),
|
||||
natsToken = response.data.data?.device?.deviceUser?.natsToken.toString(),
|
||||
natsTokenExpiry = response.data.data?.device?.deviceUser?.natsTokenExpiry.toString()
|
||||
natsTokenExpiry = response.data.data?.device?.deviceUser?.natsTokenExpiry.toString(),
|
||||
globalUpdateIgnore = false,
|
||||
globalUpdateDone = false,
|
||||
deviceUpdateAvailable = false
|
||||
)
|
||||
)
|
||||
// viewModel.addDeviceId(DeviceData(deviceId = sharedPreferences.getString(Constants.DEVICE_ID, "").toString()))
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.example.hpostesting.presentation.deviceprovision
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.model.Response
|
||||
import com.example.hpostesting.data.model.deviceprovision.DeviceProvisionRequest
|
||||
import com.example.hpostesting.data.model.deviceprovision.DeviceProvisionResponse
|
||||
|
||||
@@ -20,10 +20,10 @@ import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.testRight.UsbService
|
||||
import com.example.hpostesting.util.UsbService
|
||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@@ -13,15 +13,15 @@ import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.data.Result.Success
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.util.Result.Success
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.data.model.devicediagnostics.AdditionalDetails
|
||||
import com.example.hpostesting.data.model.devicediagnostics.DeviceDiagnosticsRequest
|
||||
import com.example.hpostesting.data.model.diagnostics.DiagnosticsData
|
||||
import com.example.hpostesting.data.model.patient.DeviceData
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||
import com.google.firebase.ktx.Firebase
|
||||
import `in`.sminnovations.hpostesting.databinding.FragmentDiagnosticsBinding
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.example.hpostesting.presentation.diagnostics
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.model.Response
|
||||
import com.example.hpostesting.data.model.devicediagnostics.DeviceDiagnosticsRequest
|
||||
import com.example.hpostesting.data.model.devicediagnostics.DeviceDiagnosticsResponse
|
||||
@@ -25,7 +25,7 @@ class DiagnosticsViewModel @Inject constructor(
|
||||
|
||||
val deviceData = MutableLiveData<DeviceData?>()
|
||||
val fireBaseUpload = MutableLiveData<String>()
|
||||
val deviceDiagnosticsResponse = MutableLiveData<com.example.hpostesting.data.Result<DeviceDiagnosticsResponse>>()
|
||||
val deviceDiagnosticsResponse = MutableLiveData<Result<DeviceDiagnosticsResponse>>()
|
||||
// private val batteryStatus: Intent? =
|
||||
// IntentFilter(Intent.ACTION_BATTERY_CHANGED).let { ifilter ->
|
||||
// context.registerReceiver(null, ifilter)
|
||||
|
||||
@@ -10,7 +10,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||
import `in`.sminnovations.hpostesting.databinding.FragmentDigitalCardBinding
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
@@ -4,7 +4,9 @@ import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -13,15 +15,15 @@ import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.data.constant.TestStatus
|
||||
import com.example.hpostesting.data.model.TestState
|
||||
import com.example.hpostesting.data.model.patient.DeviceData
|
||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||
import com.example.hpostesting.presentation.utils.MyDialogListener
|
||||
import com.example.hpostesting.presentation.utils.UIUtils
|
||||
@@ -34,7 +36,9 @@ import kotlin.math.log10
|
||||
|
||||
@Suppress("MemberVisibilityCanBePrivate")
|
||||
class HemoCubeFragment : Fragment() {
|
||||
|
||||
private var checkCuvette = false
|
||||
private var checkCuvetteSam = false
|
||||
private var sampleClick = false
|
||||
private lateinit var binding: FragmentHemoCubeReferenceBinding
|
||||
private val hemoCubeViewModel: HemoCubeViewModel by activityViewModels()
|
||||
private lateinit var sharedPreferences: SharedPreferences
|
||||
@@ -110,33 +114,63 @@ class HemoCubeFragment : Fragment() {
|
||||
binding.nameEditText.visibility = View.GONE
|
||||
binding.tvTitle.visibility = View.GONE
|
||||
binding.btnGo.visibility = View.GONE
|
||||
binding.btnPlacebuffer.visibility = View.GONE
|
||||
// binding.btnPlacebuffer.visibility = View.GONE
|
||||
|
||||
binding.tvName.text = "Name: ${testDetails?.name}\n ID: ${testDetails?._id}"
|
||||
binding.tvSubtitle4.text = "Config"
|
||||
|
||||
binding.btnSamplestart.setOnClickListener {
|
||||
activity?.runOnUiThread {
|
||||
binding.tvSubtitle4.visibility = View.VISIBLE
|
||||
// binding.tvSubtitle4.text = "Sample Started"
|
||||
|
||||
if (isBufferValueAvailable() || !Constants.BLANK_EVERY_TEST) {
|
||||
binding.btnPlacebuffer.apply {
|
||||
setBackgroundColor(Color.GREEN) // Set button background color to green
|
||||
text = "Fresh Buffer" // Change button text to "Buffer Exists"
|
||||
}
|
||||
}else if(!isBufferValueAvailable() || Constants.BLANK_EVERY_TEST){
|
||||
binding.btnPlacebuffer.apply {
|
||||
setBackgroundColor(Color.RED) // Set button background color to green
|
||||
text = "No Buffer" // Change button text to "Buffer Exists"
|
||||
}
|
||||
startSampleProcess()
|
||||
it.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.btnPlacebuffer.setOnClickListener {
|
||||
if (isBufferValueAvailable() || !Constants.BLANK_EVERY_TEST) {
|
||||
showBufferAlertDialog()
|
||||
} else {
|
||||
|
||||
binding.btnSamplestart.setOnClickListener {
|
||||
sampleClick = true
|
||||
if(checkCuvetteSam){
|
||||
activity?.runOnUiThread {
|
||||
binding.tvSubtitle4.visibility = View.VISIBLE
|
||||
// binding.tvSubtitle4.text = "Buffer Started"
|
||||
// binding.tvSubtitle4.text = "Sample Started"
|
||||
}
|
||||
|
||||
checkAndStartProcess()
|
||||
it.visibility = View.GONE
|
||||
startSampleProcess()
|
||||
// it.visibility = View.GONE
|
||||
}else{
|
||||
checkCuvettePresence()
|
||||
}
|
||||
}
|
||||
binding.btnRetryCheckCuvette.setOnClickListener {
|
||||
|
||||
checkCuvettePresence()
|
||||
}
|
||||
binding.btnPlacebuffer.setOnClickListener {
|
||||
if(checkCuvette){
|
||||
|
||||
startBufferProcess()
|
||||
// if (isBufferValueAvailable() || !Constants.BLANK_EVERY_TEST) {
|
||||
//// showBufferAlertDialog()
|
||||
// } else {
|
||||
activity?.runOnUiThread {
|
||||
binding.tvSubtitle4.visibility = View.VISIBLE
|
||||
// binding.tvSubtitle4.text = "Buffer Started"
|
||||
}
|
||||
|
||||
// checkAndStartProcess()
|
||||
|
||||
// it.visibility = View.GONE
|
||||
// }
|
||||
}else{
|
||||
checkCuvettePresence()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (sharedPreferences.getString(Constants.USER_ID, "").toString() == "ADMIN") {
|
||||
activity?.runOnUiThread {
|
||||
@@ -149,6 +183,7 @@ class HemoCubeFragment : Fragment() {
|
||||
hemoCubeViewModel.fireBaseUpload.observe(viewLifecycleOwner) { result ->
|
||||
if (result == "Success") {
|
||||
uploadedToCloud = true
|
||||
var accessToken = sharedPreferences.getString(Constants.ACCESS_TOKEN, "").toString()
|
||||
showToast(R.string.test_upload)
|
||||
if (Constants.MOLBIO_INTEGRATION) {
|
||||
hemoCubeViewModel.resultUpload.observe(viewLifecycleOwner) {
|
||||
@@ -161,6 +196,8 @@ class HemoCubeFragment : Fragment() {
|
||||
)
|
||||
}
|
||||
handleReadingFinish()
|
||||
hemoCubeViewModel.uploadLogs()
|
||||
hemoCubeViewModel.downloadClientCertificate()
|
||||
}
|
||||
|
||||
is Result.Error -> {
|
||||
@@ -169,10 +206,11 @@ class HemoCubeFragment : Fragment() {
|
||||
it.exception.let { message ->
|
||||
Toast.makeText(
|
||||
activity,
|
||||
"An error occurred: $message",
|
||||
"$message",
|
||||
Toast.LENGTH_LONG
|
||||
)
|
||||
.show()
|
||||
Log.d("resultuploadfail1", message.toString())
|
||||
}
|
||||
handleReadingFinish()
|
||||
}
|
||||
@@ -256,9 +294,9 @@ class HemoCubeFragment : Fragment() {
|
||||
currentResultData = ""
|
||||
}
|
||||
|
||||
private fun checkAndStartProcess() {
|
||||
startBufferProcess()
|
||||
}
|
||||
// private fun checkAndStartProcess() {
|
||||
// startBufferProcess()
|
||||
// }
|
||||
|
||||
private fun isBufferValueAvailable(): Boolean {
|
||||
return try {
|
||||
@@ -309,7 +347,7 @@ class HemoCubeFragment : Fragment() {
|
||||
|
||||
override fun onClickPositiveButton() {
|
||||
activity?.runOnUiThread {
|
||||
binding.btnPlacebuffer.visibility = View.GONE
|
||||
// binding.btnPlacebuffer.visibility = View.GONE
|
||||
binding.btnSamplestart.visibility = View.VISIBLE
|
||||
binding.tvSubtitle4.text = getString(R.string.place_sample)
|
||||
}
|
||||
@@ -386,7 +424,7 @@ class HemoCubeFragment : Fragment() {
|
||||
resultData += stringData
|
||||
currentResultData += stringData
|
||||
hemoCubeViewModel.deviceMessages.postValue(currentResultData)
|
||||
|
||||
Log.e("testStatus",this.testStatusCode.toString())
|
||||
when {
|
||||
resultData.contains("SNE") && this.testStatusCode < TestStatus.CONFIG_COMPLETED.code -> {
|
||||
processV2HardwareId(resultData)
|
||||
@@ -413,20 +451,51 @@ class HemoCubeFragment : Fragment() {
|
||||
(resultData.contains("#RC") && this.testStatusCode < TestStatus.EPROM_ADC_RETRIEVAL_COMPLETED.code) -> {
|
||||
this.testStatusCode = TestStatus.EPROM_ADC_RETRIEVAL_COMPLETED.code
|
||||
hemoCubeViewModel.messages.postValue("EPROM ADC Loaded")
|
||||
showStartBufferButton()
|
||||
//checkCuvettePresence()
|
||||
}
|
||||
resultData.contains("#CIN") && sampleClick && this.testStatusCode < TestStatus.CUVETTE_PRESENTS.code -> {
|
||||
hemoCubeViewModel.messages.postValue(getString(R.string.cuvette_present))
|
||||
this.testStatusCode = TestStatus.CUVETTE_PRESENTS.code
|
||||
activity?.runOnUiThread {
|
||||
checkCuvetteSam = true
|
||||
binding.btnRetryCheckCuvette.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
resultData.contains("#AIN") && sampleClick && this.testStatusCode <= TestStatus.CUVETTE_ABSENTS.code -> {
|
||||
hemoCubeViewModel.messages.postValue(getString(R.string.cuvette_absent))
|
||||
this.testStatusCode = TestStatus.CUVETTE_ABSENTS.code
|
||||
showRetryButtonForCuvette()
|
||||
}
|
||||
|
||||
resultData.contains("#CIN") && this.testStatusCode < TestStatus.CUVETTE_PRESENT.code -> {
|
||||
hemoCubeViewModel.messages.postValue(getString(R.string.cuvette_present))
|
||||
this.testStatusCode = TestStatus.CUVETTE_PRESENT.code
|
||||
activity?.runOnUiThread {
|
||||
checkCuvette = true
|
||||
binding.btnRetryCheckCuvette.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
resultData.contains("#AIN") && this.testStatusCode <= TestStatus.CUVETTE_ABSENT.code -> {
|
||||
hemoCubeViewModel.messages.postValue(getString(R.string.cuvette_absent))
|
||||
this.testStatusCode = TestStatus.CUVETTE_ABSENT.code
|
||||
showRetryButtonForCuvette()
|
||||
}
|
||||
resultData.contains("#BS") && this.testStatusCode < TestStatus.BUFFER_STARTED.code -> {
|
||||
hemoCubeViewModel.messages.postValue(getString(R.string.buffer_started))
|
||||
this.testStatusCode = TestStatus.BUFFER_STARTED.code
|
||||
}
|
||||
|
||||
resultData.contains("#BC") && this.testStatusCode < TestStatus.BUFFER_COMPLETED.code -> {
|
||||
this.testStatusCode = TestStatus.BUFFER_COMPLETED.code
|
||||
activity?.runOnUiThread {
|
||||
resultData = ""
|
||||
// resultData.replace("#AIN","#BAIN",false)
|
||||
Log.d("resultDataBC",resultData)
|
||||
binding.tvSubtitle4.text = getString(R.string.buffer_completed)
|
||||
binding.btnSamplestart.visibility = View.VISIBLE
|
||||
// binding.btnSamplestart.visibility = View.VISIBLE
|
||||
binding.btnPlacebuffer.visibility = View.GONE
|
||||
}
|
||||
this.testStatusCode = TestStatus.BUFFER_COMPLETED.code
|
||||
|
||||
}
|
||||
|
||||
(resultData.contains("#SS") || resultData.contains("#SS1")) && this.testStatusCode < TestStatus.SAMPLE_STARTED.code -> {
|
||||
@@ -434,11 +503,15 @@ class HemoCubeFragment : Fragment() {
|
||||
activity?.runOnUiThread {
|
||||
binding.tvSubtitle4.text = getString(R.string.sample_started)
|
||||
binding.btnSamplestart.visibility = View.GONE
|
||||
binding.btnPlacebuffer.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
(resultData.contains("#SC") || resultData.contains("#SC1")) && this.testStatusCode < TestStatus.SAMPLE_COMPLETED.code -> {
|
||||
this.testStatusCode = TestStatus.SAMPLE_COMPLETED.code
|
||||
activity?.runOnUiThread {
|
||||
binding.btnSamplestart.visibility = View.GONE
|
||||
}
|
||||
hemoCubeViewModel.messages.postValue(
|
||||
getString(R.string.sample_completed) + "\n" + getString(R.string.gathering_data)
|
||||
)
|
||||
@@ -595,6 +668,13 @@ class HemoCubeFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun showRetryButtonForCuvette() {
|
||||
activity?.runOnUiThread {
|
||||
// binding.btnPlacebuffer.visibility = View.GONE
|
||||
binding.btnRetryCheckCuvette.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
fun finishReading() {
|
||||
repeatReadingCount += 1
|
||||
isTestOngoing = false
|
||||
@@ -681,9 +761,20 @@ class HemoCubeFragment : Fragment() {
|
||||
|
||||
fun showStartBufferButton() {
|
||||
activity?.runOnUiThread {
|
||||
binding.btnRetryCheckCuvette.visibility = View.GONE
|
||||
|
||||
binding.btnPlacebuffer.visibility = View.VISIBLE
|
||||
}
|
||||
hemoCubeViewModel.messages.postValue(getString(R.string.start))
|
||||
// hemoCubeViewModel.messages.postValue(getString(R.string.start))
|
||||
}
|
||||
|
||||
fun showStartSampleButton() {
|
||||
activity?.runOnUiThread {
|
||||
binding.btnRetryCheckCuvette.visibility = View.GONE
|
||||
|
||||
binding.btnSamplestart.visibility = View.VISIBLE
|
||||
}
|
||||
// hemoCubeViewModel.messages.postValue(getString(R.string.start))
|
||||
}
|
||||
|
||||
fun extractV1HardwareId(input: String): String? {
|
||||
@@ -1133,13 +1224,29 @@ class HemoCubeFragment : Fragment() {
|
||||
Toast.makeText(requireContext(), getString(messageResId), Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
private fun startBufferProcess() {
|
||||
hemoCubeViewModel.progressBar.postValue(true)
|
||||
private fun checkCuvettePresence() {
|
||||
Toast.makeText(requireContext(),"Please wait...",Toast.LENGTH_LONG).show()
|
||||
|
||||
activity?.runOnUiThread {
|
||||
binding.btnPlacebuffer.visibility = View.GONE
|
||||
binding.btnRetryCheckCuvette.visibility = View.GONE
|
||||
}
|
||||
|
||||
hemoCubeViewModel.progressBar.postValue(true)
|
||||
|
||||
(activity as HemocubeActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.CHECK_CUVETTE_COMMAND,
|
||||
object : UsbServiceListener {
|
||||
override fun onUsbRead(data: ByteArray?) {}
|
||||
|
||||
override fun onUsbError(e: Exception?) {
|
||||
hemoCubeViewModel.progressBar.postValue(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
private fun startBufferProcess() {
|
||||
hemoCubeViewModel.progressBar.postValue(true)
|
||||
// activity?.runOnUiThread {
|
||||
// binding.btnPlacebuffer.visibility = View.GONE
|
||||
// }
|
||||
(activity as HemocubeActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.START_BUFFER_COMMAND,
|
||||
object : UsbServiceListener {
|
||||
override fun onUsbRead(data: ByteArray?) {}
|
||||
@@ -1151,16 +1258,17 @@ class HemoCubeFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun startSampleProcess() {
|
||||
hemoCubeViewModel.progressBar.postValue(true)
|
||||
hemoCubeViewModel.progressBar.postValue(true)
|
||||
|
||||
(activity as HemocubeActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.START_SAMPLE,
|
||||
object : UsbServiceListener {
|
||||
override fun onUsbRead(data: ByteArray?) {}
|
||||
(activity as HemocubeActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.START_SAMPLE,
|
||||
object : UsbServiceListener {
|
||||
override fun onUsbRead(data: ByteArray?) {}
|
||||
|
||||
override fun onUsbError(e: Exception?) {
|
||||
hemoCubeViewModel.progressBar.postValue(false)
|
||||
}
|
||||
})
|
||||
|
||||
override fun onUsbError(e: Exception?) {
|
||||
hemoCubeViewModel.progressBar.postValue(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun sendFirstGainCommand() {
|
||||
|
||||
@@ -12,10 +12,10 @@ import androidx.lifecycle.viewModelScope
|
||||
import androidx.work.ExistingPeriodicWorkPolicy
|
||||
import androidx.work.PeriodicWorkRequestBuilder
|
||||
import androidx.work.WorkManager
|
||||
import com.example.hpostesting.data.CsvWriter
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.NetworkStatusLiveData
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.util.CsvWriter
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.util.NetworkStatusLiveData
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.dao.HemoCubeBufferDao
|
||||
import com.example.hpostesting.data.dao.HemoCubeDao
|
||||
@@ -88,7 +88,8 @@ class HemoCubeViewModel @Inject constructor(
|
||||
|
||||
private val _networkStatusLiveData = NetworkStatusLiveData(context)
|
||||
val allUserData = hemoCubeDao.getAll()
|
||||
val allPendingUserToUpload = MutableLiveData<List<HemoCubeTestData>>()
|
||||
val allLocalData = hemoCubeDao.getAll()
|
||||
val allPendingUserToUpload = hemoCubeDao.getPendingUser()
|
||||
val allKitTestData = hemoCubeBufferDao.getAll()
|
||||
val deviceData = MutableLiveData<DeviceData?>()
|
||||
|
||||
@@ -111,7 +112,7 @@ class HemoCubeViewModel @Inject constructor(
|
||||
testDetails?.kitSerial = kitSerial
|
||||
}
|
||||
testDetails?.testStatus = testStatus
|
||||
|
||||
// localFileDataSource.backUpDataToCSV("",testDetails)
|
||||
try {
|
||||
if (isOnline) {
|
||||
parseData()
|
||||
@@ -143,6 +144,14 @@ class HemoCubeViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun uploadResultfornew(molbioV2ResultRequest: MolbioV2ResultRequest) = viewModelScope.launch {
|
||||
resultUpload.postValue(Result.Loading())
|
||||
repository.uploadResults(molbioV2ResultRequest).let {
|
||||
resultUpload.postValue(it)
|
||||
}
|
||||
}
|
||||
|
||||
fun checkUpdate(checkUpdateRequest: CheckUpdateRequest) = viewModelScope.launch {
|
||||
checkUpdate.postValue(Result.Loading())
|
||||
repository.checkUpdate(checkUpdateRequest).let {
|
||||
@@ -187,9 +196,9 @@ class HemoCubeViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
fun uploadPendingUser() = viewModelScope.launch {
|
||||
allPendingUserToUpload.postValue(hemoCubeDao.getPendingUser(false))
|
||||
}
|
||||
// fun getPendingUser() = viewModelScope.launch {
|
||||
// allPendingUserToUpload.postValue(hemoCubeDao.getPendingUser(true))
|
||||
// }
|
||||
|
||||
fun uploadHemoCubeResultToDatabaseForBufferCheck(
|
||||
isOnline: Boolean,
|
||||
@@ -305,6 +314,8 @@ class HemoCubeViewModel @Inject constructor(
|
||||
testDetails?.solution = DataHolder.hemoCubeTestData?.solution
|
||||
testDetails?.concentration = DataHolder.hemoCubeTestData?.concentration
|
||||
testDetails?.volume = DataHolder.hemoCubeTestData?.volume
|
||||
testDetails?.filter = DataHolder.hemoCubeTestData?.filter
|
||||
|
||||
}
|
||||
|
||||
private fun addResultTestToDb() {
|
||||
@@ -325,20 +336,24 @@ class HemoCubeViewModel @Inject constructor(
|
||||
fireBaseUpload.postValue("Success")
|
||||
testDetails.localFlag = true
|
||||
if (Constants.MOLBIO_INTEGRATION) {
|
||||
// Sanitize testDetails before using it in the API call
|
||||
val sanitizedTestDetails = sanitizeDoubleValues(testDetails)
|
||||
|
||||
// Now, use sanitizedTestDetails for the API call
|
||||
uploadResult(
|
||||
MolbioV2ResultRequest(
|
||||
mutableListOf(
|
||||
MolbioV2Result(
|
||||
rawData = testDetails,
|
||||
analysisId = testDetails._id,
|
||||
analysisDate = testDetails.testTime,
|
||||
analysisStatus = testDetails.classificationResult,
|
||||
thresholds = Constants.BUFFER_INTENSITY_THRESHOLDS[testDetails.deviceId].toString(),
|
||||
interpretation = testDetails.classificationResult,
|
||||
testId = testDetails._id,
|
||||
testTime = testDetails.testTime,
|
||||
collectionTime = testDetails.testTime,
|
||||
expiryTime = testDetails.testTime,
|
||||
rawData = sanitizedTestDetails,
|
||||
analysisId = sanitizedTestDetails._id,
|
||||
analysisDate = sanitizedTestDetails.testTime,
|
||||
analysisStatus = sanitizedTestDetails.classificationResult,
|
||||
thresholds = Constants.BUFFER_INTENSITY_THRESHOLDS[sanitizedTestDetails.deviceId]?.toString(),
|
||||
interpretation = sanitizedTestDetails.classificationResult,
|
||||
testId = sanitizedTestDetails._id,
|
||||
testTime = sanitizedTestDetails.testTime,
|
||||
collectionTime = sanitizedTestDetails.testTime,
|
||||
expiryTime = sanitizedTestDetails.testTime,
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -380,6 +395,19 @@ class HemoCubeViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun sanitizeDoubleValues(hemoCubeTestData: HemoCubeTestData): HemoCubeTestData {
|
||||
hemoCubeTestData::class.java.declaredFields.forEach { field ->
|
||||
if (field.type == Double::class.javaObjectType || field.type == Double::class.javaPrimitiveType) {
|
||||
field.isAccessible = true
|
||||
val value = field.get(hemoCubeTestData) as Double?
|
||||
if (value != null && (value.isInfinite() || value.isNaN())) {
|
||||
field.set(hemoCubeTestData, 0.0) // Replace with a suitable default value
|
||||
}
|
||||
}
|
||||
}
|
||||
return hemoCubeTestData
|
||||
}
|
||||
|
||||
private fun updateLocalFlag(userId: String) = viewModelScope.launch {
|
||||
hemoCubeDao.updateFieldById(id = userId, true)
|
||||
}
|
||||
@@ -533,7 +561,7 @@ class HemoCubeViewModel @Inject constructor(
|
||||
val fileName = "HPOS${getCurrentDate()}.csv"
|
||||
if (localFileDataSource.exportDataToCSV(fileName, hemoCubeTestData)) {
|
||||
hemoCubeTestData.forEach { data ->
|
||||
data.localFlag = true
|
||||
// data.localFlag = true
|
||||
hemoCubeDao.updateCSVFieldById(
|
||||
data._id,
|
||||
true
|
||||
|
||||
@@ -11,19 +11,21 @@ import android.content.ServiceConnection
|
||||
import android.hardware.usb.UsbDevice
|
||||
import android.hardware.usb.UsbDeviceConnection
|
||||
import android.hardware.usb.UsbManager
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.IBinder
|
||||
import android.util.Log
|
||||
import android.view.Menu
|
||||
import android.widget.Toast
|
||||
import androidx.activity.viewModels
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.testRight.UsbService
|
||||
import com.example.hpostesting.util.UsbService
|
||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
@@ -43,6 +45,7 @@ open class HemocubeActivity : AppCompatActivity() {
|
||||
private val TAG = "HemoCube"
|
||||
|
||||
private val broadcastReceiver = object : BroadcastReceiver() {
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
|
||||
synchronized(this) {
|
||||
@@ -82,6 +85,7 @@ open class HemocubeActivity : AppCompatActivity() {
|
||||
super.attachBaseContext(newBase)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityHemocubeBinding.inflate(layoutInflater)
|
||||
@@ -106,6 +110,7 @@ open class HemocubeActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
open fun connectUsb(permissionGranted: Boolean) {
|
||||
Log.d(TAG, "connectUsb() called, permission variable = $permissionGranted")
|
||||
val manager = getSystemService(Context.USB_SERVICE) as UsbManager
|
||||
@@ -125,6 +130,7 @@ open class HemocubeActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
@SuppressLint("MutableImplicitPendingIntent")
|
||||
private fun requestUserPermission(manager: UsbManager, device: UsbDevice) {
|
||||
val mPendingIntent: PendingIntent
|
||||
@@ -142,15 +148,21 @@ open class HemocubeActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
val filter = IntentFilter(Constants.HEMOCUBE_USB_PERMISSION)
|
||||
registerReceiver(broadcastReceiver, filter)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
registerReceiver(broadcastReceiver, filter, RECEIVER_EXPORTED)
|
||||
}else{
|
||||
registerReceiver(broadcastReceiver, filter)
|
||||
}
|
||||
manager.requestPermission(device, mPendingIntent)
|
||||
}
|
||||
|
||||
|
||||
fun setupService() {
|
||||
val intent = Intent(this, UsbService::class.java)
|
||||
bindService(intent, connection, Context.BIND_AUTO_CREATE)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
open fun reconnectDevice() {
|
||||
mService.disconnect()
|
||||
unbindService(connection)
|
||||
|
||||
@@ -21,10 +21,10 @@ import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.testRight.UsbService
|
||||
import com.example.hpostesting.util.UsbService
|
||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@@ -19,8 +19,9 @@ import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.util.UsbService
|
||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
@@ -132,7 +133,7 @@ class TestRightActivity : AppCompatActivity() {
|
||||
this,
|
||||
0,
|
||||
Intent(Constants.ACTION_USB_PERMISSION),
|
||||
PendingIntent.FLAG_MUTABLE
|
||||
PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
} else {
|
||||
mPendingIntent = PendingIntent.getBroadcast(
|
||||
|
||||
@@ -10,11 +10,11 @@ import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.TestRightCommands
|
||||
import com.example.hpostesting.data.model.ErrorMessage
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.MyDialogListener
|
||||
import com.example.hpostesting.presentation.utils.UIUtils
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@@ -10,13 +10,13 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.TestRightCommands
|
||||
import com.example.hpostesting.data.model.ErrorMessage
|
||||
import com.example.hpostesting.data.model.test.TestType
|
||||
import com.example.hpostesting.presentation.MainActivity
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.MyDialogListener
|
||||
import com.example.hpostesting.presentation.utils.UIUtils
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@@ -11,7 +11,7 @@ import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.model.test.TestRightResultType
|
||||
import com.example.hpostesting.data.model.test.TestType
|
||||
|
||||
@@ -5,8 +5,8 @@ import android.net.Uri
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.NetworkStatusLiveData
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.util.NetworkStatusLiveData
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.dao.UserDao
|
||||
import com.example.hpostesting.data.model.CalculationVariableForTest
|
||||
|
||||
@@ -20,12 +20,12 @@ import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.hemocube.HemoCubeFragment
|
||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||
import com.example.hpostesting.presentation.testRight.UsbService
|
||||
import com.example.hpostesting.util.UsbService
|
||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@@ -13,15 +14,15 @@ import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.data.constant.TestStatus
|
||||
import com.example.hpostesting.data.model.TestState
|
||||
import com.example.hpostesting.data.model.patient.DeviceData
|
||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||
import com.example.hpostesting.presentation.hemocube.HemocubeActivity
|
||||
import com.example.hpostesting.presentation.utils.MyDialogListener
|
||||
@@ -1155,6 +1156,8 @@ class TrueHemeFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun reconnect() {
|
||||
(activity as HemocubeActivity).reconnectDevice()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
(activity as HemocubeActivity).reconnectDevice()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,10 +12,10 @@ import androidx.lifecycle.viewModelScope
|
||||
import androidx.work.ExistingPeriodicWorkPolicy
|
||||
import androidx.work.PeriodicWorkRequestBuilder
|
||||
import androidx.work.WorkManager
|
||||
import com.example.hpostesting.data.CsvWriter
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.NetworkStatusLiveData
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.util.CsvWriter
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.util.NetworkStatusLiveData
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.dao.HemoCubeBufferDao
|
||||
import com.example.hpostesting.data.dao.HemoCubeDao
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
package com.example.hpostesting.data.api
|
||||
package com.example.hpostesting.presentation.utils
|
||||
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
|
||||
interface PropertyProvider {
|
||||
|
||||
fun getProperty(key: String): String
|
||||
}
|
||||
|
||||
interface DeviceCommunicationHandler {
|
||||
fun sendAndListenToDevice(command: HemoCubeCommands, listener: UsbServiceListener)
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.hpostesting.presentation
|
||||
package com.example.hpostesting.presentation.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.hpostesting.presentation
|
||||
package com.example.hpostesting.presentation.utils
|
||||
|
||||
interface UsbServiceListener {
|
||||
fun onUsbRead(data: ByteArray?)
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.example.hpostesting.presentation
|
||||
package com.example.hpostesting.presentation.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
|
||||
class UsbServiceListenerImpl(private val context: Context): UsbServiceListener {
|
||||
override fun onUsbRead(data: ByteArray?) {
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.example.hpostesting
|
||||
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
||||
fun main(){
|
||||
val dateFormat = SimpleDateFormat("MM:HHddMMyyyy", Locale.getDefault())
|
||||
val currentDate = Date()
|
||||
print(dateFormat.format(currentDate))
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.hpostesting.data
|
||||
package com.example.hpostesting.util
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Environment
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.hpostesting.data
|
||||
package com.example.hpostesting.util
|
||||
|
||||
|
||||
import android.content.Context
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.hpostesting.data
|
||||
package com.example.hpostesting.util
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.example.hpostesting.util
|
||||
|
||||
interface PropertyProvider {
|
||||
|
||||
fun getProperty(key: String): String
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.example.hpostesting.util
|
||||
|
||||
import android.content.res.AssetManager
|
||||
import com.example.hpostesting.data.api.PropertyProvider
|
||||
import java.io.InputStream
|
||||
import java.util.Properties
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.hpostesting.data
|
||||
package com.example.hpostesting.util
|
||||
|
||||
sealed class Result<out T : Any> {
|
||||
data class Success<out T : Any>(val data: T) : Result<T>()
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.hpostesting.presentation.testRight
|
||||
package com.example.hpostesting.util
|
||||
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
@@ -9,7 +9,7 @@ import android.util.Log
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.data.constant.TestRightCommands
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||
import com.hoho.android.usbserial.driver.UsbSerialPort
|
||||
import com.hoho.android.usbserial.util.SerialInputOutputManager
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/card_blue_app" />
|
||||
<corners android:radius="20dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,5 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:tint="#FF1010" android:viewportHeight="24"
|
||||
android:tint="#EF0A0A" android:viewportHeight="24"
|
||||
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M17,7l-1.41,1.41L18.17,11H8v2h10.17l-2.58,2.58L17,17l5,-5zM4,5h8V3H4c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h8v-2H4V5z"/>
|
||||
</vector>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 725 B |
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="15dp" />
|
||||
<solid android:color="#D7FF0000" />
|
||||
</shape>
|
||||
@@ -3,8 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
tools:ignore="ExtraText">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:radius="10dp" />
|
||||
<stroke
|
||||
android:color="#000000"
|
||||
android:width="1dp" />
|
||||
android:width="2dp" />
|
||||
</shape>
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?attr/colorControlHighlight">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/white" />
|
||||
<corners android:radius="20dp" />
|
||||
<stroke android:color="@color/red" android:width="1dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Drop Shadow -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#4D000000" /> <!-- Semi-transparent black color -->
|
||||
<corners android:radius="20dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- Original Shape with Blue Color -->
|
||||
<item android:top="5dp" android:right="5dp" android:left="5dp" android:bottom="5dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/card_blue_app" />
|
||||
<corners android:radius="20dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/new_blue" />
|
||||
<corners android:radius="10dp" /> <!-- Adjust the radius as needed -->
|
||||
</shape>
|
||||
5
app/src/main/res/drawable/shows_activity_24.xml
Normal file
5
app/src/main/res/drawable/shows_activity_24.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M19,3L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM14,17L7,17v-2h7v2zM17,13L7,13v-2h10v2zM17,9L7,9L7,7h10v2z"/>
|
||||
|
||||
</vector>
|
||||
@@ -15,7 +15,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:titleTextColor="@color/blue_text_color"
|
||||
app:titleTextColor="#FFFFFF"
|
||||
android:elevation="4dp"
|
||||
app:menu="@menu/my_menu"
|
||||
android:theme="@style/ToolbarTheme"
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
android:layout_gravity="start"
|
||||
android:fitsSystemWindows="true"
|
||||
app:headerLayout="@layout/nav_header_dashboard"
|
||||
app:menu="@menu/activity_main_drawer"
|
||||
app:itemIconTint="@color/blue_text_color" />
|
||||
app:menu="@menu/activity_main_drawer" />
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
@@ -13,7 +13,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:titleTextColor="@color/blue_text_color"
|
||||
app:titleTextColor="#FFFFFF"
|
||||
android:elevation="4dp"
|
||||
app:menu="@menu/my_menu"
|
||||
android:theme="@style/ToolbarTheme"
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/scan_qr_code_of_the_kit"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/app_bar_layout" />
|
||||
|
||||
@@ -41,12 +40,11 @@
|
||||
android:layout_width="258dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_margin="24dp"
|
||||
android:drawableLeft="@drawable/baseline_qr_code_scanner_24_x"
|
||||
android:drawableLeft="@drawable/baseline_qr_code_scanner_24"
|
||||
android:text="@string/scan_now"
|
||||
android:textColor="@color/black"
|
||||
app:backgroundTint="@color/blue_app_light"
|
||||
app:cornerRadius="100dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
|
||||
|
||||
@@ -77,7 +75,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_toLeftOf="@id/tvText1"
|
||||
android:background="@color/red" />
|
||||
android:background="@color/gray" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -85,7 +83,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_toRightOf="@id/tvText1"
|
||||
android:background="@color/red" />
|
||||
android:background="@color/gray" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -98,7 +96,6 @@
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:text="@string/enter_kit_serial_number_manually"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/seperator1" />
|
||||
|
||||
@@ -124,15 +121,13 @@
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<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"
|
||||
android:textColor="@color/red"
|
||||
android:background="@drawable/button_new"
|
||||
app:layout_constraintBottom_toBottomOf="@id/et_abha_id"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:titleTextColor="@color/blue_text_color"
|
||||
app:titleTextColor="#FFFFFF"
|
||||
android:elevation="4dp"
|
||||
app:menu="@menu/my_menu"
|
||||
android:theme="@style/ToolbarTheme"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:titleTextColor="@color/blue_text_color"
|
||||
app:titleTextColor="#FFFFFF"
|
||||
android:elevation="4dp"
|
||||
app:menu="@menu/my_menu"
|
||||
android:theme="@style/ToolbarTheme"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".presentation.dashboard.DashboardActivity">
|
||||
>
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -14,10 +14,19 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
app:titleTextColor="@color/blue_text_color"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/new_blue"
|
||||
app:popupTheme="@style/Theme.HPOS.PopupOverlay" />
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/Theme.HPOS.PopupOverlay" >
|
||||
<TextView
|
||||
android:id="@+id/version_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textStyle="bold"
|
||||
android:layout_gravity="end"
|
||||
android:textSize="18sp"
|
||||
android:layout_marginEnd="15dp"/>
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
39
app/src/main/res/layout/fragment_activities.xml
Normal file
39
app/src/main/res/layout/fragment_activities.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<TextView
|
||||
android:id="@+id/titleText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:gravity="center"
|
||||
android:text="Upload Pending List(Local data)"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textSize="21sp"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_order_offline"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/titleText"
|
||||
android:layout_alignParentStart="true"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/offline_user_list_view" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noDataText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="All up-to-date"
|
||||
android:textSize="22sp"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -39,6 +39,7 @@
|
||||
<Spinner
|
||||
android:id="@+id/spinner_solutions"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:background="@drawable/spinner_border"
|
||||
@@ -50,6 +51,7 @@
|
||||
<Spinner
|
||||
android:id="@+id/spinner_concentration"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="gone"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="48dp"
|
||||
android:background="@drawable/spinner_border"
|
||||
@@ -59,6 +61,20 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/spinner_solutions" />
|
||||
|
||||
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner_admin"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="visible"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="52dp"
|
||||
android:background="@drawable/spinner_border"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/spinner_concentration" />
|
||||
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner_volume"
|
||||
android:layout_width="0dp"
|
||||
@@ -71,7 +87,8 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/spinner_concentration" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_submit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -80,9 +97,8 @@
|
||||
android:clickable="false"
|
||||
android:gravity="center"
|
||||
android:text="Continue"
|
||||
android:textColor="@color/red"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
android:background="@drawable/button_new"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/et_readings_per_sample" />
|
||||
|
||||
@@ -47,48 +47,41 @@
|
||||
style="@style/title1_1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="380dp"
|
||||
android:background="@drawable/baground_auto_dac"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center"
|
||||
android:text="Start"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:textSize="11sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle3" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<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:paddingRight="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:background="@drawable/button_new"
|
||||
android:gravity="center"
|
||||
android:text="Start Auto DAC"
|
||||
android:textColor="@color/red"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<Button
|
||||
android:id="@+id/btn_read_dac"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:gravity="center"
|
||||
android:text="Read Current DAC Values"
|
||||
android:textColor="@color/red"
|
||||
android:background="@drawable/button_new"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
||||
|
||||
@@ -50,45 +50,38 @@
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/baground_auto_dac"
|
||||
android:text="Start"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:textSize="11sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle3" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<Button
|
||||
android:id="@+id/btn_submit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/button_new"
|
||||
android:text="Start Auto DAC"
|
||||
android:textColor="@color/red"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<Button
|
||||
android:id="@+id/btn_read_dac"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:clickable="false"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/button_new"
|
||||
android:text="Read Current DAC Values"
|
||||
android:textColor="@color/red"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/border"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -72,10 +70,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="36dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:background="@drawable/border"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -108,10 +104,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="36dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:background="@drawable/border"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -144,10 +138,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="36dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:background="@drawable/border"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -182,7 +174,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
|
||||
android:layout_marginTop="36dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/llLed4Fields" />
|
||||
@@ -193,30 +185,26 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:text="Start"
|
||||
android:background="@drawable/baground_auto_dac"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle3" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<Button
|
||||
android:id="@+id/btn_submit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:clickable="false"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:gravity="center"
|
||||
android:text="Save"
|
||||
android:background="@drawable/button_new"
|
||||
app:cornerRadius="100dp"
|
||||
android:textColor="@color/red"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/baground_auto_dac"
|
||||
android:text="Start"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center"
|
||||
android:text="Start"
|
||||
android:background="@drawable/baground_auto_dac"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -59,7 +58,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle3" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<Button
|
||||
android:id="@+id/btn_submit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -67,9 +66,8 @@
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/button_new"
|
||||
android:text="Start"
|
||||
android:textColor="@color/red"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
||||
|
||||
@@ -26,130 +26,121 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<GridLayout
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_submit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/check_buffer"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_diagnostics"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/diagnostics"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_auto_dac"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/auto_dac"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_diagnostics" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_calibration"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/calibration"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_auto_dac" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_deviceInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/deviceinfo"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_calibration" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_deviceProvision"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:columnCount="2"
|
||||
android:rowCount="4"
|
||||
android:layout_margin="5dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:visibility="visible"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/deviceProvision"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_subtitle4"
|
||||
>
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_deviceInfo" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_firefox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/Firefox"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_deviceProvision" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_submit"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="120dp"
|
||||
android:textSize="14dp"
|
||||
android:layout_margin="8sp"
|
||||
android:layout_gravity="center"
|
||||
android:clickable="false"
|
||||
android:background="@drawable/pannel_button"
|
||||
android:text="@string/check_buffer"
|
||||
android:textColor="@color/blue_text_color" />
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_files"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/Files"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_firefox" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_diagnostics"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_margin="8sp"
|
||||
android:textSize="14dp"
|
||||
android:layout_gravity="center"
|
||||
android:text="diagnostics"
|
||||
android:clickable="false"
|
||||
android:background="@drawable/pannel_button"
|
||||
android:textColor="@color/blue_text_color" />
|
||||
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_auto_dac"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="120dp"
|
||||
android:textSize="14dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="8sp"
|
||||
android:clickable="false"
|
||||
android:text="@string/auto_dac"
|
||||
android:background="@drawable/pannel_button"
|
||||
android:textColor="@color/blue_text_color"
|
||||
app:cornerRadius="16dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_calibration"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="120dp"
|
||||
android:textSize="14dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="8sp"
|
||||
android:clickable="false"
|
||||
android:text="@string/calibration"
|
||||
android:background="@drawable/pannel_button"
|
||||
android:textColor="@color/blue_text_color"
|
||||
app:cornerRadius="16dp" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_deviceInfo"
|
||||
android:layout_width="160dp"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="14dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_margin="8sp"
|
||||
android:clickable="false"
|
||||
android:text="@string/deviceinfo"
|
||||
android:background="@drawable/pannel_button"
|
||||
android:textColor="@color/blue_text_color"
|
||||
app:cornerRadius="16dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_deviceProvision"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_margin="8sp"
|
||||
android:textSize="14dp"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/deviceProvision"
|
||||
android:background="@drawable/pannel_button"
|
||||
android:textColor="@color/blue_text_color"
|
||||
android:visibility="visible"
|
||||
app:cornerRadius="16dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_firefox"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="120dp"
|
||||
android:textSize="14dp"
|
||||
android:layout_margin="8sp"
|
||||
android:clickable="false"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/Firefox"
|
||||
android:background="@drawable/pannel_button"
|
||||
android:textColor="@color/blue_text_color"
|
||||
app:cornerRadius="16dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_files"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_margin="8sp"
|
||||
android:textSize="14dp"
|
||||
android:layout_gravity="center"
|
||||
android:clickable="false"
|
||||
android:text="@string/Files"
|
||||
android:background="@drawable/pannel_button"
|
||||
android:textColor="@color/blue_text_color"
|
||||
app:cornerRadius="16dp"
|
||||
tools:layout_editor_absoluteX="208dp"
|
||||
tools:layout_editor_absoluteY="240dp" />
|
||||
|
||||
|
||||
</GridLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout
|
||||
>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
||||
@@ -98,7 +98,7 @@
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/btn_submit" />-->
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<Button
|
||||
android:id="@+id/btn_submit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -106,8 +106,7 @@
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/submit"
|
||||
android:textColor="@color/red"
|
||||
android:background="@drawable/button_new"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
||||
|
||||
@@ -108,8 +108,8 @@
|
||||
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_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
@@ -135,66 +135,79 @@
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<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"
|
||||
android:textColor="@color/red"
|
||||
android:background="@drawable/button_new"
|
||||
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
|
||||
android:visibility="gone"
|
||||
android:id="@+id/btn_samplestart"
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_btns"
|
||||
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:cornerRadius="16dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_placebuffer" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4">
|
||||
|
||||
<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:visibility="visible"
|
||||
android:clickable="false"
|
||||
android:text="@string/place_buffer"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_samplestart"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/Start_Sample"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
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:background="@drawable/button_new"
|
||||
android:textColor="@color/red"
|
||||
app:cornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
||||
<Button
|
||||
android:id="@+id/btn_retry_check_cuvette"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/retry"
|
||||
android:textColor="@color/white"
|
||||
app:cornerRadius="16dp"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_submit"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
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:cornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle4" />
|
||||
<Button
|
||||
android:id="@+id/btn_submit"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
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:cornerRadius="16dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/error_message"
|
||||
@@ -209,7 +222,7 @@
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_btns" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_device_messages"
|
||||
@@ -220,9 +233,9 @@
|
||||
android:text="no device message"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="11sp"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/error_message" />
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_btns" />
|
||||
|
||||
<Button
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -38,10 +38,20 @@
|
||||
android:visibility="gone"
|
||||
android:padding="24dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnLogout1"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:src="@drawable/baseline_logout_24"
|
||||
app:layout_constraintTop_toTopOf="@+id/internetNotAvailableCL"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_no_internet"
|
||||
style="@style/title1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="24dp"
|
||||
@@ -125,16 +135,35 @@
|
||||
<!-- app:layout_constraintBottom_toBottomOf="@+id/rv_order_offline"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/label1"
|
||||
style="@style/title1_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/new_kit"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btnNewKitoffline"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/btnNewKitoffline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:backgroundTint="@color/primary"
|
||||
android:contentDescription="@string/new_kit"
|
||||
android:src="@drawable/ic_add"
|
||||
app:elevation="1dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/internetAvailableCL"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="24dp"
|
||||
android:visibility="visible"
|
||||
tools:layout_editor_absoluteX="162dp"
|
||||
tools:layout_editor_absoluteY="-82dp">
|
||||
android:padding="24dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
@@ -155,7 +184,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_title" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnLogout"
|
||||
android:layout_width="30dp"
|
||||
@@ -214,9 +242,8 @@
|
||||
<RadioGroup
|
||||
android:id="@+id/radioGroup"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cardView4">
|
||||
@@ -253,58 +280,52 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/radioGroup"
|
||||
tools:listitem="@layout/user_item_view" />
|
||||
tools:listitem="@layout/user_item_view"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/labelQuickCapture"
|
||||
style="@style/title1_1"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Quick Capture"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btnQuickCapture"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/btnQuickCapture"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:backgroundTint="@color/primary"
|
||||
android:text="Quick Capture"
|
||||
android:visibility="visible"
|
||||
android:contentDescription="Capture measurements quickly"
|
||||
android:src="@drawable/flask"
|
||||
app:elevation="1dp"
|
||||
app:icon="@drawable/flask"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/label"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/label"
|
||||
style="@style/title1_1"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="6dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/rounded_corner_background"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/new_kit"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btnNewKit"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/btnNewKit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:backgroundTint="@color/primary"
|
||||
android:contentDescription="@string/new_kit"
|
||||
android:src="@drawable/ic_add"
|
||||
android:text="@string/new_kit"
|
||||
app:elevation="1dp"
|
||||
app:icon="@drawable/ic_add"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Scan to get the code"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle2" />
|
||||
|
||||
@@ -59,12 +58,11 @@
|
||||
android:layout_width="258dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_margin="24dp"
|
||||
android:drawableLeft="@drawable/baseline_qr_code_scanner_24_x"
|
||||
android:drawableLeft="@drawable/baseline_qr_code_scanner_24"
|
||||
android:text="@string/scan_now"
|
||||
android:textColor="@color/black"
|
||||
app:backgroundTint="@color/blue_app_light"
|
||||
app:cornerRadius="100dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
|
||||
|
||||
@@ -92,9 +90,9 @@
|
||||
android:clickable="false"
|
||||
android:gravity="center"
|
||||
android:text="Refresh"
|
||||
android:textColor="@color/white"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="@id/btn_scan_now"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn_scan_now" />
|
||||
|
||||
|
||||
@@ -52,10 +52,6 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
app:boxCornerRadiusBottomEnd="10dp"
|
||||
app:boxCornerRadiusBottomStart="10dp"
|
||||
app:boxCornerRadiusTopEnd="10dp"
|
||||
app:boxCornerRadiusTopStart="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView">
|
||||
@@ -74,10 +70,6 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxCornerRadiusBottomEnd="10dp"
|
||||
app:boxCornerRadiusBottomStart="10dp"
|
||||
app:boxCornerRadiusTopEnd="10dp"
|
||||
app:boxCornerRadiusTopStart="10dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -92,14 +84,12 @@
|
||||
android:maxLength="12" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnLogin"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/login"
|
||||
android:background="@drawable/button_new"
|
||||
android:textColor="@color/red"
|
||||
app:cornerRadius="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/scan_patient_abha_id_card"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -26,12 +25,11 @@
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:drawableLeft="@drawable/baseline_qr_code_scanner_24_x"
|
||||
android:drawableLeft="@drawable/baseline_qr_code_scanner_24"
|
||||
android:text="@string/scan_now"
|
||||
android:textColor="@color/black"
|
||||
app:backgroundTint="@color/blue_app_light"
|
||||
app:cornerRadius="100dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
|
||||
|
||||
@@ -62,7 +60,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_toLeftOf="@id/tvText1"
|
||||
android:background="@color/red" />
|
||||
android:background="@color/gray" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -70,7 +68,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_toRightOf="@id/tvText1"
|
||||
android:background="@color/red" />
|
||||
android:background="@color/gray" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -83,7 +81,6 @@
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:text="@string/enter_abha_number_manualy"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/seperator1" />
|
||||
|
||||
@@ -108,15 +105,13 @@
|
||||
android:inputType="number" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<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"
|
||||
android:background="@drawable/button_new"
|
||||
android:textColor="@color/red"
|
||||
app:layout_constraintBottom_toBottomOf="@id/et_abha_id"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
@@ -149,7 +144,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_toLeftOf="@id/tvText2"
|
||||
android:background="@color/red" />
|
||||
android:background="@color/gray" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -157,7 +152,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_toRightOf="@id/tvText2"
|
||||
android:background="@color/red" />
|
||||
android:background="@color/gray" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -169,7 +164,6 @@
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:text="Create ABHA ID card"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/seperator2" />
|
||||
|
||||
@@ -183,7 +177,6 @@
|
||||
android:textColor="@color/black"
|
||||
app:backgroundTint="@color/blue_app_light"
|
||||
app:cornerRadius="100dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title3" />
|
||||
|
||||
|
||||
@@ -137,6 +137,15 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/til_careof">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/et_is_married"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/is_patient_married_yes_no"
|
||||
android:inputType="none"
|
||||
android:labelFor="@id/til_is_married"
|
||||
app:simpleItems="@array/yes_no" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
@@ -159,15 +168,6 @@
|
||||
android:labelFor="@id/til_category"
|
||||
app:simpleItems="@array/category" />
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/et_is_married"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/is_patient_married_yes_no"
|
||||
android:inputType="none"
|
||||
android:labelFor="@id/til_is_married"
|
||||
app:simpleItems="@array/yes_no" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/scan_patient_aadhaar_card"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -25,12 +24,11 @@
|
||||
android:layout_width="258dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_margin="24dp"
|
||||
android:drawableLeft="@drawable/baseline_qr_code_scanner_24_x"
|
||||
android:drawableLeft="@drawable/baseline_qr_code_scanner_24"
|
||||
android:text="@string/scan_now"
|
||||
android:textColor="@color/black"
|
||||
app:backgroundTint="@color/blue_app_light"
|
||||
app:cornerRadius="100dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
|
||||
|
||||
@@ -61,7 +59,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_toLeftOf="@id/tvText1"
|
||||
android:background="@color/red" />
|
||||
android:background="@color/gray" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -69,7 +67,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_toRightOf="@id/tvText1"
|
||||
android:background="@color/red" />
|
||||
android:background="@color/gray" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -82,7 +80,6 @@
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:text="@string/enter_aadhaar_number_manualy"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/seperator1" />
|
||||
|
||||
@@ -108,17 +105,15 @@
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<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"
|
||||
android:textColor="@color/red"
|
||||
app:cornerRadius="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/et_abha_id"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="@drawable/button_new"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toEndOf="@id/et_abha_id"
|
||||
app:layout_constraintTop_toTopOf="@id/et_abha_id" />
|
||||
|
||||
@@ -45,15 +45,14 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle1" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<Button
|
||||
android:id="@+id/btn_set_reference"
|
||||
android:layout_width="192dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/set_reference"
|
||||
android:background="@drawable/button_new"
|
||||
android:textColor="@color/red"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle2" />
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle2" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<Button
|
||||
android:id="@+id/btn_submit"
|
||||
android:layout_width="216dp"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -230,8 +230,7 @@
|
||||
android:layout_marginTop="24dp"
|
||||
android:clickable="false"
|
||||
android:text="@string/submit"
|
||||
android:background="@drawable/button_new"
|
||||
android:textColor="@color/red"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_subtitle3" />
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user