BloodGroup changes
This commit is contained in:
@@ -65,16 +65,18 @@ class TestRightResults : Fragment() {
|
|||||||
private fun setupListeners() {
|
private fun setupListeners() {
|
||||||
binding.ivHome.setOnClickListener {
|
binding.ivHome.setOnClickListener {
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
|
|
||||||
// Get the text from the EditText
|
// Get the text from the EditText
|
||||||
val bloodGroupText = binding.etBloodGroup.text.toString()
|
val bloodGroupText = binding.etBloodGroup.text.toString()
|
||||||
|
|
||||||
if (bloodGroupText.isBlank() || bloodGroupText == "Select Blood Group") {
|
if (bloodGroupText.isNullOrBlank() || bloodGroupText == "Select Blood Group") {
|
||||||
// Show error on EditText
|
// Show error on EditText
|
||||||
binding.etBloodGroup.error = "Please enter your blood group"
|
withContext(Dispatchers.Main) {
|
||||||
|
binding.etBloodGroup.error = "Please enter your blood group"
|
||||||
|
}
|
||||||
// Show toast message
|
// Show toast message
|
||||||
Toast.makeText(context, "Please enter your blood group", Toast.LENGTH_SHORT).show()
|
withContext(Dispatchers.Main) {
|
||||||
|
Toast.makeText(context, "Please enter your blood group", Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// No error, continue with the logic
|
// No error, continue with the logic
|
||||||
bloodGroup = bloodGroupText
|
bloodGroup = bloodGroupText
|
||||||
@@ -82,7 +84,12 @@ class TestRightResults : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.ivNext.setOnClickListener {
|
// Rest of your code...
|
||||||
|
|
||||||
|
|
||||||
|
// Rest of your code...
|
||||||
|
|
||||||
|
binding.ivNext.setOnClickListener {
|
||||||
val i = Intent(requireContext().applicationContext, DashboardActivity::class.java)
|
val i = Intent(requireContext().applicationContext, DashboardActivity::class.java)
|
||||||
startActivity(i)
|
startActivity(i)
|
||||||
// moveToSamplePage()
|
// moveToSamplePage()
|
||||||
|
|||||||
Reference in New Issue
Block a user