Caste, Sub Caste and Gender entry updated

This commit is contained in:
mohamedkaif356
2023-09-26 14:36:01 +05:30
parent 8a2b0374e3
commit a239cd882f
5 changed files with 106 additions and 34 deletions

1
.gitignore vendored
View File

@@ -10,6 +10,7 @@
.DS_Store .DS_Store
/build /build
/captures /captures
/app/google-services.json
.externalNativeBuild .externalNativeBuild
.cxx .cxx
local.properties local.properties

View File

@@ -55,12 +55,24 @@ class UserDetailsRegistrationFragment : Fragment() {
private fun autoFillUserData(user: UserData) { private fun autoFillUserData(user: UserData) {
with(binding) { with(binding) {
user.birthYear.let { etYob.setText(it) } user.birthYear.let { etYob.setText(it) }
user.gender.let { etGenderBlock.setText(it, false) } user.gender.let {
when (it) {
"Male" -> {
male.isChecked = true
}
"Female" -> {
female.isChecked = true
}
else -> {
other.isChecked = true
}
}
}
user.phoneNumber.let { etMobile.setText(it) } user.phoneNumber.let { etMobile.setText(it) }
user.careOf.let { etCareof.setText(it) } user.careOf.let { etCareof.setText(it) }
user.maritalStatus.let { etIsMarried.setText(it, false) } user.maritalStatus.let { etIsMarried.setText(it, false) }
user.caste.let { etCaste.setText(it) } user.caste.let { etCaste.setText(it, false) }
user.category.let { etCategory.setText(it) } user.category.let { etCategory.setText(it, false) }
user.subCaste.let { etSubCaste.setText(it) } user.subCaste.let { etSubCaste.setText(it) }
user.house.let { etHouse.setText(it) } user.house.let { etHouse.setText(it) }
user.city.let { etCity.setText(it) } user.city.let { etCity.setText(it) }
@@ -132,12 +144,12 @@ class UserDetailsRegistrationFragment : Fragment() {
userData.birthYear = yob userData.birthYear = yob
} }
val gender = etGenderBlock.text.toString() if (male.isChecked) {
if (gender.isEmpty()) { userData.gender = "Male"
etGenderBlock.error = "Please enter your gender" } else if (female.isChecked) {
return false userData.gender = "Female"
} else { } else {
userData.gender = gender userData.gender = "Other"
} }
val mobile = etMobile.text.toString() val mobile = etMobile.text.toString()

View File

@@ -169,8 +169,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/center_name" android:hint="@string/center_name"
android:inputType="text" android:inputType="text" />
android:maxLength="12" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<TextView <TextView

View File

@@ -48,27 +48,39 @@
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout <RadioGroup
android:id="@+id/til_gender" android:id="@+id/gender"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginHorizontal="24dp" android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp" android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/til_yob"> app:layout_constraintTop_toBottomOf="@id/til_yob">
<AutoCompleteTextView <RadioButton
android:id="@+id/et_gender_block" android:id="@+id/male"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/gender" android:layout_marginStart="10dp"
android:inputType="none" android:checked="true"
android:labelFor="@id/til_gender" android:text="@string/male"
app:simpleItems="@array/gender" /> android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout> <RadioButton
android:id="@+id/female"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/female"
android:textSize="16sp" />
<RadioButton
android:id="@+id/other"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/other"
android:textSize="16sp" />
</RadioGroup>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_mobile" android:id="@+id/til_mobile"
@@ -79,7 +91,7 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/til_gender"> app:layout_constraintTop_toBottomOf="@id/gender">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_mobile" android:id="@+id/et_mobile"
@@ -134,7 +146,7 @@
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_category" android:id="@+id/til_category"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp" android:layout_marginHorizontal="24dp"
@@ -143,17 +155,20 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/til_is_married"> app:layout_constraintTop_toBottomOf="@id/til_is_married">
<com.google.android.material.textfield.TextInputEditText <AutoCompleteTextView
android:id="@+id/et_category" android:id="@+id/et_category"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/_2" /> android:hint="@string/category"
android:inputType="none"
android:labelFor="@id/til_is_married"
app:simpleItems="@array/category" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_caste" android:id="@+id/til_caste"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp" android:layout_marginHorizontal="24dp"
@@ -162,11 +177,14 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/til_category"> app:layout_constraintTop_toBottomOf="@id/til_category">
<com.google.android.material.textfield.TextInputEditText <AutoCompleteTextView
android:id="@+id/et_Caste" android:id="@+id/et_Caste"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/caste" /> android:hint="@string/caste"
android:inputType="none"
android:labelFor="@id/til_is_married"
app:simpleItems="@array/caste" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>

View File

@@ -41,8 +41,8 @@
<string name="review">Review</string> <string name="review">Review</string>
<string name="blood_group">Select Blood Group</string> <string name="blood_group">Select Blood Group</string>
<string name="house">House</string> <string name="house">House</string>
<string name="is_patient_under_any_medication">Is user under any medication or treatment?</string> <string name="is_patient_under_any_medication">Have you been under medication for Sickle Cell in the past three months?</string>
<string name="is_patient_undergoing_any_blood_transfusion">Is user undergoing any blood transfusion?</string> <string name="is_patient_undergoing_any_blood_transfusion">Have you undergone any Blood transfusions in the Past three months ?</string>
<string name="user_list">User List</string> <string name="user_list">User List</string>
<string name="register_user">Register User</string> <string name="register_user">Register User</string>
@@ -83,13 +83,55 @@
<string name="password">Password</string> <string name="password">Password</string>
<string name="login">Login</string> <string name="login">Login</string>
<string name="_2">Category</string> <string name="_2">Category</string>
<string name="category">Category</string>
<string name="male">Male</string>
<string name="female">Female</string>
<string name="other">Other</string>
<string-array name="category"> <string-array name="category">
<item>GEN</item> <item>OPEN</item>
<item>OBC</item>
<item>SC</item> <item>SC</item>
<item>OBC</item>
<item>NT-A</item>
<item>NT-B</item>
<item>NT-C</item>
<item>NT-D</item>
<item>SBC</item>
<item>ST</item> <item>ST</item>
<item>OTHER</item>
</string-array>
<string-array name="caste">
<item>KOLI</item>
<item>MAHAR</item>
<item>BUDDHIST</item>
<item>GOND</item>
<item>KUNBI</item>
<item>TELI</item>
<item>AHIR</item>
<item>LOHAR</item>
<item>MUSLIM</item>
<item>BRAHMAN</item>
<item>PAWAR</item>
<item>CHAMBHAR</item>
<item>KOSHTI</item>
<item>CHAMAR</item>
<item>KUMBHAR</item>
<item>DHIWAR</item>
<item>BARAI</item>
<item>MANNA</item>
<item>PARDESI</item>
<item>NAVI</item>
<item>FULMALI</item>
<item>SHAHU</item>
<item>JAIN</item>
<item>KURMI</item>
<item>SONAR</item>
<item>MALI</item>
<item>DEWANGAN</item>
<item>MOURYA</item>
<item>OTHER</item>
</string-array> </string-array>
<string-array name="marital_status"> <string-array name="marital_status">