Compare commits

..

2 Commits

Author SHA1 Message Date
vsuryakumar
b22de3cf8b Merge branch 'main' of https://github.com/surya-x/sickle-cell-updated into navigation-db
Updated to main.
2023-02-13 13:09:46 +05:30
vsuryakumar
0b6d78dfbb Added navigation Drawer. 2023-02-03 11:22:31 +05:30
15 changed files with 480 additions and 406 deletions

1
.gitignore vendored
View File

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

View File

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

View File

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

View File

@@ -10,9 +10,12 @@ import android.os.Bundle
import android.util.Log import android.util.Log
import android.view.Gravity import android.view.Gravity
import android.view.Menu import android.view.Menu
import android.view.MenuItem
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.view.GravityCompat
import androidx.core.view.get import androidx.core.view.get
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.example.hpos.R import com.example.hpos.R
@@ -59,7 +62,8 @@ class MainActivity : AppCompatActivity()
)[MainViewModel::class.java] )[MainViewModel::class.java]
setSupportActionBar(binding.myToolbar) setSupportActionBar(binding.myToolbar)
// supportActionBar?.setDisplayHomeAsUpEnabled(true)
setupNavigationDrawer()
setupListeners() setupListeners()
@@ -69,6 +73,39 @@ class MainActivity : AppCompatActivity()
registerReceiver(mUsbReceiver, filter) 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() { private fun checkAndUpdateUsbConnection() {
val availableDrivers = UsbSerialProber.getDefaultProber().findAllDrivers(getSystemService(Context.USB_SERVICE) as UsbManager) 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){ if (availableDrivers.isNotEmpty() && availableDrivers[0].device.productId == Constants.DEVICE_PRODUCT_ID && availableDrivers[0].device.vendorId == Constants.DEVICE_VENDOR_ID){
@@ -116,4 +153,19 @@ class MainActivity : AppCompatActivity()
return true 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 { binding.btnSubmit.setOnClickListener {
val details = validateAndReturnPatientData() val details = checkAndReturnPatientDetails()
if (details != null) { if (details != null) {
viewModel.patientDetails = details viewModel.patientDetails = details
@@ -97,19 +97,12 @@ class TestRightExpSample : Fragment() {
binding.etGenderBlock.setOnClickListener { binding.ddGender.isErrorEnabled = false } binding.etGenderBlock.setOnClickListener { binding.ddGender.isErrorEnabled = false }
} }
private fun validateAndReturnPatientData(): PatientData? { private fun checkAndReturnPatientDetails(): PatientData? {
val name = binding.etName.editText?.text?.trim() val name = binding.etName.editText?.text?.trim()
if (name.isNullOrEmpty()) { if (name.isNullOrEmpty()) {
binding.etName.error = getString(R.string.name_error) binding.etName.error = getString(R.string.name_error)
return null 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() val age = binding.etAge.editText?.text?.trim()
if (age.isNullOrEmpty()) { if (age.isNullOrEmpty()) {
binding.etAge.error = getString(R.string.age_error) binding.etAge.error = getString(R.string.age_error)

View File

@@ -55,64 +55,6 @@ 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() { fun moveToSamplePage() {
if (DataHolder.sampleReadCounter > Constants.MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE) { if (DataHolder.sampleReadCounter > Constants.MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE) {
DataHolder.sampleReadCounter = 0 DataHolder.sampleReadCounter = 0
@@ -185,4 +127,77 @@ class TestRightResults : Fragment() {
viewModel.saveCsvForTesting(requireContext().applicationContext, "testing$fileName") 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="24dp" android:tint="#BB0303" <vector android:height="16dp" android:tint="#BB0303"
android:viewportHeight="24" android:viewportWidth="24" android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:width="16dp" 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"/> <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> </vector>

View File

@@ -1,5 +1,5 @@
<vector android:height="24dp" android:tint="#2E7D32" <vector android:height="16dp" android:tint="#2E7D32"
android:viewportHeight="24" android:viewportWidth="24" android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:width="16dp" 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"/> <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> </vector>

View File

@@ -0,0 +1,5 @@
<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

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

View File

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

View File

@@ -0,0 +1,21 @@
<?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

@@ -0,0 +1,17 @@
<?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="age_in_textview"><b>Age</b> : %1$s years</string>
<string name="results_in_textview"><b>Results</b> :</string> <string name="results_in_textview"><b>Results</b> :</string>
<string name="negative">Negative\ \ </string> <string name="negative">Negative\ \ </string>
<string name="download_report">Download\nReport</string> <string name="download_report">Download Report</string>
<string name="home">Home</string> <string name="home">Home</string>
<string name="new_test">New Test</string> <string name="new_test">New Test</string>
<string name="start_now">Start Now</string> <string name="start_now">Start Now</string>
@@ -78,10 +78,9 @@
<string name="sickle_cert">Sickle Cert</string> <string name="sickle_cert">Sickle Cert</string>
<string name="sickle_find">Sickle Find</string> <string name="sickle_find">Sickle Find</string>
<string name="submit">Submit</string> <string name="submit">Submit</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> <!-- Navigation Drawer -->
<string name="recommended_age">\*Result to be confirmed with laboratory test as age of the patient is less than 5 years</string> <string name="about_us">About Us</string>
<string name="positive_borderline">Positive Borderline</string> <string name="settings">Settings</string>
<string name="negative_borderline">Negative Borderline</string>
</resources> </resources>