20/06/2023 -test session bug resolve

This commit is contained in:
smileomi18@gmail.com
2023-06-23 10:51:30 +05:30
parent 8a55ef9011
commit c2cd7d6ff0
7 changed files with 159 additions and 8 deletions

6
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -120,6 +120,8 @@ class ReviewDetailsRegistrationFragment : BaseFragment() {
requireContext().getString(R.string.state_details, userData.state) requireContext().getString(R.string.state_details, userData.state)
binding.tvPincode.text = binding.tvPincode.text =
requireContext().getString(R.string.pincode_details, userData.pinCode) requireContext().getString(R.string.pincode_details, userData.pinCode)
binding.centerName.text =
requireContext().getString(R.string.centre_name, userData.CenterName)
if (userData.isUnderMedication!!) { if (userData.isUnderMedication!!) {
binding.tvIsUnderMedication.text = requireContext().getString( binding.tvIsUnderMedication.text = requireContext().getString(
R.string.is_patient_under_any_medication_details, "Yes" R.string.is_patient_under_any_medication_details, "Yes"
@@ -138,11 +140,15 @@ class ReviewDetailsRegistrationFragment : BaseFragment() {
R.string.is_patient_undergoing_any_blood_transfusion_details, "No" R.string.is_patient_undergoing_any_blood_transfusion_details, "No"
) )
} }
if (userData.sickleCellHistory != "") { if (userData.sickleCellHistory != "") {
binding.tvSickleCellFamilyHistory.text = requireContext().getString( binding.tvSickleCellFamilyHistory.text = requireContext().getString(
R.string.sickle_cell_family_history, userData.sickleCellHistory R.string.sickle_cell_family_history, userData.sickleCellHistory
) )
}else{
binding.tvSickleCellFamilyHistory.text = requireContext().getString(
R.string.sickle_cell_family_history, "No"
)
} }
} }
} }

View File

@@ -4,7 +4,6 @@ import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.RadioButton
import android.widget.Toast import android.widget.Toast
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels import androidx.fragment.app.viewModels
@@ -79,6 +78,59 @@ class UserDetailsRegistrationFragment : Fragment() {
} }
} }
user.sickleCellHistory.let { etFamilyHistory.setText(it) } user.sickleCellHistory.let { etFamilyHistory.setText(it) }
user.isUnderMedication.let {
if (it != null) {
yes.isChecked = it
}
}
user.isUnderTransfusion.let {
if (it != null) {
yes1.isChecked = it
}
}
// user.sickleCellHistory.let {
// if (it != null && binding.etFamilyHistory.isVisible) {
// if (it.isNotEmpty()) {
//
// yes1history.isChecked = true
//
//
// }
//
// }else{
// no1history.isChecked = true
// }
// }
user.sickleCellHistory?.let {
if (binding.etFamilyHistory.isVisible) {
binding.etFamilyHistory.setText(it)
yes1history.isChecked = true
}
}
binding.yes1history.setOnClickListener {
user.sickleCellHistory.let { etFamilyHistory.setText(it) }
binding.tilFamilyHistory.visibility =
if (binding.yes1history.isChecked) View.VISIBLE else View.GONE
}
binding.no1history.setOnClickListener {
binding.tilFamilyHistory.visibility =
if (binding.no1history.isChecked) View.GONE else View.VISIBLE
}
if (yes1history.isChecked) {
binding.tilFamilyHistory.visibility = View.VISIBLE
} else {
binding.tilFamilyHistory.visibility = View.GONE
}
} }
} }
@@ -212,7 +264,14 @@ class UserDetailsRegistrationFragment : Fragment() {
etFamilyHistory.error = "Please enter your family history" etFamilyHistory.error = "Please enter your family history"
return false return false
} else { } else {
userData.isUnderMedication = yes.isChecked
userData.isUnderTransfusion = yes1.isChecked
if(etFamilyHistory.isVisible) {
val familyHistory = etFamilyHistory.text.toString()
userData.sickleCellHistory = familyHistory userData.sickleCellHistory = familyHistory
}else{
userData.sickleCellHistory = ""
} }
return true return true
} }

View File

@@ -196,7 +196,7 @@
app:layout_constraintTop_toBottomOf="@id/tvState" /> app:layout_constraintTop_toBottomOf="@id/tvState" />
<TextView <TextView
android:id="@+id/tvIsUnderMedication" android:id="@+id/centerName"
style="@style/title1_1" style="@style/title1_1"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -205,6 +205,16 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPincode" /> app:layout_constraintTop_toBottomOf="@id/tvPincode" />
<TextView
android:id="@+id/tvIsUnderMedication"
style="@style/title1_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/centerName" />
<TextView <TextView
android:id="@+id/tvIsUnderTransfusion" android:id="@+id/tvIsUnderTransfusion"
style="@style/title1_1" style="@style/title1_1"

View File

@@ -361,6 +361,66 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/radioGroup" /> app:layout_constraintTop_toBottomOf="@id/radioGroup" />
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cb_item2">
<RadioButton
android:id="@+id/yes1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="Yes"
android:textSize="16dp" />
<RadioButton
android:id="@+id/no1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="No"
android:textSize="16dp" />
</RadioGroup>
<TextView
android:id="@+id/cb_item3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:text="@string/is_user_having_any_family_history_for_sickle_cell"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/radioGroup1" />
<RadioGroup
android:id="@+id/historyradiogroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cb_item3">
<RadioButton
android:id="@+id/yes1history"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="Yes"
android:textSize="16dp" />
<RadioButton
android:id="@+id/no1history"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="No"
android:textSize="16dp" />
</RadioGroup>
app:layout_constraintTop_toBottomOf="@id/radioGroup" />
<RadioGroup <RadioGroup
android:id="@+id/radioGroup1" android:id="@+id/radioGroup1"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -396,7 +456,7 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/radioGroup1"> app:layout_constraintTop_toBottomOf="@id/cb_item2">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_familyHistory" android:id="@+id/et_familyHistory"

View File

@@ -23,15 +23,15 @@
<string name="enter_person_s_details">Enter Person\'s Details</string> <string name="enter_person_s_details">Enter Person\'s Details</string>
<string name="person_s_name">Person\'s Name</string> <string name="person_s_name">Person\'s Name</string>
<string name="age">Age in years</string> <string name="age">Age in years</string>
<string name="gender">Gender</string> <string name="gender">Select Gender</string>
<string name="name_error">Name can\'t be empty</string> <string name="name_error">Name can\'t be empty</string>
<string name="age_error">Age can\'t be empty</string> <string name="age_error">Age can\'t be empty</string>
<string name="gender_error">Gender can\'t be empty</string> <string name="gender_error">Gender can\'t be empty</string>
<string name="age_error_out_of_bound">Age should be valid</string> <string name="age_error_out_of_bound">Age should be valid</string>
<string name="birth_year">Birth Year</string> <string name="birth_year">Birth Year</string>
<string name="marital_status">Marital status</string> <string name="marital_status">Select Marital status</string>
<string name="father_s_husband_s_name">Father\'s/Husband\'s Name</string> <string name="father_s_husband_s_name">Father\'s/Husband\'s Name</string>
<string name="caste">Caste</string> <string name="caste">Select Caste</string>
<string name="person_s_address_details">Person\'s Address Details</string> <string name="person_s_address_details">Person\'s Address Details</string>
<string name="district">District</string> <string name="district">District</string>
<string name="city_town">City / Town</string> <string name="city_town">City / Town</string>
@@ -39,10 +39,11 @@
<string name="pincode">Pincode</string> <string name="pincode">Pincode</string>
<string name="patient_medical_records">Patient Medical Records</string> <string name="patient_medical_records">Patient Medical Records</string>
<string name="review">Review</string> <string name="review">Review</string>
<string name="blood_group">Blood Group</string> <string name="blood_group">Select Blood Group</string>
<string name="house">House</string> <string name="house">House</string>
<string name="is_patient_under_any_medication">Is user under any medication or treatment?</string> <string name="is_patient_under_any_medication">Is user under any medication or treatment?</string>
<string name="is_patient_undergoing_any_blood_transfusion">Is user undergoing any blood transfusion?</string> <string name="is_patient_undergoing_any_blood_transfusion">Is user undergoing any blood transfusion?</string>
<string name="user_list">User List</string> <string name="user_list">User List</string>
<string name="register_user">Register User</string> <string name="register_user">Register User</string>
<string name="is_user_having_any_family_history_for_sickle_cell">Is user having any family history for Sickle Cell</string> <string name="is_user_having_any_family_history_for_sickle_cell">Is user having any family history for Sickle Cell</string>
@@ -69,9 +70,12 @@
<string name="city_town_details">City/Town: %1$s</string> <string name="city_town_details">City/Town: %1$s</string>
<string name="district_details">District: %1$s</string> <string name="district_details">District: %1$s</string>
<string name="state_details">State: %1$s</string> <string name="state_details">State: %1$s</string>
<string name="centre_name">Center Name: %1$s</string>
<string name="pincode_details">Pincode: %1$s</string> <string name="pincode_details">Pincode: %1$s</string>
<string name="is_patient_under_any_medication_details">Is Under Medication: %1$s</string> <string name="is_patient_under_any_medication_details">Is Under Medication: %1$s</string>
<string name="is_patient_undergoing_any_blood_transfusion_details">Is Under Blood Transfusion: %1$s</string> <string name="is_patient_undergoing_any_blood_transfusion_details">Is Under Blood Transfusion: %1$s</string>
<string name="is_any_sickle">Is Any Sickle cell History: %1$s</string>
<string name="sickle_cell_family_history">Sickle cell Family History: %1$s</string> <string name="sickle_cell_family_history">Sickle cell Family History: %1$s</string>
<string name="center_name">Center Name</string> <string name="center_name">Center Name</string>