Compare commits

..

5 Commits

15 changed files with 402 additions and 476 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
*.iml
.gradle
/local.properties
/.idea/misc.xml
/.idea/caches
/.idea/libraries
/.idea/modules.xml

View File

@@ -4,5 +4,7 @@ enum class TestRightResultType {
NORMAL,
SICKLECELLTRAIT,
SICKLECELLDISEASE,
POSITIVEBORDERLINE,
NEGATIVEBORDERLINE,
UNDEFINED
}

View File

@@ -61,20 +61,20 @@ class ResultCalculationWithMaxImpl : TestRightResultCalculation {
testRightCalculationData.ratioMinRange = 0.0
testRightCalculationData.ratioMaxRange = 0.28
return TestRightResultType.NORMAL
} else if (value >= 0.28 && value < 0.285) {
} else if (value >= 0.28 && value < 0.33) {
testRightCalculationData.ratioMinRange = 0.28
testRightCalculationData.ratioMaxRange = 0.285
return TestRightResultType.UNDEFINED
} else if (value >= 0.285 && value < 0.52) {
testRightCalculationData.ratioMinRange = 0.285
testRightCalculationData.ratioMaxRange = 0.33
return TestRightResultType.NEGATIVEBORDERLINE
} else if (value >= 0.33 && value < 0.52) {
testRightCalculationData.ratioMinRange = 0.33
testRightCalculationData.ratioMaxRange = 0.52
return TestRightResultType.SICKLECELLTRAIT
} else if (value >= 0.52 && value < 0.525) {
} else if (value >= 0.52 && value < 0.57) {
testRightCalculationData.ratioMinRange = 0.52
testRightCalculationData.ratioMaxRange = 0.525
return TestRightResultType.UNDEFINED
}else if (value >= 0.525) {
testRightCalculationData.ratioMinRange = 0.525
testRightCalculationData.ratioMaxRange = 0.57
return TestRightResultType.POSITIVEBORDERLINE
}else if (value >= 0.57) {
testRightCalculationData.ratioMinRange = 0.57
testRightCalculationData.ratioMaxRange = 999.0
return TestRightResultType.SICKLECELLDISEASE
}

View File

@@ -10,12 +10,9 @@ import android.os.Bundle
import android.util.Log
import android.view.Gravity
import android.view.Menu
import android.view.MenuItem
import android.widget.Toast
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.GravityCompat
import androidx.core.view.get
import androidx.lifecycle.ViewModelProvider
import com.example.hpos.R
@@ -62,8 +59,7 @@ class MainActivity : AppCompatActivity()
)[MainViewModel::class.java]
setSupportActionBar(binding.myToolbar)
setupNavigationDrawer()
// supportActionBar?.setDisplayHomeAsUpEnabled(true)
setupListeners()
@@ -73,39 +69,6 @@ class MainActivity : AppCompatActivity()
registerReceiver(mUsbReceiver, filter)
}
private fun setupNavigationDrawer() {
// Pass the ActionBarToggle action into the drawerListener
val actionBarToggle = ActionBarDrawerToggle(this, binding.drawerLayout, 0, 0)
binding.drawerLayout.addDrawerListener(actionBarToggle)
// For the Navigation drawer
supportActionBar?.setDisplayHomeAsUpEnabled(true)
// Call syncState() on the action bar so it'll automatically change to the back button when the drawer layout is open
actionBarToggle.syncState()
// Call setNavigationItemSelectedListener on the NavigationView to detect when items are clicked
binding.navView.setNavigationItemSelectedListener { menuItem: MenuItem ->
when (menuItem.itemId) {
R.id.about_us -> {
Toast.makeText(this, "Test clicked", Toast.LENGTH_SHORT).show()
true
}
R.id.download_report -> {
Toast.makeText(this, "Download clicked", Toast.LENGTH_SHORT).show()
true
}
R.id.settings -> {
Toast.makeText(this, "Settings clicked", Toast.LENGTH_SHORT).show()
true
}
else -> {
false
}
}
}
}
private fun checkAndUpdateUsbConnection() {
val availableDrivers = UsbSerialProber.getDefaultProber().findAllDrivers(getSystemService(Context.USB_SERVICE) as UsbManager)
if (availableDrivers.isNotEmpty() && availableDrivers[0].device.productId == Constants.DEVICE_PRODUCT_ID && availableDrivers[0].device.vendorId == Constants.DEVICE_VENDOR_ID){
@@ -153,19 +116,4 @@ class MainActivity : AppCompatActivity()
return true
}
// override the onSupportNavigateUp() function to launch the Drawer when the hamburger icon is clicked
override fun onSupportNavigateUp(): Boolean {
binding.drawerLayout.openDrawer(binding.navView)
return true
}
// override the onBackPressed() function to close the Drawer when the back button is clicked
override fun onBackPressed() {
if (binding.drawerLayout.isDrawerOpen(GravityCompat.START)) {
binding.drawerLayout.closeDrawer(GravityCompat.START)
} else {
super.onBackPressed()
}
}
}

View File

@@ -74,7 +74,7 @@ class TestRightExpSample : Fragment() {
}
binding.btnSubmit.setOnClickListener {
val details = checkAndReturnPatientDetails()
val details = validateAndReturnPatientData()
if (details != null) {
viewModel.patientDetails = details
@@ -97,12 +97,19 @@ class TestRightExpSample : Fragment() {
binding.etGenderBlock.setOnClickListener { binding.ddGender.isErrorEnabled = false }
}
private fun checkAndReturnPatientDetails(): PatientData? {
private fun validateAndReturnPatientData(): PatientData? {
val name = binding.etName.editText?.text?.trim()
if (name.isNullOrEmpty()) {
binding.etName.error = getString(R.string.name_error)
return null
} else {
val regex = Regex("[|\\\\?*<\":>+\\[\\]'/]")
if (regex.containsMatchIn(name)){
binding.etName.error = getString(R.string.name_error_2)
return null
}
}
val age = binding.etAge.editText?.text?.trim()
if (age.isNullOrEmpty()) {
binding.etAge.error = getString(R.string.age_error)

View File

@@ -55,6 +55,64 @@ class TestRightResults : Fragment() {
}
}
private fun updateResults() {
binding.tvName.text = getString(R.string.name_in_textview, viewModel.patientDetails.name)
binding.tvAge.text =
getString(R.string.age_in_textview, viewModel.patientDetails.age.toString())
binding.tvGender.text =
getString(R.string.gender_in_textview, viewModel.patientDetails.gender)
//TODO: remove
viewModel.patientDetails.results = TestRightResultType.NEGATIVEBORDERLINE
if (DataHolder.selectedTestType == TestType.SICKLECERT){
when (viewModel.patientDetails.results) {
TestRightResultType.NORMAL -> {
binding.resultNormal.visibility = View.VISIBLE
}
TestRightResultType.SICKLECELLDISEASE -> {
binding.resultDisease.visibility = View.VISIBLE
}
TestRightResultType.SICKLECELLTRAIT -> {
binding.resultTrait.visibility = View.VISIBLE
}
TestRightResultType.POSITIVEBORDERLINE -> {
binding.resultPositiveBorderline.visibility = View.VISIBLE
binding.tvRecommended.visibility = View.VISIBLE
}
TestRightResultType.NEGATIVEBORDERLINE -> {
binding.resultNegativeBorderline.visibility = View.VISIBLE
binding.tvRecommended.visibility = View.VISIBLE
}
else -> {
// binding.resultUndefined.visibility = View.VISIBLE
Toast.makeText(requireContext().applicationContext, "Please Test Again", Toast.LENGTH_LONG).show()
moveToSamplePage()
}
}
} else {
when (viewModel.patientDetails.results) {
TestRightResultType.SICKLECELLDISEASE -> {
binding.resultDisease.visibility = View.VISIBLE
binding.resultDisease.text = "Positive"
}
TestRightResultType.NORMAL -> {
binding.resultNormal.visibility = View.VISIBLE
binding.resultNormal.text = "Negative"
}
else -> {
Toast.makeText(requireContext().applicationContext, "Please Test Again", Toast.LENGTH_LONG).show()
moveToSamplePage()
}
}
}
if (viewModel.patientDetails.age < 5) {
binding.tvRecommended.visibility = View.VISIBLE
binding.tvRecommended.text = getString(R.string.recommended_age)
}
}
fun moveToSamplePage() {
if (DataHolder.sampleReadCounter > Constants.MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE) {
DataHolder.sampleReadCounter = 0
@@ -127,77 +185,4 @@ class TestRightResults : Fragment() {
viewModel.saveCsvForTesting(requireContext().applicationContext, "testing$fileName")
}
private fun updateResults() {
binding.tvName.text = getString(R.string.name_in_textview, viewModel.patientDetails.name)
binding.tvAge.text =
getString(R.string.age_in_textview, viewModel.patientDetails.age.toString())
binding.tvGender.text =
getString(R.string.gender_in_textview, viewModel.patientDetails.gender)
if (DataHolder.selectedTestType == TestType.SICKLECERT){
when (viewModel.patientDetails.results) {
TestRightResultType.NORMAL -> {
binding.resultNormal.visibility = View.VISIBLE
}
TestRightResultType.SICKLECELLDISEASE -> {
binding.resultDisease.visibility = View.VISIBLE
}
TestRightResultType.SICKLECELLTRAIT -> {
binding.resultTrait.visibility = View.VISIBLE
}
else -> {
// binding.resultUndefined.visibility = View.VISIBLE
Toast.makeText(requireContext().applicationContext, "Please Test Again", Toast.LENGTH_LONG).show()
moveToSamplePage()
// val i = Intent(requireContext().applicationContext, MainActivity::class.java)
// startActivity(i)
}
}
} else {
when (viewModel.patientDetails.results) {
TestRightResultType.SICKLECELLDISEASE -> {
binding.resultDisease.visibility = View.VISIBLE
binding.resultDisease.text = "Positive"
}
TestRightResultType.NORMAL -> {
binding.resultNormal.visibility = View.VISIBLE
binding.resultNormal.text = "Negative"
}
else -> {
Toast.makeText(requireContext().applicationContext, "Please Test Again", Toast.LENGTH_LONG).show()
moveToSamplePage()
// val i = Intent(requireContext().applicationContext, MainActivity::class.java)
// startActivity(i)
}
}
}
// when (viewModel.patientDetails.results) {
// TestRightResultType.NORMAL -> {
// binding.resultNormal.visibility = View.VISIBLE
// }
// TestRightResultType.SICKLECELLDISEASE -> {
// binding.resultDisease.visibility = View.VISIBLE
// }
// TestRightResultType.SICKLECELLTRAIT -> {
// binding.resultTrait.visibility = View.VISIBLE
// }
// else -> {
// binding.resultUndefined.visibility = View.VISIBLE
// }
// }
// Log.d(TAG, "\n\n\n\nFor intensity Reference array size = ${DataHolder.intensityReferenceArray.size}")
// for (each in DataHolder.intensityReferenceArray){
// Log.d(TAG, "${each}")
// }
//
// Log.d(TAG, "\n\n\n\nFor intensity Reference array size = ${viewModel.intensitySampleArray.size}")
// for (each in viewModel.intensitySampleArray){
// Log.d(TAG, "${each}")
// }
// Log.d(TAG,"")
}
}

View File

@@ -1,5 +1,5 @@
<vector android:height="16dp" android:tint="#BB0303"
<vector android:height="24dp" android:tint="#BB0303"
android:viewportHeight="24" android:viewportWidth="24"
android:width="16dp" xmlns:android="http://schemas.android.com/apk/res/android">
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z"/>
</vector>

View File

@@ -1,5 +1,5 @@
<vector android:height="16dp" android:tint="#2E7D32"
<vector android:height="24dp" android:tint="#2E7D32"
android:viewportHeight="24" android:viewportWidth="24"
android:width="16dp" xmlns:android="http://schemas.android.com/apk/res/android">
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z"/>
</vector>

View File

@@ -1,5 +0,0 @@
<vector android:autoMirrored="true" android:height="24dp"
android:tint="#000000" 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="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
</vector>

View File

@@ -1,5 +0,0 @@
<vector android:autoMirrored="true" android:height="24dp"
android:tint="#000000" 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="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
</vector>

View File

@@ -4,222 +4,206 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.drawerlayout.widget.DrawerLayout
android:id="@+id/drawerLayout"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:titleTextColor="#FFFFFF"
android:elevation="4dp"
app:menu="@menu/my_menu"
android:theme="@style/ToolbarTheme"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/tv_title"
style="@style/title1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="24dp"
android:text="@string/select_the_test"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/my_toolbar" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/cv_item1"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
app:cardElevation="8dp"
app:layout_constraintEnd_toStartOf="@id/cv_item2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_image_item1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:src="@drawable/ic_baseline_blur_on_24"
app:layout_constraintBottom_toTopOf="@id/tv_title_item1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title_item1"
style="@style/title2_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sickle_cert"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_image_item1" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/cv_item2"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:cardElevation="8dp"
app:layout_constraintBottom_toBottomOf="@+id/cv_item1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/cv_item1"
app:layout_constraintTop_toTopOf="@+id/cv_item1" >
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/my_toolbar"
<ImageView
android:id="@+id/iv_image_item2"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ToolbarTheme"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:src="@drawable/ic_baseline_blur_on_24"
app:layout_constraintBottom_toTopOf="@id/tv_title_item2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:menu="@menu/my_menu"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:titleTextColor="#FFFFFF" />
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title"
style="@style/title1"
android:layout_width="wrap_content"
android:id="@+id/tv_title_item2"
style="@style/title2_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="24dp"
android:text="@string/select_the_test"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/my_toolbar" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/cv_item1"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
app:cardElevation="8dp"
app:layout_constraintEnd_toStartOf="@id/cv_item2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_image_item1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:src="@drawable/ic_baseline_blur_on_24"
app:layout_constraintBottom_toTopOf="@id/tv_title_item1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title_item1"
style="@style/title2_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sickle_cert"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_image_item1" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/cv_item2"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:cardElevation="8dp"
app:layout_constraintBottom_toBottomOf="@+id/cv_item1"
android:text="@string/sickle_find"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/cv_item1"
app:layout_constraintTop_toTopOf="@+id/cv_item1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_image_item2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:src="@drawable/ic_baseline_blur_on_24"
app:layout_constraintBottom_toTopOf="@id/tv_title_item2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title_item2"
style="@style/title2_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sickle_find"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_image_item2" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/cv_item3"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
app:cardElevation="8dp"
app:layout_constraintEnd_toStartOf="@id/cv_item4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cv_item1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_image_item3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:src="@drawable/ic_baseline_blur_on_24"
app:layout_constraintBottom_toTopOf="@id/tv_title_item3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title_item3"
style="@style/title2_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hb"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_image_item3" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/cv_item4"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:cardElevation="8dp"
app:layout_constraintBottom_toBottomOf="@id/cv_item3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/cv_item3"
app:layout_constraintTop_toTopOf="@id/cv_item3">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_image_item4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:src="@drawable/ic_baseline_blur_on_24"
app:layout_constraintBottom_toTopOf="@id/tv_title_item4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title_item4"
style="@style/title2_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/thalassemia"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_image_item4" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
app:layout_constraintTop_toBottomOf="@id/iv_image_item2" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.navigation.NavigationView
android:id="@+id/navView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:menu="@menu/drawer_list"
android:layout_marginTop="?actionBarSize"
app:headerLayout="@layout/nav_header"/>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/cv_item3"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_marginTop="32dp"
android:layout_marginStart="16dp"
app:cardElevation="8dp"
app:layout_constraintEnd_toStartOf="@id/cv_item4"
app:layout_constraintTop_toBottomOf="@id/cv_item1"
app:layout_constraintStart_toStartOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_image_item3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:src="@drawable/ic_baseline_blur_on_24"
app:layout_constraintBottom_toTopOf="@id/tv_title_item3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title_item3"
style="@style/title2_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hb"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_image_item3" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/cv_item4"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:cardElevation="8dp"
app:layout_constraintTop_toTopOf="@id/cv_item3"
app:layout_constraintBottom_toBottomOf="@id/cv_item3"
app:layout_constraintStart_toEndOf="@id/cv_item3"
app:layout_constraintEnd_toEndOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_image_item4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:src="@drawable/ic_baseline_blur_on_24"
app:layout_constraintBottom_toTopOf="@id/tv_title_item4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title_item4"
style="@style/title2_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/thalassemia"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_image_item4" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.drawerlayout.widget.DrawerLayout>
</layout>

View File

@@ -86,101 +86,147 @@
android:layout_marginTop="12dp"
android:layout_marginBottom="16dp"
android:text="@string/results_in_textview"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/line" />
<TextView
android:id="@+id/result_normal"
style="@style/title3"
android:layout_width="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_results"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:background="@drawable/result_background_green"
android:drawablePadding="4dp"
android:text="@string/normal"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_baseline_check_circle_24"
app:layout_constraintBottom_toBottomOf="@+id/tv_result"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintStart_toEndOf="@+id/tv_result"
app:layout_constraintTop_toTopOf="@+id/tv_result" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_result">
<TextView
android:id="@+id/result_normal"
style="@style/title1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:background="@drawable/result_background_green"
android:text="@string/normal"
android:textAlignment="center"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_baseline_check_circle_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/result_disease"
style="@style/title1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:background="@drawable/result_background_red"
android:text="@string/sickle_cell_disease"
android:textAlignment="center"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_baseline_cancel_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/result_trait"
style="@style/title1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:background="@drawable/result_background_red"
android:text="@string/sickle_cell_trait"
android:textAlignment="center"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_baseline_cancel_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/result_positive_borderline"
style="@style/title1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:background="@drawable/result_background_red"
android:text="@string/positive_borderline"
android:textAlignment="center"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_baseline_cancel_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/result_negative_borderline"
style="@style/title1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:background="@drawable/result_background_green"
android:text="@string/negative_borderline"
android:textAlignment="center"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_baseline_check_circle_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/result_disease"
style="@style/title3"
android:layout_width="wrap_content"
android:id="@+id/tv_recommended"
style="@style/title2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:background="@drawable/result_background_red"
android:drawablePadding="4dp"
android:layout_marginTop="4dp"
android:visibility="gone"
android:text="@string/sickle_cell_disease"
app:drawableStartCompat="@drawable/ic_baseline_cancel_24"
app:layout_constraintBottom_toBottomOf="@+id/tv_result"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintStart_toEndOf="@+id/tv_result"
app:layout_constraintTop_toTopOf="@+id/tv_result" />
android:text="@string/recommended"
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@id/cl_results" />
<TextView
android:id="@+id/result_trait"
style="@style/title3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:background="@drawable/result_background_red"
android:drawablePadding="4dp"
android:visibility="gone"
android:text="@string/sickle_cell_trait"
app:drawableStartCompat="@drawable/ic_baseline_cancel_24"
app:layout_constraintBottom_toBottomOf="@+id/tv_result"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintStart_toEndOf="@+id/tv_result"
app:layout_constraintTop_toTopOf="@+id/tv_result" />
<TextView
android:id="@+id/result_undefined"
style="@style/title3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:background="@drawable/result_background_yellow"
android:drawablePadding="4dp"
android:visibility="gone"
android:text="@string/undefined"
app:drawableStartCompat="@drawable/ic_baseline_circle_24"
app:layout_constraintBottom_toBottomOf="@+id/tv_result"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintStart_toEndOf="@+id/tv_result"
app:layout_constraintTop_toTopOf="@+id/tv_result" />
<!-- <TextView-->
<!-- android:id="@+id/result_undefined"-->
<!-- style="@style/title3"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginHorizontal="16dp"-->
<!-- android:background="@drawable/result_background_yellow"-->
<!-- android:drawablePadding="4dp"-->
<!-- android:text="@string/undefined"-->
<!-- android:visibility="visible"-->
<!-- app:drawableStartCompat="@drawable/ic_baseline_circle_24"-->
<!-- app:layout_constraintBottom_toBottomOf="@+id/tv_result"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintHorizontal_bias="1"-->
<!-- app:layout_constraintStart_toEndOf="@+id/tv_result"-->
<!-- app:layout_constraintTop_toTopOf="@+id/tv_result" />-->
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<!-- <ImageView-->
<!-- android:id="@+id/iv_download"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="42dp"-->
<!-- android:layout_marginStart="24dp"-->
<!-- android:src="@drawable/ic_baseline_file_download_24"-->
<!-- app:layout_constraintStart_toStartOf="@id/cv_sample_details"-->
<!-- app:layout_constraintTop_toBottomOf="@id/cv_sample_details" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_download"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="42dp"-->
<!-- android:layout_marginStart="24dp"-->
<!-- android:src="@drawable/ic_baseline_file_download_24"-->
<!-- app:layout_constraintStart_toStartOf="@id/cv_sample_details"-->
<!-- app:layout_constraintTop_toBottomOf="@id/cv_sample_details" />-->
<!-- <TextView-->
<!-- style="@style/title3"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="@string/download_report"-->
<!-- android:textAlignment="center"-->
<!-- android:textColor="@color/gray"-->
<!-- app:layout_constraintEnd_toEndOf="@id/iv_download"-->
<!-- app:layout_constraintStart_toStartOf="@id/iv_download"-->
<!-- app:layout_constraintTop_toBottomOf="@id/iv_download" />-->
<!-- <TextView-->
<!-- style="@style/title3"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="@string/download_report"-->
<!-- android:textAlignment="center"-->
<!-- android:textColor="@color/gray"-->
<!-- app:layout_constraintEnd_toEndOf="@id/iv_download"-->
<!-- app:layout_constraintStart_toStartOf="@id/iv_download"-->
<!-- app:layout_constraintTop_toBottomOf="@id/iv_download" />-->
<ImageView
android:id="@+id/iv_home"
@@ -189,8 +235,8 @@
android:layout_marginTop="42dp"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_baseline_home_24"
app:layout_constraintStart_toStartOf="@id/cv_sample_details"
app:layout_constraintEnd_toStartOf="@id/iv_next"
app:layout_constraintStart_toStartOf="@id/cv_sample_details"
app:layout_constraintTop_toBottomOf="@id/cv_sample_details" />
<TextView
@@ -209,12 +255,12 @@
android:id="@+id/iv_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="42dp"
android:layout_marginEnd="24dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_baseline_new_label_24"
app:layout_constraintStart_toEndOf="@id/iv_home"
app:layout_constraintEnd_toEndOf="@id/cv_sample_details"
app:layout_constraintStart_toEndOf="@id/iv_home"
app:layout_constraintTop_toBottomOf="@id/cv_sample_details" />
<TextView

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/navConstraint"
android:layout_width="match_parent"
android:layout_height="200dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:id="@+id/headerImage"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/hpos_icon_foreground" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/about_us"
android:icon="@drawable/ic_baseline_info_24"
android:title="@string/about_us" />
<item
android:id="@+id/download_report"
android:icon="@drawable/ic_baseline_file_download_24"
android:title="@string/download_report" />
<item
android:id="@+id/settings"
android:icon="@drawable/ic_baseline_settings_24"
android:title="@string/settings" />
</menu>

View File

@@ -60,7 +60,7 @@
<string name="age_in_textview"><b>Age</b> : %1$s years</string>
<string name="results_in_textview"><b>Results</b> :</string>
<string name="negative">Negative\ \ </string>
<string name="download_report">Download Report</string>
<string name="download_report">Download\nReport</string>
<string name="home">Home</string>
<string name="new_test">New Test</string>
<string name="start_now">Start Now</string>
@@ -78,9 +78,10 @@
<string name="sickle_cert">Sickle Cert</string>
<string name="sickle_find">Sickle Find</string>
<string name="submit">Submit</string>
<!-- Navigation Drawer -->
<string name="about_us">About Us</string>
<string name="settings">Settings</string>
<string name="name_error_2">Invalid character, Allowed characters are Letters, Numbers and ( ) _ - , . only</string>
<string name="recommended">\*Result to be confirmed with laboratory test</string>
<string name="recommended_age">\*Result to be confirmed with laboratory test as age of the patient is less than 5 years</string>
<string name="positive_borderline">Positive Borderline</string>
<string name="negative_borderline">Negative Borderline</string>
</resources>