Browse Source

updated code

PankajBranch
Hemant Khadase 2 years ago
parent
commit
14f72f3c9f
4 changed files with 28 additions and 43 deletions
  1. +0
    -5
      app/src/main/java/com/nivesh/production/bajajfd/adapter/CustomerListAdapter.kt
  2. +28
    -22
      app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepFourBajajFDFragment.kt
  3. +0
    -3
      app/src/main/java/com/nivesh/production/bajajfd/util/Common.kt
  4. +0
    -13
      app/src/main/res/layout/item_customer_list_preview.xml

+ 0
- 5
app/src/main/java/com/nivesh/production/bajajfd/adapter/CustomerListAdapter.kt View File

@ -1,6 +1,5 @@
package com.nivesh.production.bajajfd.adapter package com.nivesh.production.bajajfd.adapter
import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
@ -18,9 +17,6 @@ class CustomerListAdapter(
val txtLabel: TextView = itemView.findViewById(R.id.txtLabel) val txtLabel: TextView = itemView.findViewById(R.id.txtLabel)
} }
var mExpandedPosition = -1
override fun onCreateViewHolder( override fun onCreateViewHolder(
parent: ViewGroup, parent: ViewGroup,
viewType: Int viewType: Int
@ -40,7 +36,6 @@ class CustomerListAdapter(
holder.txtLabel.text = cList.Label holder.txtLabel.text = cList.Label
holder.tvCustomerName.setOnCheckedChangeListener { _, isChecked -> holder.tvCustomerName.setOnCheckedChangeListener { _, isChecked ->
cList.isSelected = isChecked cList.isSelected = isChecked
Log.e("isSelected","-->"+cList.isSelected)
} }
} }
} }


+ 28
- 22
app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepFourBajajFDFragment.kt View File

@ -24,10 +24,9 @@ class StepFourBajajFDFragment : BaseFragment() {
private lateinit var stepFourBajajFDViewModel: StepFourBajajFDViewModel private lateinit var stepFourBajajFDViewModel: StepFourBajajFDViewModel
private var _binding: FragmentBajajfdStepFourBinding? = null private var _binding: FragmentBajajfdStepFourBinding? = null
private val binding get() = _binding!! private val binding get() = _binding!!
private var uniqueId: String? = ""
private lateinit var listOfCustomer: MutableList<GetCodes> private lateinit var listOfCustomer: MutableList<GetCodes>
var selectedList : String = ""
private var selectedList: String = ""
private var uniqueId: String? = ""
private lateinit var bajajFDInterface: BajajFDInterface private lateinit var bajajFDInterface: BajajFDInterface
@ -58,23 +57,24 @@ class StepFourBajajFDFragment : BaseFragment() {
} }
binding.btnNext.setOnClickListener { binding.btnNext.setOnClickListener {
for (getCodes in listOfCustomer){
if (getCodes.isSelected){
if (selectedList.isEmpty()){
selectedList = getCodes.Value
}else{
selectedList = selectedList.plus(",").plus(getCodes.Value)
selectedList = ""
for (getCodes in listOfCustomer) {
if (getCodes.isSelected) {
selectedList = if (selectedList.isEmpty()) {
getCodes.Value
} else {
selectedList.plus(",").plus(getCodes.Value)
} }
} }
} }
Log.e("selectedList", "-->$selectedList") Log.e("selectedList", "-->$selectedList")
if (binding.checkBox.isChecked) { if (binding.checkBox.isChecked) {
val saveFDOtherDataRequest = SaveFDOtherDataRequest()
val saveFDOtherDataRequest = SaveFDOtherDataRequest()
saveFDOtherDataRequest.FDProvider = getString(R.string.bajaj) saveFDOtherDataRequest.FDProvider = getString(R.string.bajaj)
saveFDOtherDataRequest.UniqueId = uniqueId saveFDOtherDataRequest.UniqueId = uniqueId
saveFDOtherDataRequest.Values = selectedList saveFDOtherDataRequest.Values = selectedList
saveFDOtherDataRequest.NiveshClientCode = (activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
saveFDOtherDataRequest.NiveshClientCode =
(activity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
bajajFDInterface.stepFourApi(saveFDOtherDataRequest) bajajFDInterface.stepFourApi(saveFDOtherDataRequest)
} else { } else {
showDialogValidation( showDialogValidation(
@ -84,18 +84,21 @@ class StepFourBajajFDFragment : BaseFragment() {
} }
} }
binding.btnBack.setOnClickListener{
binding.btnBack.setOnClickListener {
(activity as BajajFdMainActivity).binding.viewPager.currentItem = 2 (activity as BajajFdMainActivity).binding.viewPager.currentItem = 2
} }
return root return root
} }
fun displayReceivedData(createFDApplicationResponse: CreateFDApplicationResponse) {
Log.e("createFDApplication", "Response-->"+createFDApplicationResponse.Response.FDCreationDetailsResponse.UniqueId)
uniqueId = createFDApplicationResponse.Response.FDCreationDetailsResponse.UniqueId
getFDDetailsApi(createFDApplicationResponse.Response.FDCreationDetailsResponse.UniqueId)
customerListApi()
fun displayReceivedData(createFDApplicationResponse: CreateFDApplicationResponse) {
Log.e(
"createFDApplication",
"Response-->" + createFDApplicationResponse.Response.FDCreationDetailsResponse.UniqueId
)
uniqueId = createFDApplicationResponse.Response.FDCreationDetailsResponse.UniqueId
getFDDetailsApi(createFDApplicationResponse.Response.FDCreationDetailsResponse.UniqueId)
customerListApi()
} }
@ -159,7 +162,8 @@ class StepFourBajajFDFragment : BaseFragment() {
if (Common.isNetworkAvailable(mActivity!!)) { if (Common.isNetworkAvailable(mActivity!!)) {
val getFDDetailsRequest = GetFDDetailsRequest() val getFDDetailsRequest = GetFDDetailsRequest()
getFDDetailsRequest.FDProvider = mActivity!!.getString(R.string.bajaj) getFDDetailsRequest.FDProvider = mActivity!!.getString(R.string.bajaj)
getFDDetailsRequest.NiveshClientCode = (mActivity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
getFDDetailsRequest.NiveshClientCode =
(mActivity as BajajFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
getFDDetailsRequest.UniqueId = uniqueId getFDDetailsRequest.UniqueId = uniqueId
stepFourBajajFDViewModel.getFDDetails(getFDDetailsRequest, Constants.token) stepFourBajajFDViewModel.getFDDetails(getFDDetailsRequest, Constants.token)
stepFourBajajFDViewModel.getFDDetailsMutableData.observe(viewLifecycleOwner) { response -> stepFourBajajFDViewModel.getFDDetailsMutableData.observe(viewLifecycleOwner) { response ->
@ -175,13 +179,15 @@ class StepFourBajajFDFragment : BaseFragment() {
when (code) { when (code) {
200 -> { 200 -> {
binding.tvInvestedAmount.text = binding.tvInvestedAmount.text =
getString(R.string.rs).plus(getFDDetailsResponse.Response.FDDataResponse.FDAmount.toString())
getString(R.string.rs).plus(getFDDetailsResponse.Response.FDDataResponse.FDAmount.toString())
binding.tvTenure.text = binding.tvTenure.text =
getFDDetailsResponse.Response.FDDataResponse.Tenure.toString().plus(" Months")
getFDDetailsResponse.Response.FDDataResponse.Tenure.toString()
.plus(" Months")
binding.tvInterestPayout.text = binding.tvInterestPayout.text =
getFDDetailsResponse.Response.FDDataResponse.Frequency getFDDetailsResponse.Response.FDDataResponse.Frequency
binding.tvRateOfInterest.text = binding.tvRateOfInterest.text =
getFDDetailsResponse.Response.FDDataResponse.RateOfInterest.toString().plus(" % p.a.")
getFDDetailsResponse.Response.FDDataResponse.RateOfInterest.toString()
.plus(" % p.a.")
} }
// 650 -> refreshToken() // 650 -> refreshToken()
else -> { else -> {


+ 0
- 3
app/src/main/java/com/nivesh/production/bajajfd/util/Common.kt View File

@ -9,7 +9,6 @@ import android.net.ConnectivityManager
import android.net.NetworkCapabilities import android.net.NetworkCapabilities
import android.os.Build import android.os.Build
import android.provider.ContactsContract import android.provider.ContactsContract
import android.util.Log
import android.util.Patterns import android.util.Patterns
import com.google.android.material.textfield.MaterialAutoCompleteTextView import com.google.android.material.textfield.MaterialAutoCompleteTextView
import com.google.android.material.textfield.TextInputEditText import com.google.android.material.textfield.TextInputEditText
@ -17,9 +16,7 @@ import com.google.android.material.textfield.TextInputLayout
import com.google.gson.JsonObject import com.google.gson.JsonObject
import com.nivesh.production.bajajfd.R import com.nivesh.production.bajajfd.R
import com.nivesh.production.bajajfd.ui.activity.BaseActivity import com.nivesh.production.bajajfd.ui.activity.BaseActivity
import okhttp3.Interceptor.*
import retrofit2.HttpException import retrofit2.HttpException
import retrofit2.Response
import java.io.IOException import java.io.IOException
import java.net.SocketTimeoutException import java.net.SocketTimeoutException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat


+ 0
- 13
app/src/main/res/layout/item_customer_list_preview.xml View File

@ -1,16 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--<com.google.android.material.card.MaterialCardView-->
<!-- xmlns:android="http://schemas.android.com/apk/res/android"-->
<!-- xmlns:app="http://schemas.android.com/apk/res-auto"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:cardBackgroundColor="@color/white"-->
<!-- app:cardCornerRadius="2dp"-->
<!-- app:cardElevation="2dp"-->
<!-- app:cardMaxElevation="1dp"-->
<!-- app:cardPreventCornerOverlap="true"-->
<!-- app:cardUseCompatPadding="true">-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="@dimen/margin_1" android:padding="@dimen/margin_1"
android:orientation="horizontal" android:orientation="horizontal"
@ -38,4 +26,3 @@
android:drawablePadding="@dimen/margin_2" /> android:drawablePadding="@dimen/margin_2" />
</LinearLayout> </LinearLayout>
<!--</com.google.android.material.card.MaterialCardView>-->

Loading…
Cancel
Save

Powered by TurnKey Linux.