20/06/2023 -test session bug resolve

This commit is contained in:
smileomi18@gmail.com
2023-06-28 16:34:20 +05:30
parent c2cd7d6ff0
commit 21d4aa5624
5 changed files with 57 additions and 156 deletions

View File

@@ -140,14 +140,14 @@ class ReviewDetailsRegistrationFragment : BaseFragment() {
R.string.is_patient_undergoing_any_blood_transfusion_details, "No"
)
}
if (userData.sickleCellHistory != "") {
if (userData.sickleCellHistory == null) {
binding.tvSickleCellFamilyHistory.text = requireContext().getString(
R.string.sickle_cell_family_history, userData.sickleCellHistory
R.string.sickle_cell_family_history, "No"
)
}else{
binding.tvSickleCellFamilyHistory.text = requireContext().getString(
R.string.sickle_cell_family_history, "No"
R.string.sickle_cell_family_history, userData.sickleCellHistory
)
}
}

View File

@@ -5,6 +5,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
@@ -77,59 +78,64 @@ class UserDetailsRegistrationFragment : Fragment() {
yes1.isChecked = 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()) {
//
// user.sickleCellHistory.let{
// if (it != null) {
// if (binding.etFamilyHistory.isVisible) {
// binding.etFamilyHistory.setText(it)
// yes1history.isChecked = true
//
//
// }else{
// no1history.isChecked = true
// }
//
// }else{
// no1history.isChecked = true
// }
// }
user.sickleCellHistory?.let {
if (binding.etFamilyHistory.isVisible) {
binding.etFamilyHistory.setText(it)
// user.isUnderMedication.let {
// if (it != null) {
// yes.isChecked = it
// }
// }
user.sickleCellHistory.let {
if (it != null) {
yes1history.isChecked = true
}
}
// user.sickleCellHistory.let{
// if (it != null) {
// if(yes1history.isChecked){
// yes1history.isChecked = true
// }else if(no1history.isChecked){
// no1history.isChecked
// }
//
//
// }
// }
if (yes1history.isChecked) {
if (binding.yes1history.isChecked) View.VISIBLE else View.GONE
binding.yes1history.setOnClickListener {
user.sickleCellHistory.let { etFamilyHistory.setText(it) }
binding.tilFamilyHistory.visibility =
if (binding.yes1history.isChecked) View.VISIBLE else View.GONE
} else {
binding.tilFamilyHistory.visibility = View.GONE
}
binding.yes1history.setOnClickListener {
binding.tilFamilyHistory.visibility =
if (binding.yes1history.isChecked) View.VISIBLE else View.GONE
user.sickleCellHistory.let { etFamilyHistory.setText(it) }
}
//
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
}
}
}
@@ -259,21 +265,24 @@ class UserDetailsRegistrationFragment : Fragment() {
}
userData.isUnderMedication = yes.isChecked
userData.isUnderTransfusion = yes1.isChecked
val familyHistory = etFamilyHistory.text.toString()
if (familyHistory.isEmpty()) {
etFamilyHistory.error = "Please enter your family history"
return false
} else {
userData.isUnderMedication = yes.isChecked
userData.isUnderTransfusion = yes1.isChecked
userData.sickleCellHistory = yes1history.isChecked.toString()
if(etFamilyHistory.isVisible) {
if (yes1history.isChecked) {
val familyHistory = etFamilyHistory.text.toString()
if (familyHistory.isEmpty()) {
etFamilyHistory.error = "Please enter your family history"
return false
}
userData.sickleCellHistory = familyHistory
}else{
userData.sickleCellHistory = ""
} else {
userData.sickleCellHistory = null
}
return true
}
}

View File

@@ -419,33 +419,6 @@
android:text="No"
android:textSize="16dp" />
</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>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_familyHistory"
@@ -456,7 +429,7 @@
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cb_item2">
app:layout_constraintTop_toBottomOf="@id/historyradiogroup">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_familyHistory"