|
@ -6,7 +6,6 @@ import android.text.Editable |
|
|
import android.text.InputFilter |
|
|
import android.text.InputFilter |
|
|
import android.text.InputFilter.LengthFilter |
|
|
import android.text.InputFilter.LengthFilter |
|
|
import android.text.TextWatcher |
|
|
import android.text.TextWatcher |
|
|
import android.transition.Fade.IN |
|
|
|
|
|
import android.util.Log |
|
|
import android.util.Log |
|
|
import android.view.LayoutInflater |
|
|
import android.view.LayoutInflater |
|
|
import android.view.View |
|
|
import android.view.View |
|
@ -34,7 +33,6 @@ import com.nivesh.production.bajajfd.util.Common.Companion.removeError |
|
|
import com.nivesh.production.bajajfd.util.Constants.Companion.token |
|
|
import com.nivesh.production.bajajfd.util.Constants.Companion.token |
|
|
import com.nivesh.production.bajajfd.util.Resource |
|
|
import com.nivesh.production.bajajfd.util.Resource |
|
|
import com.nivesh.production.bajajfd.viewModel.StepTwoBajajFDViewModel |
|
|
import com.nivesh.production.bajajfd.viewModel.StepTwoBajajFDViewModel |
|
|
import java.text.SimpleDateFormat |
|
|
|
|
|
import java.util.* |
|
|
import java.util.* |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -105,16 +103,17 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlMobileNumber) |
|
|
removeError(binding.tlMobileNumber) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
binding.edtMobileNumber.setText((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.mobile) |
|
|
|
|
|
|
|
|
// create an OnDateSetListener |
|
|
// create an OnDateSetListener |
|
|
|
|
|
|
|
|
|
|
|
binding.edtDOB.setText((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_DOB) |
|
|
binding.edtDOB.setOnClickListener { |
|
|
binding.edtDOB.setOnClickListener { |
|
|
removeError(binding.tlDOB) |
|
|
removeError(binding.tlDOB) |
|
|
datePicker(binding.edtDOB) |
|
|
datePicker(binding.edtDOB) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binding.edtPANNumber.setText((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_PAN) |
|
|
binding.edtPANNumber.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtPANNumber.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -130,9 +129,16 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
binding.spTitle.setOnItemClickListener { _, _, _, _ -> |
|
|
binding.spTitle.setOnItemClickListener { _, _, _, _ -> |
|
|
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?) { |
|
@ -145,6 +151,8 @@ 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?) { |
|
@ -157,6 +165,8 @@ 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?) { |
|
@ -169,9 +179,12 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlLastName) |
|
|
removeError(binding.tlLastName) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
binding.edtLastName.setText(splitStringName?.get(2).toString()) |
|
|
|
|
|
|
|
|
binding.spGender.setOnItemClickListener { _, _, _, _ -> |
|
|
binding.spGender.setOnItemClickListener { _, _, _, _ -> |
|
|
removeError(binding.tlGender) |
|
|
removeError(binding.tlGender) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
binding.edtEmail.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtEmail.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -184,9 +197,12 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlEmail) |
|
|
removeError(binding.tlEmail) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
binding.edtEmail.setText((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_EMAIL) |
|
|
|
|
|
|
|
|
binding.spOccupation.setOnItemClickListener { _, _, _, _ -> |
|
|
binding.spOccupation.setOnItemClickListener { _, _, _, _ -> |
|
|
removeError(binding.tlOccupation) |
|
|
removeError(binding.tlOccupation) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
binding.edtQualification.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtQualification.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -200,7 +216,6 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binding.spMarital.setOnItemClickListener { _, _, _, _ -> |
|
|
binding.spMarital.setOnItemClickListener { _, _, _, _ -> |
|
|
removeError(binding.tlMarital) |
|
|
removeError(binding.tlMarital) |
|
|
} |
|
|
} |
|
@ -221,6 +236,7 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
removeError(binding.tlRelationName) |
|
|
removeError(binding.tlRelationName) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
binding.edtAddressLine1.addTextChangedListener(object : TextWatcher { |
|
|
binding.edtAddressLine1.addTextChangedListener(object : TextWatcher { |
|
|
|
|
|
|
|
|
override fun afterTextChanged(s: Editable?) { |
|
|
override fun afterTextChanged(s: Editable?) { |
|
@ -581,7 +597,10 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
(activity as BajajFdMainActivity).createFDApplicantRequest.NomineeDetails |
|
|
(activity as BajajFdMainActivity).createFDApplicantRequest.NomineeDetails |
|
|
(activity as BajajFdMainActivity).createFDApplicantRequest.NomineeGuardianDetails |
|
|
(activity as BajajFdMainActivity).createFDApplicantRequest.NomineeGuardianDetails |
|
|
|
|
|
|
|
|
Log.e("CreateFDRequest","-->"+Gson().toJson((activity as BajajFdMainActivity).createFDApplicantRequest)) |
|
|
|
|
|
|
|
|
Log.e( |
|
|
|
|
|
"CreateFDRequest", |
|
|
|
|
|
"-->" + Gson().toJson((activity as BajajFdMainActivity).createFDApplicantRequest) |
|
|
|
|
|
) |
|
|
bajajFDInterface.stepTwoApi("stepTwoResponse") |
|
|
bajajFDInterface.stepTwoApi("stepTwoResponse") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -599,10 +618,10 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
val day = cal.get(Calendar.DAY_OF_MONTH) |
|
|
val day = cal.get(Calendar.DAY_OF_MONTH) |
|
|
val datePickerDialog = DatePickerDialog( |
|
|
val datePickerDialog = DatePickerDialog( |
|
|
activity as BajajFdMainActivity, { _, year, monthOfYear, dayOfMonth -> |
|
|
activity as BajajFdMainActivity, { _, year, monthOfYear, dayOfMonth -> |
|
|
if (monthOfYear.toString().length == 1){ |
|
|
|
|
|
|
|
|
if (monthOfYear.toString().length == 1) { |
|
|
"0".plus(monthOfYear) |
|
|
"0".plus(monthOfYear) |
|
|
} |
|
|
} |
|
|
edtDOB.setText(getDate(dayOfMonth.toString() +"-" + (monthOfYear + 1) +"-" + year)) |
|
|
|
|
|
|
|
|
edtDOB.setText(getDate(dayOfMonth.toString() + "-" + (monthOfYear + 1) + "-" + year)) |
|
|
}, year, month, day |
|
|
}, year, month, day |
|
|
) |
|
|
) |
|
|
datePickerDialog.datePicker.maxDate = cal.timeInMillis |
|
|
datePickerDialog.datePicker.maxDate = cal.timeInMillis |
|
@ -697,10 +716,17 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
listOfTitle |
|
|
listOfTitle |
|
|
) |
|
|
) |
|
|
binding.spTitle.setAdapter(adapter) |
|
|
binding.spTitle.setAdapter(adapter) |
|
|
binding.spTitle.setText( |
|
|
|
|
|
adapter.getItem(0)?.Value, |
|
|
|
|
|
false |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Client_Title.isNullOrEmpty()) { |
|
|
|
|
|
binding.spTitle.setText( |
|
|
|
|
|
adapter.getItem(0)?.Value, |
|
|
|
|
|
false |
|
|
|
|
|
) |
|
|
|
|
|
} else { |
|
|
|
|
|
listOfTitle.filter { |
|
|
|
|
|
it.Value == (activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Client_Title |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
binding.spNomineeTitle.setAdapter(adapter) |
|
|
binding.spNomineeTitle.setAdapter(adapter) |
|
|
binding.spNomineeTitle.setText( |
|
|
binding.spNomineeTitle.setText( |
|
|