|
|
@ -18,6 +18,7 @@ import android.widget.RadioButton |
|
|
|
import android.widget.TextView |
|
|
|
import androidx.core.content.ContextCompat |
|
|
|
import androidx.fragment.app.Fragment |
|
|
|
import androidx.fragment.app.activityViewModels |
|
|
|
import androidx.recyclerview.widget.GridLayoutManager |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import androidx.recyclerview.widget.RecyclerView |
|
|
@ -44,6 +45,7 @@ import com.nivesh.production.niveshfd.util.Common.Companion.showDialogValidation |
|
|
|
import com.nivesh.production.niveshfd.util.Constants.Companion.token |
|
|
|
import com.nivesh.production.niveshfd.util.ProgressUtil |
|
|
|
import com.nivesh.production.niveshfd.util.Resource |
|
|
|
import com.nivesh.production.niveshfd.viewModel.MyObseravble |
|
|
|
import java.util.* |
|
|
|
|
|
|
|
|
|
|
@ -52,6 +54,7 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
private var _binding: FragmentNiveshfdStepTwoBinding? = null |
|
|
|
private val binding get() = _binding!! |
|
|
|
|
|
|
|
private val observerViewModel: MyObseravble by activityViewModels() |
|
|
|
private lateinit var listOfTitle: List<GetCodes> |
|
|
|
private lateinit var listOfGender: List<GetCodes> |
|
|
|
private lateinit var listOfAnnualIncome: List<GetCodes> |
|
|
@ -682,8 +685,7 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
bankListAdapter.getSelected()?.AccountNumber |
|
|
|
(activity as NiveshFdMainActivity).fdBankDetails.BankName = |
|
|
|
bankListAdapter.getSelected()?.BankName |
|
|
|
(activity as NiveshFdMainActivity).fdBankDetails.PaymentMode = |
|
|
|
rbPaymentMode.text.toString() |
|
|
|
(activity as NiveshFdMainActivity).fdBankDetails.PaymentMode = paymentModeAdapter.getSelected()?.Value |
|
|
|
|
|
|
|
(activity as NiveshFdMainActivity).createFDApplicantRequest.ApplicantDetails = |
|
|
|
(activity as NiveshFdMainActivity).applicantDetails |
|
|
@ -898,7 +900,7 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
if (getBankValidationApiResponse.Message == getString(R.string.accountVerified)) { |
|
|
|
val clientBankList = ClientBanklist() |
|
|
|
clientBankList.AccountNumber = bankAccount |
|
|
|
clientBankList.AccountType = "sb" |
|
|
|
clientBankList.AccountType = rbBank.text.toString() |
|
|
|
clientBankList.BankName = |
|
|
|
binding.edtBankName.text.toString() |
|
|
|
clientBankList.BranchName = |
|
|
@ -1037,10 +1039,10 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
|
|
|
|
private fun guardianCodeVisibility(visibility: Int) { |
|
|
|
binding.tlGuardianName.visibility = visibility |
|
|
|
binding.tlGuardianName.visibility = visibility |
|
|
|
binding.tlGuardianName.visibility = visibility |
|
|
|
binding.tlGuardianName.visibility = visibility |
|
|
|
binding.tlGuardianName.visibility = visibility |
|
|
|
binding.tlGuardianAddress.visibility = visibility |
|
|
|
binding.tlGuardianAge.visibility = visibility |
|
|
|
binding.tlGuardianPinCode.visibility = visibility |
|
|
|
binding.tlGuardianRelation.visibility = visibility |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -1210,7 +1212,7 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
200 -> { |
|
|
|
if (getCodeResponse.Response.GetCodesList.isNotEmpty()) { |
|
|
|
listOfPayMode = getCodeResponse.Response.GetCodesList |
|
|
|
setUpRecyclerViewPaymentMode(listOfPayMode) |
|
|
|
setUpRecyclerViewPaymentMode(listOfPayMode as MutableList<GetCodes>) |
|
|
|
} |
|
|
|
} |
|
|
|
// 650 -> refreshToken() |
|
|
@ -1239,7 +1241,28 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private fun setUpRecyclerViewPaymentMode(listOfPayMode: List<GetCodes>) { |
|
|
|
private fun setUpRecyclerViewPaymentMode(listOfPayMode: MutableList<GetCodes>) { |
|
|
|
|
|
|
|
observerViewModel.data.observe(viewLifecycleOwner) { |
|
|
|
val tempList= mutableListOf<GetCodes>() |
|
|
|
tempList.addAll(listOfPayMode) |
|
|
|
val amountEntered:String = observerViewModel.data.value.toString() |
|
|
|
if( amountEntered.toDouble()>100000.0) { |
|
|
|
for (list in listOfPayMode) { |
|
|
|
if (list.Value == "UPI") { |
|
|
|
tempList.remove(list) |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
binding.rvPaymentMode.layoutManager = |
|
|
|
GridLayoutManager(activity as NiveshFdMainActivity, 2) |
|
|
|
paymentModeAdapter = PaymentModeAdapter( |
|
|
|
tempList, |
|
|
|
listOfPayMode[0].Value |
|
|
|
) |
|
|
|
binding.rvPaymentMode.adapter = paymentModeAdapter |
|
|
|
} |
|
|
|
|
|
|
|
binding.rvPaymentMode.layoutManager = |
|
|
|
GridLayoutManager(activity as NiveshFdMainActivity, 2) |
|
|
@ -1337,16 +1360,25 @@ class StepTwoNiveshFDFragment : Fragment() { |
|
|
|
R.layout.spinner_dropdown, |
|
|
|
listOfRelationShip |
|
|
|
) |
|
|
|
|
|
|
|
binding.spNomineeRelation.setAdapter(adapter) |
|
|
|
binding.spNomineeRelation.setText( |
|
|
|
adapter.getItem(0)?.Value, |
|
|
|
false |
|
|
|
) |
|
|
|
|
|
|
|
val nomineeRelation = (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Nominees?.get(0)?.NomineeRelationship |
|
|
|
if (nomineeRelation.isNullOrEmpty()) { |
|
|
|
binding.spNomineeRelation.setText(adapter.getItem(0)?.Label, |
|
|
|
false) |
|
|
|
}else{ |
|
|
|
for (title in listOfRelationShip) { |
|
|
|
if (title.Label == nomineeRelation) { |
|
|
|
binding.spNomineeRelation.setText(title.Label , |
|
|
|
false) |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
binding.spGuardianRelation.setAdapter(adapter) |
|
|
|
binding.spGuardianRelation.setText( |
|
|
|
adapter.getItem(0)?.Value, |
|
|
|
adapter.getItem(0)?.Label, |
|
|
|
false |
|
|
|
) |
|
|
|
} |
|
|
|