diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 92a5e6c..43b22c9 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -8,7 +8,7 @@ - + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3761d29..e53037f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -25,7 +25,7 @@ + deteleIncompleteRegistration(userDataList) + } } private fun logoutUser(context: Context) { @@ -87,7 +91,7 @@ class UserListFragment : BaseFragment() { // Positive button builder.setPositiveButton("Yes") { dialog, _ -> - saveUserId("") + saveUserId() findNavController().navigate(R.id.action_userListFragment_to_loginFragment) dialog.dismiss() } @@ -101,9 +105,9 @@ class UserListFragment : BaseFragment() { dialog.show() } - private fun saveUserId(userId: String) { + private fun saveUserId() { with(sharedPreference.edit()) { - putString(Constant.USER_ID, userId) + putString(Constant.USER_ID, "") apply() } } @@ -188,7 +192,7 @@ class UserListFragment : BaseFragment() { private fun deteleIncompleteRegistration(userDataList: List) { userDataList.forEach { - if (it._id.isEmpty()) { + if (it.userImageURL.isEmpty()) { viewModel.deleteById(it._id) } } diff --git a/app/src/main/java/com/example/hposregistration/ui/fragments/registration/ReviewDetailsRegistrationFragment.kt b/app/src/main/java/com/example/hposregistration/ui/fragments/registration/ReviewDetailsRegistrationFragment.kt index 775860a..dcddf34 100644 --- a/app/src/main/java/com/example/hposregistration/ui/fragments/registration/ReviewDetailsRegistrationFragment.kt +++ b/app/src/main/java/com/example/hposregistration/ui/fragments/registration/ReviewDetailsRegistrationFragment.kt @@ -122,10 +122,14 @@ class ReviewDetailsRegistrationFragment : BaseFragment() { requireContext().getString(R.string.care_of_details, userData.careOf) binding.tvMaritalStatus.text = requireContext().getString(R.string.marital_status_details, userData.maritalStatus) + binding.tvCategory.text = + requireContext().getString(R.string.category_details, userData.category) binding.tvCaste.text = requireContext().getString(R.string.caste_details, userData.caste) - binding.tvSubCaste.text = - requireContext().getString(R.string.sub_caste_details, userData.subCaste) + if (userData.subCaste != "") { + binding.tvSubCaste.text = + requireContext().getString(R.string.sub_caste_details, userData.subCaste) + } binding.tvHouse.text = requireContext().getString(R.string.house_details, userData.house) binding.tvCity.text = diff --git a/app/src/main/java/com/example/hposregistration/ui/fragments/registration/UserDetailsRegistrationFragment.kt b/app/src/main/java/com/example/hposregistration/ui/fragments/registration/UserDetailsRegistrationFragment.kt index e92aa0f..1e3aaf3 100644 --- a/app/src/main/java/com/example/hposregistration/ui/fragments/registration/UserDetailsRegistrationFragment.kt +++ b/app/src/main/java/com/example/hposregistration/ui/fragments/registration/UserDetailsRegistrationFragment.kt @@ -76,59 +76,24 @@ class UserDetailsRegistrationFragment : Fragment() { yes1.isChecked = it } } -// user.sickleCellHistory.let{ -// if (it != null) { -// if (binding.etFamilyHistory.isVisible) { -// binding.etFamilyHistory.setText(it) -// yes1history.isChecked = true -// }else{ -// no1history.isChecked = true -// } -// } -// } -// 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 user.sickleCellHistory.let { etFamilyHistory.setText(it) } - - - - } 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 @@ -200,10 +165,18 @@ class UserDetailsRegistrationFragment : Fragment() { val category = etCaste.text.toString() if (category.isEmpty()) { + etCaste.error = "Please enter your category" + return false + } else { + userData.category = category + } + + val caste = etCaste.text.toString() + if (caste.isEmpty()) { etCaste.error = "Please enter your caste" return false } else { - userData.caste = category + userData.caste = caste } val subCaste = etSubCaste.text.toString() @@ -251,13 +224,6 @@ class UserDetailsRegistrationFragment : Fragment() { userData.pinCode = pincode } -// val bloodGroup = etBloodGroup.text.toString() -// if (bloodGroup.isEmpty()) { -// etBloodGroup.error = "Please enter your blood group" -// return false -// } else { -// userData.bloodGroup = bloodGroup -// } userData.isUnderMedication = yes.isChecked userData.isUnderTransfusion = yes1.isChecked userData.sickleCellHistory = yes1history.isChecked.toString() diff --git a/app/src/main/res/layout/fragment_review_details_registration.xml b/app/src/main/res/layout/fragment_review_details_registration.xml index d1f4eef..1bfec76 100644 --- a/app/src/main/res/layout/fragment_review_details_registration.xml +++ b/app/src/main/res/layout/fragment_review_details_registration.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" - tools:context=".ui.fragments.registration.ReviewDetailsRegistrationFragment"> + tools:context="com.example.hposregistration.ui.fragments.registration.ReviewDetailsRegistrationFragment"> + + + + + + + + + app:layout_constraintTop_toBottomOf="@id/til_caste"> Birth Year Select Marital status Father\'s/Husband\'s Name - Select Caste + Caste Person\'s Address Details District City / Town @@ -64,6 +64,7 @@ Mobile Number: %1$s Father\'s/Husband\'s Name: %1$s Marital Status: %1$s + Category: %1$s Caste: %1$s Sub Caste: %1$s House: %1$s @@ -81,7 +82,7 @@ Login ID Password Login - Caste + Category