|
@ -8,6 +8,7 @@ import android.text.InputFilter.LengthFilter |
|
|
import android.text.TextWatcher |
|
|
import android.text.TextWatcher |
|
|
import android.util.Log |
|
|
import android.util.Log |
|
|
import android.view.LayoutInflater |
|
|
import android.view.LayoutInflater |
|
|
|
|
|
import android.view.MotionEvent |
|
|
import android.view.View |
|
|
import android.view.View |
|
|
import android.view.ViewGroup |
|
|
import android.view.ViewGroup |
|
|
import android.widget.ArrayAdapter |
|
|
import android.widget.ArrayAdapter |
|
@ -134,11 +135,6 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlTitle) |
|
|
removeError(binding.tlTitle) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
val splitStringName = |
|
|
|
|
|
(activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_APPNAME1?.split( |
|
|
|
|
|
"\\s".toRegex() |
|
|
|
|
|
)?.toTypedArray() |
|
|
|
|
|
|
|
|
|
|
|
binding.edtFirstName.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtFirstName.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -151,8 +147,6 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlFirstName) |
|
|
removeError(binding.tlFirstName) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
binding.edtFirstName.setText(splitStringName?.get(0).toString()) |
|
|
|
|
|
|
|
|
|
|
|
binding.edtMiddleName.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtMiddleName.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -165,8 +159,6 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlMiddleName) |
|
|
removeError(binding.tlMiddleName) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
binding.edtMiddleName.setText(splitStringName?.get(1).toString()) |
|
|
|
|
|
|
|
|
|
|
|
binding.edtLastName.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtLastName.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -179,7 +171,21 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlLastName) |
|
|
removeError(binding.tlLastName) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
binding.edtLastName.setText(splitStringName?.get(2).toString()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val splitStringName = |
|
|
|
|
|
(activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_APPNAME1?.split( |
|
|
|
|
|
"\\s".toRegex() |
|
|
|
|
|
)?.toTypedArray() |
|
|
|
|
|
if (splitStringName?.size == 1) { |
|
|
|
|
|
binding.edtFirstName.setText(splitStringName[0]) |
|
|
|
|
|
} else if (splitStringName?.size == 2) { |
|
|
|
|
|
binding.edtFirstName.setText(splitStringName[0]) |
|
|
|
|
|
binding.edtLastName.setText(splitStringName[1]) |
|
|
|
|
|
} else if (splitStringName?.size == 3) { |
|
|
|
|
|
binding.edtFirstName.setText(splitStringName[0]) |
|
|
|
|
|
binding.edtMiddleName.setText(splitStringName[1]) |
|
|
|
|
|
binding.edtLastName.setText(splitStringName[2]) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
binding.spGender.setOnItemClickListener { _, _, _, _ -> |
|
|
binding.spGender.setOnItemClickListener { _, _, _, _ -> |
|
|
removeError(binding.tlGender) |
|
|
removeError(binding.tlGender) |
|
@ -220,23 +226,6 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlMarital) |
|
|
removeError(binding.tlMarital) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
binding.spRelation.setOnItemClickListener { _, _, _, _ -> |
|
|
|
|
|
removeError(binding.tlRelation) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
binding.edtRelationName.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
|
|
|
|
|
removeError(binding.tlRelationName) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
binding.edtAddressLine1.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtAddressLine1.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -249,6 +238,8 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlAddressLine1) |
|
|
removeError(binding.tlAddressLine1) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
binding.edtAddressLine1.setText((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_ADD1) |
|
|
|
|
|
|
|
|
binding.edtAddressLine2.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtAddressLine2.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -261,6 +252,8 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlAddressLine2) |
|
|
removeError(binding.tlAddressLine2) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
binding.edtAddressLine2.setText((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_ADD2) |
|
|
|
|
|
|
|
|
binding.edtAddressLine3.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtAddressLine3.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -273,6 +266,7 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlAddressLine3) |
|
|
removeError(binding.tlAddressLine3) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
binding.edtAddressLine3.setText((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_ADD3) |
|
|
|
|
|
|
|
|
binding.spState.setOnItemClickListener { _, _, _, _ -> |
|
|
binding.spState.setOnItemClickListener { _, _, _, _ -> |
|
|
removeError(binding.tlState) |
|
|
removeError(binding.tlState) |
|
@ -292,11 +286,13 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlPinCode) |
|
|
removeError(binding.tlPinCode) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
binding.edtPinCode.setText((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_PINCODE) |
|
|
|
|
|
|
|
|
// Nominee Details |
|
|
// Nominee Details |
|
|
binding.spNomineeTitle.setOnItemClickListener { _, _, _, _ -> |
|
|
binding.spNomineeTitle.setOnItemClickListener { _, _, _, _ -> |
|
|
binding.tlNomineeTitle.error = null |
|
|
binding.tlNomineeTitle.error = null |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
binding.edtNomineeFirstName.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtNomineeFirstName.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -333,14 +329,29 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlNomineeLastName) |
|
|
removeError(binding.tlNomineeLastName) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
val splitNomineeName = (activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Nominees?.get(0)?.NomineeName?.split( |
|
|
|
|
|
"\\s".toRegex())?.toTypedArray() |
|
|
|
|
|
if (splitNomineeName?.size == 1) { |
|
|
|
|
|
binding.edtNomineeFirstName.setText(splitNomineeName[0]) |
|
|
|
|
|
}else if (splitNomineeName?.size == 2){ |
|
|
|
|
|
binding.edtNomineeFirstName.setText(splitNomineeName[0]) |
|
|
|
|
|
binding.edtNomineeLastName.setText(splitNomineeName[1]) |
|
|
|
|
|
}else if(splitNomineeName?.size == 3){ |
|
|
|
|
|
binding.edtNomineeFirstName.setText(splitNomineeName[0]) |
|
|
|
|
|
binding.edtNomineeMiddleName.setText(splitNomineeName[1]) |
|
|
|
|
|
binding.edtNomineeLastName.setText(splitNomineeName[2]) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
binding.edtNomineeDOB.setText((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_DOB) |
|
|
binding.edtNomineeDOB.setOnClickListener { |
|
|
binding.edtNomineeDOB.setOnClickListener { |
|
|
removeError(binding.tlNomineeDOB) |
|
|
removeError(binding.tlNomineeDOB) |
|
|
datePicker(binding.edtNomineeDOB) |
|
|
datePicker(binding.edtNomineeDOB) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
binding.spNomineeRelation.setOnItemClickListener { _, _, _, _ -> |
|
|
binding.spNomineeRelation.setOnItemClickListener { _, _, _, _ -> |
|
|
removeError(binding.tlNomineeRelation) |
|
|
removeError(binding.tlNomineeRelation) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
binding.cbNomineeSameAddress.setOnCheckedChangeListener { _, _ -> |
|
|
binding.cbNomineeSameAddress.setOnCheckedChangeListener { _, _ -> |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -358,6 +369,8 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlGuardianName) |
|
|
removeError(binding.tlGuardianName) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
binding.edtGuardianName.setText((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Nominees?.get(0)?.NomineeGuardian) |
|
|
|
|
|
|
|
|
binding.edtGuardianAge.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtGuardianAge.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -370,9 +383,11 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlGuardianAge) |
|
|
removeError(binding.tlGuardianAge) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
binding.spGuardianRelation.setOnItemClickListener { _, _, _, _ -> |
|
|
binding.spGuardianRelation.setOnItemClickListener { _, _, _, _ -> |
|
|
removeError(binding.tlGuardianRelation) |
|
|
removeError(binding.tlGuardianRelation) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
binding.edtGuardianAddress.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtGuardianAddress.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -417,6 +432,8 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlIFSC) |
|
|
removeError(binding.tlIFSC) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
// binding.edtIFSC.setText() |
|
|
|
|
|
|
|
|
binding.edtAccountNumber.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtAccountNumber.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -717,14 +734,32 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
) |
|
|
) |
|
|
binding.spTitle.setAdapter(adapter) |
|
|
binding.spTitle.setAdapter(adapter) |
|
|
|
|
|
|
|
|
if ((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Client_Title.isNullOrEmpty()) { |
|
|
|
|
|
|
|
|
val titleText=(activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Client_Title |
|
|
|
|
|
val newTitleText= "$titleText." |
|
|
|
|
|
if (titleText.isNullOrEmpty()) { |
|
|
binding.spTitle.setText( |
|
|
binding.spTitle.setText( |
|
|
adapter.getItem(0)?.Value, |
|
|
adapter.getItem(0)?.Value, |
|
|
false |
|
|
false |
|
|
) |
|
|
) |
|
|
} else { |
|
|
|
|
|
listOfTitle.filter { |
|
|
|
|
|
it.Value == (activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Client_Title |
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
for (title in listOfTitle) { |
|
|
|
|
|
if (title.Value ==newTitleText) { |
|
|
|
|
|
binding.spTitle.setText(title.Value,false) |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
|
|
|
// binding.spTitle.setOnTouchListener { v, event -> |
|
|
|
|
|
// when (event?.action) { |
|
|
|
|
|
// MotionEvent.ACTION_DOWN -> { |
|
|
|
|
|
// binding.spTitle.setText( |
|
|
|
|
|
// adapter.getItem(0)?.Value, |
|
|
|
|
|
// false |
|
|
|
|
|
// ) |
|
|
|
|
|
// |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// v?.onTouchEvent(event) ?: true |
|
|
|
|
|
// } |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -838,11 +873,6 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
R.layout.spinner_dropdown, |
|
|
R.layout.spinner_dropdown, |
|
|
listOfRelationShip |
|
|
listOfRelationShip |
|
|
) |
|
|
) |
|
|
binding.spRelation.setAdapter(adapter) |
|
|
|
|
|
binding.spRelation.setText( |
|
|
|
|
|
adapter.getItem(0)?.Value, |
|
|
|
|
|
false |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
binding.spNomineeRelation.setAdapter(adapter) |
|
|
binding.spNomineeRelation.setAdapter(adapter) |
|
|
binding.spNomineeRelation.setText( |
|
|
binding.spNomineeRelation.setText( |
|
@ -1245,18 +1275,6 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
binding.tlMarital, |
|
|
binding.tlMarital, |
|
|
getString(R.string.emptyMaritalStatus) |
|
|
getString(R.string.emptyMaritalStatus) |
|
|
) |
|
|
) |
|
|
} else if (binding.spRelation.text.toString().isEmpty()) { // Spinner |
|
|
|
|
|
commonSpinnerErrorMethod( |
|
|
|
|
|
binding.spRelation, |
|
|
|
|
|
binding.tlRelation, |
|
|
|
|
|
getString(R.string.emptyRelation) |
|
|
|
|
|
) |
|
|
|
|
|
} else if (binding.edtRelationName.text.toString().isEmpty()) { // EditText |
|
|
|
|
|
commonErrorMethod( |
|
|
|
|
|
binding.edtRelationName, |
|
|
|
|
|
binding.tlRelationName, |
|
|
|
|
|
getString(R.string.emptyRelationName) |
|
|
|
|
|
) |
|
|
|
|
|
} else if (binding.edtAddressLine1.text.toString().isEmpty()) { // EditText |
|
|
} else if (binding.edtAddressLine1.text.toString().isEmpty()) { // EditText |
|
|
commonErrorMethod( |
|
|
commonErrorMethod( |
|
|
binding.edtAddressLine1, |
|
|
binding.edtAddressLine1, |
|
|