|
|
@ -17,7 +17,7 @@ import android.widget.ArrayAdapter |
|
|
|
import android.widget.RadioButton |
|
|
|
import android.widget.TextView |
|
|
|
import androidx.core.content.ContextCompat |
|
|
|
import androidx.lifecycle.ViewModelProvider |
|
|
|
import androidx.fragment.app.Fragment |
|
|
|
import androidx.recyclerview.widget.GridLayoutManager |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import androidx.recyclerview.widget.RecyclerView |
|
|
@ -27,13 +27,9 @@ import com.nivesh.production.bajajfd.R |
|
|
|
import com.nivesh.production.bajajfd.adapter.BankListAdapter |
|
|
|
import com.nivesh.production.bajajfd.adapter.PaymentModeAdapter |
|
|
|
import com.nivesh.production.bajajfd.adapter.RecommendedBankListAdapter |
|
|
|
import com.nivesh.production.bajajfd.api.ApiClient |
|
|
|
import com.nivesh.production.bajajfd.databinding.FragmentBajajfdStepTwoBinding |
|
|
|
import com.nivesh.production.bajajfd.model.* |
|
|
|
import com.nivesh.production.bajajfd.repositories.MainRepository |
|
|
|
import com.nivesh.production.bajajfd.ui.activity.BajajFdMainActivity |
|
|
|
import com.nivesh.production.bajajfd.ui.providerfactory.StepTwoModelProviderFactory |
|
|
|
import com.nivesh.production.bajajfd.util.Common |
|
|
|
import com.nivesh.production.bajajfd.util.Common.Companion.commonErrorAutoCompleteMethod |
|
|
|
import com.nivesh.production.bajajfd.util.Common.Companion.commonErrorMethod |
|
|
|
import com.nivesh.production.bajajfd.util.Common.Companion.commonSpinnerErrorMethod |
|
|
@ -47,19 +43,14 @@ import com.nivesh.production.bajajfd.util.Common.Companion.removeError |
|
|
|
import com.nivesh.production.bajajfd.util.Common.Companion.showDialogValidation |
|
|
|
import com.nivesh.production.bajajfd.util.Constants.Companion.token |
|
|
|
import com.nivesh.production.bajajfd.util.Resource |
|
|
|
import com.nivesh.production.bajajfd.viewModel.StepTwoBajajFDViewModel |
|
|
|
import java.util.* |
|
|
|
|
|
|
|
|
|
|
|
class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
class StepTwoBajajFDFragment : Fragment() { |
|
|
|
|
|
|
|
private var _binding: FragmentBajajfdStepTwoBinding? = null |
|
|
|
private val binding get() = _binding!! |
|
|
|
|
|
|
|
private lateinit var rbBank: RadioButton |
|
|
|
private lateinit var rbPaymentMode: RadioButton |
|
|
|
private var cal = Calendar.getInstance() |
|
|
|
|
|
|
|
private lateinit var listOfTitle: List<GetCodes> |
|
|
|
private lateinit var listOfGender: List<GetCodes> |
|
|
|
private lateinit var listOfAnnualIncome: List<GetCodes> |
|
|
@ -71,28 +62,25 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
private lateinit var listOfCities: List<DataObjectX> |
|
|
|
private lateinit var listOfIFSC: MutableList<String> |
|
|
|
|
|
|
|
private lateinit var stepTwoBajajFDViewModel: StepTwoBajajFDViewModel |
|
|
|
private lateinit var bankListAdapter: BankListAdapter |
|
|
|
private lateinit var paymentModeAdapter: PaymentModeAdapter |
|
|
|
private lateinit var stateObject: DataObject |
|
|
|
private val listOfBanks: MutableList<ClientBanklist> = mutableListOf() |
|
|
|
|
|
|
|
private lateinit var rbBank: RadioButton |
|
|
|
private lateinit var rbPaymentMode: RadioButton |
|
|
|
private var cal = Calendar.getInstance() |
|
|
|
|
|
|
|
override fun onCreateView( |
|
|
|
inflater: LayoutInflater, container: ViewGroup?, |
|
|
|
savedInstanceState: Bundle? |
|
|
|
): View { |
|
|
|
|
|
|
|
_binding = FragmentBajajfdStepTwoBinding.inflate(inflater, container, false) |
|
|
|
return binding.root |
|
|
|
} |
|
|
|
|
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
super.onViewCreated(view, savedInstanceState) |
|
|
|
stepTwoBajajFDViewModel = ViewModelProvider( |
|
|
|
this, |
|
|
|
StepTwoModelProviderFactory(MainRepository(ApiClient.getApiClient)) |
|
|
|
)[StepTwoBajajFDViewModel::class.java] |
|
|
|
listOfTitle = ArrayList() |
|
|
|
listOfGender = ArrayList() |
|
|
|
listOfAnnualIncome = ArrayList() |
|
|
@ -102,9 +90,7 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
listOfStates = ArrayList() |
|
|
|
listOfIFSC = ArrayList() |
|
|
|
listOfPayMode = ArrayList() |
|
|
|
|
|
|
|
stateObject = DataObject() |
|
|
|
|
|
|
|
rbPaymentMode = RadioButton(activity as BajajFdMainActivity) |
|
|
|
|
|
|
|
// Personal Details |
|
|
@ -529,8 +515,7 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
binding.edtFirstName.text.toString().plus(" ") |
|
|
|
.plus(binding.edtMiddleName.text.toString()).plus(" ") |
|
|
|
.plus(binding.edtLastName.text.toString()), |
|
|
|
binding.edtMobileNumber.text.toString(), |
|
|
|
1 |
|
|
|
binding.edtMobileNumber.text.toString() |
|
|
|
, (activity as BajajFdMainActivity).loginRole) |
|
|
|
} |
|
|
|
} |
|
|
@ -547,7 +532,7 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
|
|
|
|
binding.addBankDetail.setOnClickListener { |
|
|
|
if (bankListAdapter.itemCount == 5) { |
|
|
|
showDialogValidation(mActivity, getString(R.string.fiveAccountValidation)) |
|
|
|
showDialogValidation(activity as BajajFdMainActivity, getString(R.string.fiveAccountValidation)) |
|
|
|
} else { |
|
|
|
showHideBankDetail() |
|
|
|
} |
|
|
@ -728,11 +713,11 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
} |
|
|
|
|
|
|
|
private fun createFDApi(data: CreateFDRequest) { |
|
|
|
stepTwoBajajFDViewModel.createFDApi(data, token, activity as BajajFdMainActivity) |
|
|
|
stepTwoBajajFDViewModel.getFDResponseMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.createFDApi(data, token, activity as BajajFdMainActivity) |
|
|
|
(activity as BajajFdMainActivity).viewModel.getFDResponseMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->$response") |
|
|
|
Log.e("createFDApi ", " response -->$response") |
|
|
|
val createFDApplicationResponse: CreateFDApplicationResponse = |
|
|
|
Gson().fromJson( |
|
|
|
response.data?.toString(), |
|
|
@ -773,10 +758,11 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
|
|
|
|
private fun ifscCodeCheckApi(ifsc: String) { |
|
|
|
if (ifsc.length >= 10) { |
|
|
|
stepTwoBajajFDViewModel.ifscCodeApi(ifsc, activity as BajajFdMainActivity) |
|
|
|
stepTwoBajajFDViewModel.getIfscCodeCheckMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.ifscCodeApi(ifsc, activity as BajajFdMainActivity) |
|
|
|
(activity as BajajFdMainActivity).viewModel.getIfscCodeCheckMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("ifscCodeCheckApi ", " response -->$response") |
|
|
|
val getIFSCCodeListResponse = |
|
|
|
Gson().fromJson( |
|
|
|
response.data?.toString(), |
|
|
@ -839,14 +825,15 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
|
|
|
|
private fun getIFSCDetailsApi(ifscCode: String) { |
|
|
|
|
|
|
|
stepTwoBajajFDViewModel.ifscCodeDetailsApi( |
|
|
|
(activity as BajajFdMainActivity).viewModel.ifscCodeDetailsApi( |
|
|
|
ifscCode, |
|
|
|
activity as BajajFdMainActivity |
|
|
|
) |
|
|
|
stepTwoBajajFDViewModel.getIfscCodeDetailsCheckMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.getIfscCodeDetailsCheckMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
if (response.data.toString().isNotEmpty()) { |
|
|
|
Log.e("getIFSCDetailsApi ", " response -->$response") |
|
|
|
val getIFSCCodeResponse = Gson().fromJson( |
|
|
|
response.data.toString(), |
|
|
|
GetIFSCCodeResponse::class.java |
|
|
@ -875,7 +862,7 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
} |
|
|
|
|
|
|
|
private fun verifyAccountNo( |
|
|
|
bankAccount: String, Ifsc: String, name: String, phoneNumber: String, bankNo: Int |
|
|
|
bankAccount: String, Ifsc: String, name: String, phoneNumber: String |
|
|
|
,loginRole : Int) { |
|
|
|
|
|
|
|
val bankValidationApiRequest = BankValidationApiRequest() |
|
|
@ -884,15 +871,16 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
bankValidationApiRequest.Name = name |
|
|
|
bankValidationApiRequest.PhoneNo = phoneNumber |
|
|
|
bankValidationApiRequest.RoleId = loginRole |
|
|
|
bankValidationApiRequest.BankNo = bankNo |
|
|
|
stepTwoBajajFDViewModel.bankValidationApi( |
|
|
|
bankValidationApiRequest.BankNo = 1 |
|
|
|
(activity as BajajFdMainActivity).viewModel.bankValidationApi( |
|
|
|
bankValidationApiRequest, |
|
|
|
token, |
|
|
|
activity as BajajFdMainActivity |
|
|
|
) |
|
|
|
stepTwoBajajFDViewModel.bankValidationApiMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.bankValidationApiMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("verifyAccountNo ", " response -->$response") |
|
|
|
val getBankValidationApiResponse = |
|
|
|
Gson().fromJson( |
|
|
|
response.data?.toString(), |
|
|
@ -904,7 +892,7 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
} |
|
|
|
when (code) { |
|
|
|
200 -> { |
|
|
|
if (getBankValidationApiResponse.Message == "Account Verified") { |
|
|
|
if (getBankValidationApiResponse.Message == getString(R.string.accountVerified)) { |
|
|
|
val clientBankList = ClientBanklist() |
|
|
|
clientBankList.AccountNumber = bankAccount |
|
|
|
clientBankList.AccountType = "sb" |
|
|
@ -1004,7 +992,7 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
requireActivity().windowManager.defaultDisplay.getMetrics(displayMetrics) |
|
|
|
val width = displayMetrics.widthPixels.toDouble() |
|
|
|
binding.rvClientBankList.layoutManager = LinearLayoutManager( |
|
|
|
mActivity, |
|
|
|
activity as BajajFdMainActivity, |
|
|
|
LinearLayoutManager.HORIZONTAL, |
|
|
|
false |
|
|
|
) |
|
|
@ -1061,10 +1049,11 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
(activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.sub_broker_code |
|
|
|
panCheck.panNumber = binding.edtPANNumber.text.toString() |
|
|
|
panCheck.mobileNumber = "" |
|
|
|
stepTwoBajajFDViewModel.panCheck(panCheck, token, activity as BajajFdMainActivity) |
|
|
|
stepTwoBajajFDViewModel.getPanCheckMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.panCheck(panCheck, token, activity as BajajFdMainActivity) |
|
|
|
(activity as BajajFdMainActivity).viewModel.getPanCheckMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("panCheckApi ", " response -->$response") |
|
|
|
val panCheckResponse = |
|
|
|
Gson().fromJson( |
|
|
|
response.data?.toString(), |
|
|
@ -1119,11 +1108,11 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
getCodeRequest.Category = getString(R.string.salutationCategory) |
|
|
|
getCodeRequest.Language = getString(R.string.language) |
|
|
|
getCodeRequest.InputValue = "" |
|
|
|
stepTwoBajajFDViewModel.titleApi(getCodeRequest, token, activity as BajajFdMainActivity) |
|
|
|
stepTwoBajajFDViewModel.getTitleMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.titleApi(getCodeRequest, token, activity as BajajFdMainActivity) |
|
|
|
(activity as BajajFdMainActivity).viewModel.getTitleMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->$response") |
|
|
|
Log.e("titleApi ", " response -->$response") |
|
|
|
val getCodeResponse: GetCodeResponse = |
|
|
|
Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java) |
|
|
|
getCodeResponse.Response.StatusCode.let { code -> |
|
|
@ -1202,15 +1191,15 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
getCodeRequest.Category = getString(R.string.paymentModeCategory) |
|
|
|
getCodeRequest.Language = getString(R.string.language) |
|
|
|
getCodeRequest.InputValue = "" |
|
|
|
stepTwoBajajFDViewModel.paymentModeApi( |
|
|
|
(activity as BajajFdMainActivity).viewModel.paymentModeApi( |
|
|
|
getCodeRequest, |
|
|
|
token, |
|
|
|
activity as BajajFdMainActivity |
|
|
|
) |
|
|
|
stepTwoBajajFDViewModel.getPaymentModeMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.getPaymentModeMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->$response") |
|
|
|
Log.e("paymentModeApi ", " response -->$response") |
|
|
|
val getCodeResponse: GetCodeResponse = |
|
|
|
Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java) |
|
|
|
getCodeResponse.Response.StatusCode.let { code -> |
|
|
@ -1264,15 +1253,15 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
getCodeRequest.Category = getString(R.string.genderCategory) |
|
|
|
getCodeRequest.Language = getString(R.string.language) |
|
|
|
getCodeRequest.InputValue = "" |
|
|
|
stepTwoBajajFDViewModel.genderApi( |
|
|
|
(activity as BajajFdMainActivity).viewModel.genderApi( |
|
|
|
getCodeRequest, |
|
|
|
token, |
|
|
|
activity as BajajFdMainActivity |
|
|
|
) |
|
|
|
stepTwoBajajFDViewModel.getGenderMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.getGenderMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->$response") |
|
|
|
Log.e("genderApi ", " response -->$response") |
|
|
|
val getCodeResponse: GetCodeResponse = |
|
|
|
Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java) |
|
|
|
getCodeResponse.Response.StatusCode.let { code -> |
|
|
@ -1324,15 +1313,15 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
getCodeRequest.Category = getString(R.string.relationshipCategory) |
|
|
|
getCodeRequest.Language = getString(R.string.language) |
|
|
|
getCodeRequest.InputValue = "" |
|
|
|
stepTwoBajajFDViewModel.relationShipApi( |
|
|
|
(activity as BajajFdMainActivity).viewModel.relationShipApi( |
|
|
|
getCodeRequest, |
|
|
|
token, |
|
|
|
activity as BajajFdMainActivity |
|
|
|
) |
|
|
|
stepTwoBajajFDViewModel.getRelationShipMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.getRelationShipMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->$response") |
|
|
|
Log.e("relationShipApi ", " response -->$response") |
|
|
|
val getCodeResponse: GetCodeResponse = |
|
|
|
Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java) |
|
|
|
getCodeResponse.Response.StatusCode.let { code -> |
|
|
@ -1392,15 +1381,15 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
getCodeRequest.Category = getString(R.string.maritalCategory) |
|
|
|
getCodeRequest.Language = getString(R.string.language) |
|
|
|
getCodeRequest.InputValue = "" |
|
|
|
stepTwoBajajFDViewModel.maritalStatusApi( |
|
|
|
(activity as BajajFdMainActivity).viewModel.maritalStatusApi( |
|
|
|
getCodeRequest, |
|
|
|
token, |
|
|
|
activity as BajajFdMainActivity |
|
|
|
) |
|
|
|
stepTwoBajajFDViewModel.getMaritalStatusMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.getMaritalStatusMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->$response") |
|
|
|
Log.e("maritalStatusApi ", " response -->$response") |
|
|
|
val getCodeResponse: GetCodeResponse = |
|
|
|
Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java) |
|
|
|
getCodeResponse.Response.StatusCode.let { code -> |
|
|
@ -1452,15 +1441,15 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
getCodeRequest.Category = getString(R.string.occupationCategory) |
|
|
|
getCodeRequest.Language = getString(R.string.language) |
|
|
|
getCodeRequest.InputValue = "" |
|
|
|
stepTwoBajajFDViewModel.occupationApi( |
|
|
|
(activity as BajajFdMainActivity).viewModel.occupationApi( |
|
|
|
getCodeRequest, |
|
|
|
token, |
|
|
|
activity as BajajFdMainActivity |
|
|
|
) |
|
|
|
stepTwoBajajFDViewModel.getOccupationMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.getOccupationMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->$response") |
|
|
|
Log.e("occupationApi ", " response -->$response") |
|
|
|
val getCodeResponse: GetCodeResponse = |
|
|
|
Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java) |
|
|
|
getCodeResponse.Response.StatusCode.let { code -> |
|
|
@ -1512,15 +1501,15 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
getCodeRequest.Category = getString(R.string.annualIncome) |
|
|
|
getCodeRequest.Language = getString(R.string.language) |
|
|
|
getCodeRequest.InputValue = "" |
|
|
|
stepTwoBajajFDViewModel.annualIncomeApi( |
|
|
|
(activity as BajajFdMainActivity).viewModel.annualIncomeApi( |
|
|
|
getCodeRequest, |
|
|
|
token, |
|
|
|
activity as BajajFdMainActivity |
|
|
|
) |
|
|
|
stepTwoBajajFDViewModel.getAnnualIncomeMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.getAnnualIncomeMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->$response") |
|
|
|
Log.e("annualIncomeApi ", " response -->$response") |
|
|
|
val getCodeResponse: GetCodeResponse = |
|
|
|
Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java) |
|
|
|
getCodeResponse.Response.StatusCode.let { code -> |
|
|
@ -1567,11 +1556,11 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
} |
|
|
|
|
|
|
|
private fun stateListApi() { |
|
|
|
stepTwoBajajFDViewModel.stateApi(token, activity as BajajFdMainActivity) |
|
|
|
stepTwoBajajFDViewModel.getStateMasterMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.stateApi(token, activity as BajajFdMainActivity) |
|
|
|
(activity as BajajFdMainActivity).viewModel.getStateMasterMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->$response") |
|
|
|
Log.e("stateListApi ", " response -->$response") |
|
|
|
val stateListResponse: StateListResponse = |
|
|
|
Gson().fromJson( |
|
|
|
response.data?.toString(), |
|
|
@ -1647,18 +1636,18 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
(activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE |
|
|
|
cityRequest.RoleID = (activity as BajajFdMainActivity).loginRole |
|
|
|
cityRequest.APIName = "" |
|
|
|
cityRequest.UID = 19060 |
|
|
|
cityRequest.UID = 0 |
|
|
|
cityRequest.Subbroker_Code = |
|
|
|
(activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.sub_broker_code |
|
|
|
cityRequest.RMCode = "" |
|
|
|
cityRequest.HOCode = "" |
|
|
|
cityRequest.Source = getString(R.string.source) |
|
|
|
cityRequest.APP_Web = getString(R.string.app) |
|
|
|
stepTwoBajajFDViewModel.cityListApi(cityRequest, token, activity as BajajFdMainActivity) |
|
|
|
stepTwoBajajFDViewModel.getCityListMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.cityListApi(cityRequest, token, activity as BajajFdMainActivity) |
|
|
|
(activity as BajajFdMainActivity).viewModel.getCityListMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->$response") |
|
|
|
Log.e("cityListApi ", " response -->$response") |
|
|
|
val cityListResponse: CityListResponse = |
|
|
|
Gson().fromJson(response.data?.toString(), CityListResponse::class.java) |
|
|
|
cityListResponse.response.status_code.let { code -> |
|
|
@ -1717,11 +1706,11 @@ class StepTwoBajajFDFragment : BaseFragment() { |
|
|
|
} |
|
|
|
|
|
|
|
private fun apiForEligibleBankList() { |
|
|
|
stepTwoBajajFDViewModel.bankListApi(token,getString(R.string.language), activity as BajajFdMainActivity) |
|
|
|
stepTwoBajajFDViewModel.getFDBankListMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
(activity as BajajFdMainActivity).viewModel.bankListApi(token,getString(R.string.language), activity as BajajFdMainActivity) |
|
|
|
(activity as BajajFdMainActivity).viewModel.getFDBankListMutableData.observe(viewLifecycleOwner) { response -> |
|
|
|
when (response) { |
|
|
|
is Resource.Success -> { |
|
|
|
Log.e("response", "-->$response") |
|
|
|
Log.e("apiForEligibleBankList ", " response -->$response") |
|
|
|
val getFDBankListResponse: GetFDBankListResponse = |
|
|
|
Gson().fromJson( |
|
|
|
response.data?.toString(), |
|
|
|