From 676475f34ad30c714ecc6a855070c030f81586cf Mon Sep 17 00:00:00 2001 From: "smileomi18@gmail.com" Date: Tue, 1 Aug 2023 16:09:24 +0530 Subject: [PATCH] BloodGroup changes --- .../presentation/testRight/TestRightResults.kt | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/example/hpostesting/presentation/testRight/TestRightResults.kt b/app/src/main/java/com/example/hpostesting/presentation/testRight/TestRightResults.kt index 033c5bd..2916463 100644 --- a/app/src/main/java/com/example/hpostesting/presentation/testRight/TestRightResults.kt +++ b/app/src/main/java/com/example/hpostesting/presentation/testRight/TestRightResults.kt @@ -65,34 +65,26 @@ 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.isNullOrBlank() || bloodGroupText == "Select Blood Group") { - // Show error on EditText withContext(Dispatchers.Main) { binding.etBloodGroup.error = "Please enter your blood group" } - // Show toast message withContext(Dispatchers.Main) { Toast.makeText(context, "Please enter your blood group", Toast.LENGTH_SHORT).show() } } else { - // No error, continue with the logic + withContext(Dispatchers.Main) { + binding.etBloodGroup.error = null + } bloodGroup = bloodGroupText checkBloodGroup() } } } - // Rest of your code... - - - // Rest of your code... - binding.ivNext.setOnClickListener { val i = Intent(requireContext().applicationContext, DashboardActivity::class.java) startActivity(i) -// moveToSamplePage() } }