BloodGroup changes
This commit is contained in:
@@ -65,16 +65,18 @@ class TestRightResults : Fragment() {
|
||||
private fun setupListeners() {
|
||||
binding.ivHome.setOnClickListener {
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
|
||||
// Get the text from the EditText
|
||||
val bloodGroupText = binding.etBloodGroup.text.toString()
|
||||
|
||||
if (bloodGroupText.isBlank() || bloodGroupText == "Select Blood Group") {
|
||||
if (bloodGroupText.isNullOrBlank() || bloodGroupText == "Select Blood Group") {
|
||||
// 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
|
||||
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 {
|
||||
// No error, continue with the logic
|
||||
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)
|
||||
startActivity(i)
|
||||
// moveToSamplePage()
|
||||
|
||||
Reference in New Issue
Block a user