diff --git a/app/build.gradle b/app/build.gradle
index 95d83d1..01106c4 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -4,11 +4,11 @@ plugins {
}
android {
- namespace 'com.nivesh.production.niveshfd'
+ namespace 'com.nivesh.production.partnerOnBoarding'
compileSdk 33
defaultConfig {
- applicationId "com.nivesh.production.niveshfd"
+ applicationId "com.nivesh.production.partnerOnBoarding"
minSdk 21
targetSdk 33
versionCode 1
@@ -44,30 +44,30 @@ ext{
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
- implementation 'androidx.appcompat:appcompat:1.5.1'
- implementation 'com.google.android.material:material:1.7.0'
+ implementation 'androidx.appcompat:appcompat:1.6.1'
+ implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
- implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
+ implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
// Architectural Components
- implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
+ implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1'
// Coroutine Lifecycle Scopes
- implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
- implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1"
+ implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
+ implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1"
// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
- implementation "com.squareup.okhttp3:logging-interceptor:4.7.2"
+ implementation "com.squareup.okhttp3:logging-interceptor:4.10.0"
// Navigation Components
implementation "androidx.navigation:navigation-fragment-ktx:2.5.3"
diff --git a/app/src/androidTest/java/com/nivesh/production/bajajfd/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/nivesh/production/bajajfd/ExampleInstrumentedTest.kt
index 1d32d4e..23f9307 100644
--- a/app/src/androidTest/java/com/nivesh/production/bajajfd/ExampleInstrumentedTest.kt
+++ b/app/src/androidTest/java/com/nivesh/production/bajajfd/ExampleInstrumentedTest.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd
+package com.nivesh.production.partnerOnBoarding
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
- assertEquals("com.nivesh.production.niveshfd", appContext.packageName)
+ assertEquals("com.nivesh.production.partnerOnBoarding", appContext.packageName)
}
}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 4b2c4f3..c330fde 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -31,9 +31,8 @@
android:theme="@style/Theme.NiveshFDSDK"
tools:targetApi="31">
-
@@ -42,26 +41,21 @@
-
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/BankListAdapter.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/BankListAdapter.kt
deleted file mode 100644
index dae92e6..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/BankListAdapter.kt
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.nivesh.production.niveshfd.fd.adapter
-
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.ImageView
-import android.widget.TextView
-import androidx.recyclerview.widget.RecyclerView
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.fd.model.ClientBanklist
-
-class BankListAdapter(
- private val bankList: List?,
- private val selectedAccount: String? = null,
- private val width: Double?
-) : RecyclerView.Adapter() {
- inner class BankListViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
- val bankSelector: ImageView = itemView.findViewById(R.id.bankSelector)
- val tvBankName: TextView = itemView.findViewById(R.id.tvBankName)
- val tvBankAccountNumber: TextView = itemView.findViewById(R.id.tvBankAccountNumber)
- val tvBankIFSC: TextView = itemView.findViewById(R.id.tvBankIFSC)
- }
-
- private var checkedPosition: Int = -2
-
- override fun onCreateViewHolder(
- parent: ViewGroup,
- viewType: Int
- ): BankListViewHolder {
- val view = LayoutInflater.from(parent.context)
- .inflate(R.layout.item_bank_list_preview, parent, false);
- view.layoutParams = width?.div(1.35)
- ?.let { ViewGroup.LayoutParams(it.toInt(), ViewGroup.LayoutParams.WRAP_CONTENT) }
- return BankListViewHolder(view)
- }
-
- override fun onBindViewHolder(holder: BankListViewHolder, position: Int) {
- val bankList = bankList?.get(position)
- if (bankList != null) {
- holder.itemView.apply {
- holder.tvBankName.text = bankList.BankName
- holder.tvBankIFSC.text = bankList.IFSCCode
- holder.tvBankAccountNumber.text = bankList.AccountNumber
-
- if (selectedAccount == bankList.AccountNumber && (checkedPosition == -2)) {
- holder.bankSelector.setBackgroundResource(R.drawable.ic_select_green)
- checkedPosition = holder.adapterPosition
- } else if (checkedPosition == -1) {
- holder.bankSelector.setBackgroundResource(R.drawable.ic_select_outline)
- } else if (checkedPosition == holder.adapterPosition) {
- holder.bankSelector.setBackgroundResource(R.drawable.ic_select_green)
- } else {
- holder.bankSelector.setBackgroundResource(R.drawable.ic_select_outline)
- }
-
- holder.itemView.setOnClickListener {
- holder.bankSelector.setBackgroundResource(R.drawable.ic_select_green)
- if (checkedPosition != holder.adapterPosition) {
- notifyItemChanged(checkedPosition)
- checkedPosition = holder.adapterPosition
- }
- }
- }
- }
- }
-
- override fun getItemCount(): Int {
- return bankList?.size!!
- }
-
- private var onItemClickListener: ((ClientBanklist) -> Unit)? = null
-
- fun setOnItemClickListener(listener: (ClientBanklist) -> Unit) {
- onItemClickListener = listener
- }
-
- fun getSelected(): ClientBanklist? {
- return if (checkedPosition != -1) {
- bankList?.get(checkedPosition)
- } else null
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/CustomerListAdapter.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/CustomerListAdapter.kt
deleted file mode 100644
index 6398fa0..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/CustomerListAdapter.kt
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.nivesh.production.niveshfd.fd.adapter
-
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.TextView
-import androidx.recyclerview.widget.RecyclerView
-import com.google.android.material.switchmaterial.SwitchMaterial
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.fd.model.GetCodes
-
-class CustomerListAdapter(
- private val customerList: MutableList?
-) : RecyclerView.Adapter() {
- inner class BankListViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
- val tvCustomerName: SwitchMaterial = itemView.findViewById(R.id.tvCustomerName)
- val txtLabel: TextView = itemView.findViewById(R.id.txtLabel)
- }
-
- override fun onCreateViewHolder(
- parent: ViewGroup,
- viewType: Int
- ): BankListViewHolder {
- return BankListViewHolder(
- LayoutInflater.from(parent.context).inflate(
- R.layout.item_customer_list_preview,
- parent,
- false
- )
- )
- }
-
- override fun onBindViewHolder(holder: BankListViewHolder, position: Int) {
- val cList = customerList?.get(position)
- if (cList != null) {
- holder.txtLabel.text = cList.Label
- if(holder.txtLabel.text.contains("outside of india",true) ) {
- holder.tvCustomerName.isChecked = true
- holder.tvCustomerName.setOnCheckedChangeListener { _, isChecked ->
- cList.isSelected = isChecked
- }
- }else {
- holder.tvCustomerName.setOnCheckedChangeListener { _, isChecked ->
- cList.isSelected = isChecked
- }
- }
- }
- }
-
- override fun getItemCount(): Int {
- return customerList?.size!!
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/DisableAdapter.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/DisableAdapter.kt
deleted file mode 100644
index e1c4a8e..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/DisableAdapter.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.nivesh.production.niveshfd.fd.adapter
-
-import android.annotation.SuppressLint
-import android.content.Context
-import android.util.AttributeSet
-import android.view.MotionEvent
-import androidx.viewpager.widget.ViewPager
-
-
-class DisableAdapter (context: Context, attrs: AttributeSet) : ViewPager(context, attrs) {
- private var isPagingEnabled = true // change this value for enable and disable the viewpager swipe
-
- @SuppressLint("ClickableViewAccessibility")
- override fun onTouchEvent(event: MotionEvent?): Boolean {
- return this.isPagingEnabled && super.onTouchEvent(event)
- }
-
- override fun onInterceptTouchEvent(event: MotionEvent?): Boolean {
- return this.isPagingEnabled && super.onInterceptTouchEvent(event)
- }
-
- fun setPagingEnabled(b: Boolean) { isPagingEnabled = b
- }
-}
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/HorizontalRecyclerViewAdapter.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/HorizontalRecyclerViewAdapter.kt
deleted file mode 100644
index 2ae0dc2..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/HorizontalRecyclerViewAdapter.kt
+++ /dev/null
@@ -1,124 +0,0 @@
-package com.nivesh.production.niveshfd.fd.adapter
-
-import com.nivesh.production.niveshfd.fd.model.ROIDataList
-import android.annotation.SuppressLint
-import android.app.Activity
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.LinearLayout
-import android.widget.TextView
-import androidx.core.content.ContextCompat
-import androidx.core.content.res.ResourcesCompat
-import androidx.recyclerview.widget.RecyclerView
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.fd.adapter.HorizontalRecyclerViewAdapter.HistoryAdapterViewHolder2
-import com.nivesh.production.niveshfd.fd.interfaces.OnClickListener
-
-
-class HorizontalRecyclerViewAdapter(
- private val activity: Activity,
- dropdownList: MutableList,
- onClickListener: OnClickListener
-) : RecyclerView.Adapter() {
- private var dropdownList: MutableList
- private var rowIndex = -1
- private var onClickListener: OnClickListener
-
- inner class HistoryAdapterViewHolder2(view: View?) : RecyclerView.ViewHolder(
- view!!
- ) {
- var txtYear: TextView = itemView.findViewById(R.id.txtYear)
- var txtInterestRate: TextView = itemView.findViewById(R.id.txtInterestRate)
- var rlParent: LinearLayout = itemView.findViewById(R.id.rlParent)
-
- }
-
- init {
- this.dropdownList = dropdownList
- this.onClickListener = onClickListener
- }
-
- override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HistoryAdapterViewHolder2 {
- val itemView =
- LayoutInflater.from(parent.context).inflate(R.layout.row_dropdown, parent, false)
- return HistoryAdapterViewHolder2(itemView)
- }
-
- override fun onBindViewHolder(
- holder: HistoryAdapterViewHolder2,
- @SuppressLint("RecyclerView") position: Int
- ) {
- if (dropdownList.isNotEmpty()) {
- val roiDataList: ROIDataList = dropdownList[position]
- getYear(holder.txtYear, roiDataList, holder)
- holder.txtInterestRate.text = roiDataList.ROI.toString().plus(" % ")
- holder.rlParent.setOnClickListener {
- rowIndex = position
- notifyDataSetChanged()
- }
- if (rowIndex == position) {
- onClickListener.onclickCategory(position)
- holder.txtYear.background =
- ResourcesCompat.getDrawable(
- activity.resources,
- R.drawable.rounded_corner_green_fill,
- null
- )
- holder.txtYear.setTextColor(ContextCompat.getColor(activity, R.color.white))
- } else {
- holder.txtYear.background =
- ResourcesCompat.getDrawable(
- activity.resources,
- R.drawable.rounded_corner_with_line1,
- null
- )
- holder.txtYear.setTextColor(
- ContextCompat.getColor(activity, R.color.black)
- )
- }
- }
- }
-
- private fun getYear(txtYear: TextView, option: ROIDataList, holder: HistoryAdapterViewHolder2) {
- when (option.Tenure) {
- "12" -> {
- holder.rlParent.visibility = View.VISIBLE
- txtYear.text = activity.getString(R.string.OneYear)
- }
- "24" -> {
- holder.rlParent.visibility = View.VISIBLE
- txtYear.text = activity.getString(R.string.TwoYears)
- }
- "36" -> {
- holder.rlParent.visibility = View.VISIBLE
- txtYear.text = activity.getString(R.string.ThreeYears)
- }
- "48" -> {
- holder.rlParent.visibility = View.VISIBLE
- txtYear.text = activity.getString(R.string.FourYears)
- }
- "60" -> {
- holder.rlParent.visibility = View.VISIBLE
- txtYear.text = activity.getString(R.string.FiveYears)
- }
- else -> {
- holder.rlParent.visibility = View.GONE
- }
-
- }
- }
-
- override fun getItemCount(): Int {
- return dropdownList.size
- }
-
- override fun getItemViewType(position: Int): Int {
- return position
- }
-
- fun refresh() {
- rowIndex = -1
- notifyDataSetChanged()
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/PaymentModeAdapter.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/PaymentModeAdapter.kt
deleted file mode 100644
index fb162b5..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/PaymentModeAdapter.kt
+++ /dev/null
@@ -1,90 +0,0 @@
-package com.nivesh.production.niveshfd.fd.adapter
-
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.ImageView
-import android.widget.TextView
-import androidx.recyclerview.widget.RecyclerView
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.fd.model.GetCodes
-
-class PaymentModeAdapter(
- private val listOfPayMode: MutableList,
-
- private var selectedAmount: String? = null
-) : RecyclerView.Adapter() {
- inner class BankListViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
- val paymentSelector: ImageView = itemView.findViewById(R.id.paymentSelector)
- val paymentMethod: TextView = itemView.findViewById(R.id.paymentMethod)
- val tvUpiMsg: TextView = itemView.findViewById(R.id.tvUpiMsg)
- }
-
- private var checkedPosition: Int = -2
-
-
- override fun onCreateViewHolder(
- parent: ViewGroup,
- viewType: Int
- ): BankListViewHolder {
- return BankListViewHolder(
- LayoutInflater.from(parent.context).inflate(
- R.layout.item_payment_list_preview,
- parent,
- false
- )
- )
- }
-
- override fun onBindViewHolder(holder: BankListViewHolder, position: Int) {
- val listOfPayMode = listOfPayMode[position]
- holder.itemView.apply {
-
- holder.paymentMethod.text = listOfPayMode.Value
- if (listOfPayMode.Value == "UPI") {
- holder.tvUpiMsg.text = context.getString(R.string.upto1LakhOnly)
- } else {
- holder.tvUpiMsg.text = ""
- }
-
-
-
- if (selectedAmount != null && (checkedPosition == -2)) {
- holder.paymentSelector.setBackgroundResource(R.drawable.ic_select_green)
- checkedPosition = holder.adapterPosition
- } else if (checkedPosition == -1) {
- holder.paymentSelector.setBackgroundResource(R.drawable.ic_select_outline)
- } else if (checkedPosition == holder.adapterPosition) {
- holder.paymentSelector.setBackgroundResource(R.drawable.ic_select_green)
- } else {
- holder.paymentSelector.setBackgroundResource(R.drawable.ic_select_outline)
- }
-
- holder.itemView.setOnClickListener {
- holder.paymentSelector.setBackgroundResource(R.drawable.ic_select_green)
- if (checkedPosition != holder.adapterPosition) {
- notifyItemChanged(checkedPosition)
- checkedPosition = holder.adapterPosition
- }
- }
- }
- }
-
- override fun getItemCount(): Int {
- return listOfPayMode.size
- }
-
- private var onItemClickListener: ((GetCodes) -> Unit)? = null
-
- fun setOnItemClickListener(listener: (GetCodes) -> Unit) {
- onItemClickListener = listener
- }
-
-
- fun getSelected(): GetCodes? {
- return if (checkedPosition != -1) {
- listOfPayMode[checkedPosition]
- } else null
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/RecommendedBankListAdapter.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/RecommendedBankListAdapter.kt
deleted file mode 100644
index 64e6217..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/RecommendedBankListAdapter.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.nivesh.production.niveshfd.fd.adapter
-
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.TextView
-import androidx.recyclerview.widget.RecyclerView
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.fd.model.Bank
-
-class RecommendedBankListAdapter(
- private val bankList: List
-) : RecyclerView.Adapter() {
-
- class MyViewHolder(view: View) : RecyclerView.ViewHolder(view) {
- val txtYear :TextView = view.findViewById(R.id.txtYear)
- }
-
- override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
- val itemView: View = LayoutInflater.from(parent.context)
- .inflate(R.layout.row_bank_list, parent, false)
- return MyViewHolder(itemView)
- }
-
- override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
- val bank: Bank = bankList[position]
- holder.txtYear.text = bank.BankName
-
- }
-
- override fun getItemCount(): Int {
- return bankList.size
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/SectionsPagerAdapter.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/SectionsPagerAdapter.kt
deleted file mode 100644
index 359b008..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/adapter/SectionsPagerAdapter.kt
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.nivesh.production.niveshfd.fd.adapter
-
-import androidx.fragment.app.Fragment
-import androidx.fragment.app.FragmentManager
-import androidx.fragment.app.FragmentPagerAdapter
-
-
-class SectionsPagerAdapter(manager: FragmentManager,private val fragments: Array) : FragmentPagerAdapter(manager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
-
- private val titles = ArrayList()
-
- override fun getItem(position: Int): Fragment = fragments[position]
-
- override fun getCount(): Int = fragments.size
-
- override fun getPageTitle(position: Int): CharSequence = titles[position]
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/api/TokenAuthenticator.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/api/TokenAuthenticator.kt
deleted file mode 100644
index 32e2814..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/api/TokenAuthenticator.kt
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.nivesh.production.niveshfd.fd.api
-
-import okhttp3.Authenticator
-import okhttp3.Request
-import okhttp3.Response
-import okhttp3.Route
-
-class TokenAuthenticator {
-// override fun authenticate(route: Route?, response: Response): Request? {
-//// newAccessToken = service.refreshToken();
-////
-//// // Add new header to rejected request and retry it
-//// return response.request().newBuilder()
-//// .header(AUTHORIZATION, newAccessToken)
-//// .build();
-//
-//
-// }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/ApiInterface.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/ApiInterface.kt
deleted file mode 100644
index 4f435b3..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/ApiInterface.kt
+++ /dev/null
@@ -1,175 +0,0 @@
-package com.nivesh.production.niveshfd.fd.interfaces
-
-import com.google.gson.JsonObject
-import com.nivesh.production.niveshfd.fd.model.*
-import okhttp3.RequestBody
-import retrofit2.Response
-import retrofit2.http.*
-
-interface ApiInterface {
-
- @POST("GetRates")
- suspend fun getRates(
- @Body getRatesRequest: GetRatesRequest,
- @Header("token") token: String
- ): Response
-
- @POST("CheckFDCKYC")
- suspend fun checkFDKYC(
- @Body checkFDKYCRequest: CheckFDKYCRequest,
- @Header("token") token: String
- ): Response
-
- @POST("CreateFDApplication")
- suspend fun createFDApp(
- @Body createFDRequest: CreateFDRequest,
- @Header("token") token: String
- ): Response
-
- @POST("DocumentsUpload")
- suspend fun documentsUpload(
- @Body requestBody: DocumentUpload,
- @Header("token") token: String
- ): Response
-
- @POST("SaveFDOtherData")
- suspend fun saveFDOtherData(
- @Body requestBody: SaveFDOtherDataRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetFDDetails")
- suspend fun getFDDetails(
- @Body requestBody: GetFDDetailsRequest,
- @Header("token") token: String
- ): Response
-
- @POST("FinaliseFD")
- suspend fun finaliseFD(
- @Body requestBody: FinalizeFDRequest,
- @Header("token") token: String
- ): Response
-
- @POST("FinaliseKYC")
- suspend fun finaliseKYC(
- @Body requestBody: FinalizeKYCRequest,
- @Header("token") token: String
- ): Response
-
- @POST("PaymentRequery")
- suspend fun paymentReQuery(
- @Body requestBody: PaymentReQueryRequest,
- @Header("token") token: String
- ): Response
-
- // @FormUrlEncoded
- @POST("GetCodes")
- suspend fun getCodes(
- @Body requestBody: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("CalculateFDMaturityAmount")
- suspend fun getCalculateFDMaturityAmount(
- @Body requestBody: GetMaturityAmountRequest,
- @Header("token") token: String
- ): Response
-
- @POST("PanCheck_S")
- suspend fun panCheckApi(
- @Body panCheck: PanCheckRequest,
- @Header("token") token: String
- ): Response
-
- @POST("getFDStepsCount")
- suspend fun getFDStepsCount(
- @Body fdStepsCountRequest: FDStepsCountRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetClientDetailV2_S")
- suspend fun getClientDetails(
- @Body getClientDetailsRequest: getClientDetailsRequest,
- @Header("token") token: String
- ): Response
-
-
- @POST("GetCodes")
- suspend fun titleApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun genderApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun annualIncomeApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun relationShipApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun maritalStatusApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun occupationApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetStateMaster")
- suspend fun stateApi(@Header("token") token: String): Response
-
- @POST("GetCity")
- suspend fun cityApi(
- @Body cityRequest: CityRequest,
- @Header("token") token: String
- ): Response
-
- @GET("GetFDBankList?FDProvider=Bajaj")
- suspend fun bankListApi(@Header("token") token: String, @Query("Language") language : String): Response
-
- @GET("GetIFSC_Autofill?")
- suspend fun getIFSCApi(@Query("prefix") ifsc : String): Response
-
- @GET("GetbankNames")
- suspend fun getIFSCBankDetailsApi(@Query( "bankname") ifsc : String, @Header("token") token: String): Response
-
- @POST("GetCodes")
- suspend fun payModeApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun customerListApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("BankValidationAPI_S")
- suspend fun bankValidationApi(
- @Body bankValidationApiRequest: BankValidationApiRequest,
- @Header("token") token: String
- ): Response
-
-
- @POST("BankValidationAPI_S")
- suspend fun getToken(
- @Body bankValidationApiRequest: BankValidationApiRequest,
- @Header("token") token: String
- ): Response
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/OnClickListener.java b/app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/OnClickListener.java
deleted file mode 100644
index 75d6b4a..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/OnClickListener.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.interfaces;
-
-public interface OnClickListener {
- void onclickCategory(int position);
-}
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/SendData.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/SendData.kt
deleted file mode 100644
index e952475..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/SendData.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.nivesh.production.niveshfd.fd.interfaces
-
-import com.nivesh.production.niveshfd.fd.model.CreateFDApplicationResponse
-
-interface SendData {
- fun sendDataFragment(message: CreateFDApplicationResponse)
- fun sendDataFragmentStepFour(message: CreateFDApplicationResponse)
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ApplicantDetails.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ApplicantDetails.kt
deleted file mode 100644
index 252ab36..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ApplicantDetails.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ApplicantDetails(
- var AnnualIncome: String?= null,
- var ApplicantAddress1: String?= null,
- var ApplicantAddress2: String?= null,
- var ApplicantAddress3: String?= null,
- var ApplicantCity: String?= null,
- var ApplicantCountry: String?= null,
- var ApplicantDOB: String?= null,
- var ApplicantEmail: String?= null,
- var ApplicantFirstName: String?= null,
- var ApplicantGender: String?= null,
- var ApplicantLastName: String?= null,
- var ApplicantMaritalStatus: String?= null,
- var ApplicantMiddleName: String?= null,
- var ApplicantMobile: String?= null,
- var ApplicantOccupation: String?= null,
- var ApplicantPAN: String?= null,
- var ApplicantPincode: Int?= 0,
- var ApplicantQualification: String?= null,
- var ApplicantSalutation: String?= null,
- var ApplicantState: String?= null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ApplicantRelationDetails.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ApplicantRelationDetails.kt
deleted file mode 100644
index f871b4d..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ApplicantRelationDetails.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ApplicantRelationDetails(
- var ApplicantMotherFirstName: String? = null,
- var ApplicantMotherLastName: String? = null,
- var ApplicantRelation: String? = null,
- var ApplicantRelationFirstName: String? = null,
- var ApplicantRelationLastName: String? = null,
- var ApplicantRelationSalutation: String? = null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Bank.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Bank.kt
deleted file mode 100644
index 82cc887..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Bank.kt
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class Bank(
- val BankName: String,
- val IFSCInitials: String
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/BankList.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/BankList.kt
deleted file mode 100644
index 87014f3..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/BankList.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-import java.io.Serializable
-
-data class BankList(
- val BankName: String?,
- val IFSCCode: String?,
- val AccountNumber: String?,
- val BranchName: String?,
- val DefaultBankFlag: String?,
- val IsValBank: String?,
- val AccountType: String?
-): Serializable
-
-
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/BankValidationApiRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/BankValidationApiRequest.kt
deleted file mode 100644
index 41673a6..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/BankValidationApiRequest.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class BankValidationApiRequest(
- var BankAccountNo: String?="",
- var BankNo: Int?= 0,
- var IFSC: String?= "",
- var Name: String? = "",
- var PhoneNo: String? = "",
- var RoleId: Int? = 0
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/BankValidationApiResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/BankValidationApiResponse.kt
deleted file mode 100644
index bbdbf98..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/BankValidationApiResponse.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class BankValidationApiResponse(
- val DataObject: Any,
- val Message: String,
- val ObjectResponse: Any,
- val response: ResponseXXXXXXXXXXXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CheckFDKYCRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CheckFDKYCRequest.kt
deleted file mode 100644
index ac57b79..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CheckFDKYCRequest.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class CheckFDKYCRequest(
- var DOB: String? ="",
- var Mobile: String? = "",
- var NiveshClientCode: String? = "",
- var PAN: String?= ""
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CityListResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CityListResponse.kt
deleted file mode 100644
index c41a7a3..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CityListResponse.kt
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class CityListResponse(
- val DataObject: List,
- val response: ResponseXXXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CityRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CityRequest.kt
deleted file mode 100644
index 3f5ac27..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CityRequest.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class CityRequest(
- var APIName: String? = "",
- var APP_Web: String?="",
- var ClientCode: String?="",
- var HOCode: String?="",
- var RMCode: String?="",
- var RoleID: Int = 0,
- var Source: String? = "",
- var StateCode: Int? = 0,
- var Subbroker_Code: String? = "",
- var Type: String?= "",
- var UID: Int = 0
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ClientBanklist.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ClientBanklist.kt
deleted file mode 100644
index e58a34a..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ClientBanklist.kt
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ClientBanklist(
- var AccountNumber: String?="",
- var AccountType: String?="",
- var BankName: String?="",
- var BranchName: String?="",
- val DefaultBankFlag: String?="",
- var IFSCCode: String?="",
- var IsValBank: Int? = 0
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ClientDetails.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ClientDetails.kt
deleted file mode 100644
index 27cf480..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ClientDetails.kt
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ClientDetails(
- val ARNexpiredFlag: Boolean,
- val EditProfileMessage: String,
- val IsPartiallyFilled: Boolean,
- val KYCstatus: String,
- val ProfileMessage: String,
- val ProfileStatus: String,
- val UnifiedMessage: String,
- val appliaction1_image_name: String,
- val city_of_birth: String,
- val clientMasterMFD: ClientMasterMFD,
- val country_of_birth: String,
- val created_by: String,
- val created_date: String,
- val email: String,
- val mobile: String,
- val modified_by: String,
- val modified_date: String,
- val sub_broker_code: String
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ClientMasterMFD.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ClientMasterMFD.kt
deleted file mode 100644
index 0422577..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ClientMasterMFD.kt
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ClientMasterMFD(
- val CLIENT_ACCNO1: String,
- val CLIENT_ACCTYPE1: String,
- val CLIENT_ADD1: String,
- val CLIENT_ADD2: String,
- val CLIENT_ADD3: String,
- val CLIENT_APPNAME1: String,
- val CLIENT_CITY: String,
- val CLIENT_CODE: String,
- val CLIENT_COMMMODE: String,
- val CLIENT_COUNTRY: String,
- val CLIENT_DIVPAYMODE: String,
- val CLIENT_DOB: String,
- val CLIENT_EMAIL: String,
- val CLIENT_FATHER_HUSBAND_GUARDIAN: String,
- val CLIENT_GENDER: String,
- val CLIENT_GUARDIANPAN: String,
- val CLIENT_HOLDING: String,
- val CLIENT_NEFT_IFSCCODE1: String,
- val CLIENT_OCCUPATION_CODE: String,
- val CLIENT_PAN: String,
- val CLIENT_PINCODE: String,
- val CLIENT_STATE: String,
- val CLIENT_TAXSTATUS: String,
- val CLIENT_TYPE: String,
- val CM_MOBILE: String,
- val Client_Title: String,
- val DEFAULT_BLANK_FLAG1: String,
- val Filler1: String,
- val Filler2: String,
- val Filler3: Any,
- val NominationAuthMode: String,
- val NominationOptFlag: String,
- val Nominee_Title: String,
- val Nominees: List,
- val ParentName: String,
- val ums_id: String
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CreateFDApplicationRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CreateFDApplicationRequest.kt
deleted file mode 100644
index 18a6a18..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CreateFDApplicationRequest.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class CreateFDApplicationRequest(
- var ApplicantDetails: ApplicantDetails ? = null,
- var ApplicantRelationDetails: ApplicantRelationDetails? = null,
- var FDInvestmentDetails: FDInvestmentDetails? = null,
- var FdBankDetails: FdBankDetails? = null,
- var NomineeDetails: NomineeDetails? = null,
- var NomineeGuardianDetails: NomineeGuardianDetails ? = null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CreateFDApplicationResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CreateFDApplicationResponse.kt
deleted file mode 100644
index eb40b4f..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CreateFDApplicationResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class CreateFDApplicationResponse(
- val Response: ResponseXXXXXXXXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CreateFDRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CreateFDRequest.kt
deleted file mode 100644
index 9f3b856..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/CreateFDRequest.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class CreateFDRequest(
- var CreateFDApplicationRequest: CreateFDApplicationRequest? = null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DataObject.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DataObject.kt
deleted file mode 100644
index 8de55cc..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DataObject.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-import java.io.Serializable
-
-data class DataObject(
- var BSE_State_Code: String? = "",
- var CAMS_statecode: String? = "",
- var Country_Id: Int? = 0,
- var State_Code: String?= "",
- var State_Id: Int? = 0,
- var State_Name: String? = "",
- var signzyCode: String? = ""
-): Serializable {
- override fun toString(): String {
- return State_Name.toString()
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DataObjectX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DataObjectX.kt
deleted file mode 100644
index e15380b..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DataObjectX.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class DataObjectX(
- val city_id: Int,
- val city_name: String
-) {
- override fun toString(): String {
- return city_name
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DeviceInfo.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DeviceInfo.kt
deleted file mode 100644
index db72cc0..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DeviceInfo.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class DeviceInfo(
- var app_version: String? = "",
- var device_id: String? = "",
- var device_model: String? = "",
- var device_name: String? ="",
- var device_os_version: String? = "",
- var device_token: String? = "",
- var device_type: String? = "",
- var device_id_for_UMSId : String? = ""
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DocumentUpload.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DocumentUpload.kt
deleted file mode 100644
index 6d6eb22..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/DocumentUpload.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class DocumentUpload(
- var Description: String? = null,
- var DocumentType: String? = null,
- var FDProvider: String? = null,
- var ImageEncodeToBase64: String? = null,
- var NiveshClientCode: String? = null,
- var UniqueId: String? = null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Errors.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Errors.kt
deleted file mode 100644
index eb709d5..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Errors.kt
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class Errors(
- val ErrorCode: Int,
- val ErrorMessage: String
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDCreationDetailsResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDCreationDetailsResponse.kt
deleted file mode 100644
index e78e205..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDCreationDetailsResponse.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class FDCreationDetailsResponse(
- val DocumentUploadFlag: Int,
- val UniqueId: String,
- val kycFlag: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDDataResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDDataResponse.kt
deleted file mode 100644
index 912dcd3..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDDataResponse.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class FDDataResponse(
- val FDAmount: Double,
- val Frequency: String,
- val ParameterName: String,
- val PaymentUrl: String,
- val RateOfInterest: Double,
- val Tenure: Int,
- val UniqueId: String,
- val Value: String
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDInvestmentDetails.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDInvestmentDetails.kt
deleted file mode 100644
index 60e0c4a..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDInvestmentDetails.kt
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class FDInvestmentDetails(
- var CKYCNumber: String? = null,
- var CitizenType: String? = null,
- var CustomerType: String? = null,
- var Device: String? = null,
- var FDAmount: Double? = 0.0,
- var Frequency: String? = null,
- var IPAddress: String? = null,
- var Interest: Double? = 0.0,
- var NiveshClientCode: String? = null,
- var Provider: String? = null,
- var Source: String? = null,
- var Tenure: Int? = 0,
- var UniqueId: String? = "",
- var RenewOption : String = ""
-
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDStepsCountRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDStepsCountRequest.kt
deleted file mode 100644
index 5594f46..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FDStepsCountRequest.kt
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class FDStepsCountRequest(
- var FDProvider: String? = "",
- var NiveshClientCode: String? = ""
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FdBankDetails.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FdBankDetails.kt
deleted file mode 100644
index 7341474..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FdBankDetails.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class FdBankDetails(
- var AccountNumber: String?= null,
- var AccountType: String?= null,
- var BankBranch: String?= null,
- var BankName: String?= null,
- var IFSCCode: String?= null,
- var PaymentMode: String?= null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinaliseFD.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinaliseFD.kt
deleted file mode 100644
index 650a45f..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinaliseFD.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class FinaliseFD(
- var FDProvider: String? = "",
- var NiveshClientCode: String? = "",
- var UniqueId: String? = ""
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinalizeFDRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinalizeFDRequest.kt
deleted file mode 100644
index cdf23ed..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinalizeFDRequest.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class FinalizeFDRequest(
- var FinaliseFD: FinaliseFD? = null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinalizeFDResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinalizeFDResponse.kt
deleted file mode 100644
index 12b0c7c..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinalizeFDResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class FinalizeFDResponse(
- val Response: ResponseXXXXXXXXXXXXXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinalizeKYCRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinalizeKYCRequest.kt
deleted file mode 100644
index 271d506..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/FinalizeKYCRequest.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class FinalizeKYCRequest(
- var FDProvider: String? = "",
- var NiveshClientCode: String? = "",
- var UniqueId: String? = ""
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCalculateMaturityAmountResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCalculateMaturityAmountResponse.kt
deleted file mode 100644
index cc51c66..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCalculateMaturityAmountResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class GetCalculateMaturityAmountResponse(
- val Response: ResponseXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCodeRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCodeRequest.kt
deleted file mode 100644
index ea289e0..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCodeRequest.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class GetCodeRequest(
- var Category: String ? = null,
- var InputValue: String? = null,
- var Language: String ? = null,
- var ProductName: String? = null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCodeResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCodeResponse.kt
deleted file mode 100644
index a354e56..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCodeResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class GetCodeResponse(
- val Response: ResponseX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCodes.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCodes.kt
deleted file mode 100644
index 7e5ef1a..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetCodes.kt
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class GetCodes(
- val Label: String,
- var Value: String,
- var isSelected : Boolean
-) {
- override fun toString(): String {
- return Label
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetFDBankListResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetFDBankListResponse.kt
deleted file mode 100644
index bc05683..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetFDBankListResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class GetFDBankListResponse(
- val Response: ResponseXXXXXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetFDDetailsRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetFDDetailsRequest.kt
deleted file mode 100644
index ddf5bd3..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetFDDetailsRequest.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class GetFDDetailsRequest(
- var FDProvider: String? = "",
- var NiveshClientCode: String? = "",
- var UniqueId: String? = ""
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetFDDetailsResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetFDDetailsResponse.kt
deleted file mode 100644
index afe61cc..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetFDDetailsResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class GetFDDetailsResponse(
- val Response: ResponseXXXXXXXXXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetIFSCCodeListResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetIFSCCodeListResponse.kt
deleted file mode 100644
index dbc616b..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetIFSCCodeListResponse.kt
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class GetIFSCCodeListResponse(
- val IFSCCodes: MutableList,
- val Response: ResponseXXXXXXXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetIFSCCodeResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetIFSCCodeResponse.kt
deleted file mode 100644
index a58cd9b..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetIFSCCodeResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class GetIFSCCodeResponse(
- val IFSCCODEServiceResult: List
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetMaturityAmountRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetMaturityAmountRequest.kt
deleted file mode 100644
index 8898e06..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetMaturityAmountRequest.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class GetMaturityAmountRequest(
- var FDAmount: Int? = 0,
- var FDProvider: String? = "",
- var Frequency: String? = "",
- var Interest: Double? = 0.0,
- var Tenure: Int? = 0
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetRatesRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetRatesRequest.kt
deleted file mode 100644
index 8118874..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetRatesRequest.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-import com.google.gson.annotations.SerializedName
-
-data class GetRatesRequest(
- @SerializedName("FDProvider") var fdProvider: String? = null,
- @SerializedName("Frequency") var frequency: String? = null,
- @SerializedName("Type") var type: String? = null
-)
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetRatesResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetRatesResponse.kt
deleted file mode 100644
index eee3ae5..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/GetRatesResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class GetRatesResponse(
- val Response: Response
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/IFSCCODEServiceResult.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/IFSCCODEServiceResult.kt
deleted file mode 100644
index 0f1c418..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/IFSCCODEServiceResult.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class IFSCCODEServiceResult(
- val BankBranch: String,
- val BnkDescr: String,
- val BnkShrtDescr: String,
- val Code: String,
- val IfscCode: String,
- val intCustbnk_pk: String
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Nominee.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Nominee.kt
deleted file mode 100644
index 1afb890..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Nominee.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class Nominee(
- val NomineeApplicablePercent: Double,
- val NomineeDOB: String,
- val NomineeGuardian: String,
- val NomineeGuardianPAN: String,
- val NomineeMinorFlag: String,
- val NomineeName: String,
- val NomineePAN: String,
- val NomineeRelationship: String
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/NomineeDetails.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/NomineeDetails.kt
deleted file mode 100644
index ab83dd2..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/NomineeDetails.kt
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class NomineeDetails(
- var NomineeAddress1: String?= null,
- var NomineeAddress2: String?= null,
- var NomineeAddress3: String?= null,
- var NomineeCity: String?= null,
- var NomineeCountry: String?= null,
- var NomineeDOB: String?= null,
- var NomineeFirstName: String?= null,
- var NomineeGender: String?= null,
- var NomineeLastName: String?= null,
- var NomineeMiddleName: String?= null,
- var NomineePincode: Int?= 0,
- var NomineeRelation: String?= null,
- var NomineeSalutation: String?= null,
- var NomineeState: String?= null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/NomineeGuardianDetails.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/NomineeGuardianDetails.kt
deleted file mode 100644
index 9f1764c..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/NomineeGuardianDetails.kt
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class NomineeGuardianDetails(
- var GuardianAddress1: String?= null,
- var GuardianAddress2: String?= null,
- var GuardianAddress3: String?= null,
- var GuardianAge: Int?= 0,
- var GuardianCity: String?= null,
- var GuardianCountry: String?= null,
- var GuardianName: String?= null,
- var GuardianPincode: Int?= 0,
- var GuardianSalutation: String?= null,
- var GuardianState: String?= null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ObjectResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ObjectResponse.kt
deleted file mode 100644
index 908f534..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ObjectResponse.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ObjectResponse(
- val TransactionCount: Int,
- val clientDetails: ClientDetails,
- val languageid: Int,
- val membersList: List,
- val ClientBanklist : List
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PanCheckRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PanCheckRequest.kt
deleted file mode 100644
index 970e1c8..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PanCheckRequest.kt
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-import com.google.gson.annotations.SerializedName
-
-data class PanCheckRequest(
- @SerializedName("client_code")
- var clientCode: String? = null,
- @SerializedName("sub_broker_code")
- var subBrokerCode: String? = null,
- @SerializedName("pan_number")
- var panNumber: String? = null,
- @SerializedName("mobile_number")
- var mobileNumber: String? = null
-)
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PanCheckResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PanCheckResponse.kt
deleted file mode 100644
index 3f266c6..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PanCheckResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class PanCheckResponse(
- val response: ResponseXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PaymentReQueryRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PaymentReQueryRequest.kt
deleted file mode 100644
index 6bcb24a..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PaymentReQueryRequest.kt
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class PaymentReQueryRequest(
- var NiveshClientCode: String? = "",
- var UniqueId: String? = ""
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PaymentReQueryResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PaymentReQueryResponse.kt
deleted file mode 100644
index bbc8030..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/PaymentReQueryResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class PaymentReQueryResponse(
- val Response: ResponseXXXXXXXXXXXXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ROIDataList.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ROIDataList.kt
deleted file mode 100644
index fdf77f9..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ROIDataList.kt
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ROIDataList(
- val Frequency: String,
- val Provider: String,
- val ROI: Double,
- val Tenure: String,
- val Type: String
-) {
- override fun toString(): String {
- return Tenure.plus(" Months ").plus(" | ").plus(ROI).plus("%")
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Response.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Response.kt
deleted file mode 100644
index 99d7db9..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/Response.kt
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-import com.nivesh.production.niveshfd.fd.model.Errors
-
-data class Response(
- val Errors: List,
- val Message: String,
- var ROIDatalist: MutableList,
- val Status: String,
- val StatusCode: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseX.kt
deleted file mode 100644
index 0d9f528..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseX.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseX(
- val Errors: List,
- val GetCodesList: MutableList,
- val Message: String,
- val Status: String,
- val StatusCode: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXX.kt
deleted file mode 100644
index 8aed9bf..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXX.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXX(
- val Errors: List,
- val MaturityAmount: Double,
- val Message: String,
- val Status: String,
- val StatusCode: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXX.kt
deleted file mode 100644
index 8fec636..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXX.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXX(
- val message: String,
- val status: String,
- val status_code: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXX.kt
deleted file mode 100644
index 8ccd6cf..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXX.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXX(
- val Errors: List,
- val Message: String,
- val Status: String,
- val StatusCode: Int,
- val StepsCount: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXX.kt
deleted file mode 100644
index 5edfa7f..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXX.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXXX(
- val message: String,
- val status: String,
- val status_code: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXX.kt
deleted file mode 100644
index 8978bf0..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXX.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXXXX(
- val message: String,
- val status: String,
- val status_code: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXX.kt
deleted file mode 100644
index 0c6cb79..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXX.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXXXXX(
- val message: String,
- val status: String,
- val status_code: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXX.kt
deleted file mode 100644
index dd3406a..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXX.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXXXXXX(
- val BankList: List,
- val Errors: List,
- val Message: String,
- val Status: String,
- val StatusCode: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXX.kt
deleted file mode 100644
index 9d04f0b..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXX.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXXXXXXX(
- val message: String,
- val status: String,
- val status_code: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXX.kt
deleted file mode 100644
index 6b10d8d..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXX.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXXXXXXXX(
- val message: String,
- val status: String,
- val status_code: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXX.kt
deleted file mode 100644
index 2cf920c..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXX.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXXXXXXXXX(
- val Errors: List,
- val FDCreationDetailsResponse: FDCreationDetailsResponse,
- val Message: String,
- val Status: String,
- val StatusCode: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXX.kt
deleted file mode 100644
index a76524a..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXX.kt
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-import com.nivesh.production.niveshfd.fd.util.Resource
-
-data class ResponseXXXXXXXXXXXX(
- val Errors: List,
- val FDDataResponse: FDDataResponse,
- val Message: String,
- val Status: String,
- val StatusCode: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXX.kt
deleted file mode 100644
index 9282411..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXX.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXXXXXXXXXXX(
- val Errors: List,
- val Message: String,
- val Status: String,
- val StatusCode: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXXX.kt
deleted file mode 100644
index 9d63740..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXXX.kt
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXXXXXXXXXXXX(
- val message: String,
- val status: String,
- val status_code: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXXXX.kt
deleted file mode 100644
index d46306c..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXXXX.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXXXXXXXXXXXXX(
- val Errors: List,
- val Message: String,
- val Status: String,
- val StatusCode: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXXXXX.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXXXXX.kt
deleted file mode 100644
index 34df53f..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/ResponseXXXXXXXXXXXXXXXX.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class ResponseXXXXXXXXXXXXXXXX(
- val Errors: List,
- val Message: String,
- val Status: String,
- val StatusCode: Int,
- val UniqueId: String,
- val KYCFlag: Int
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/SaveFDOtherDataRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/SaveFDOtherDataRequest.kt
deleted file mode 100644
index cfc420b..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/SaveFDOtherDataRequest.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class SaveFDOtherDataRequest(
- var FDProvider: String?= "",
- var NiveshClientCode: String? = "",
- var UniqueId: String? = "",
- var Values: String? = ""
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/SaveFDOtherDataResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/SaveFDOtherDataResponse.kt
deleted file mode 100644
index b6178c1..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/SaveFDOtherDataResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class SaveFDOtherDataResponse(
- val Response: ResponseXXXXXXXXXXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/StateListResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/StateListResponse.kt
deleted file mode 100644
index 93bed5b..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/StateListResponse.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class StateListResponse(
- val DataObject: List,
- val Message: Any,
- val ObjectResponse: Any,
- val response: ResponseXXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/StepsCountResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/StepsCountResponse.kt
deleted file mode 100644
index 3669447..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/StepsCountResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class StepsCountResponse(
- val Response: ResponseXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/UploadResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/UploadResponse.kt
deleted file mode 100644
index f3b63c1..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/UploadResponse.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class UploadResponse(
- val Response: ResponseXXXXXXXXXXXX
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/UserRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/UserRequest.kt
deleted file mode 100644
index 4941ab0..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/UserRequest.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class UserRequest(
- var AppOrWeb: String? = "",
- var IPAddress: String? = "",
- var LoggedInRoleId: Int = 0,
- var Source: String? = "",
- var UID: Int? = 0,
- var deviceInfo: DeviceInfo? = null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/getClientDetailsRequest.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/getClientDetailsRequest.kt
deleted file mode 100644
index 12d39c2..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/getClientDetailsRequest.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class getClientDetailsRequest(
- var AppOrWeb: String? = "",
- var UserRequest: UserRequest? = null,
- var client_code: String? = "",
- var sub_broker_code: String? = ""
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/getClientDetailsResponse.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/model/getClientDetailsResponse.kt
deleted file mode 100644
index fec61c6..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/model/getClientDetailsResponse.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.nivesh.production.niveshfd.fd.model
-
-data class getClientDetailsResponse(
-// val DataObject: Any ?,
-// val Message: Any,
- val ObjectResponse: ObjectResponse? = null,
- val response: ResponseXXXXXXX? = null
-)
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/repositories/MainRepository.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/repositories/MainRepository.kt
deleted file mode 100644
index e9d5273..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/repositories/MainRepository.kt
+++ /dev/null
@@ -1,111 +0,0 @@
-package com.nivesh.production.niveshfd.fd.repositories
-
-import com.nivesh.production.niveshfd.fd.interfaces.ApiInterface
-import com.nivesh.production.niveshfd.fd.model.*
-
-
-class MainRepository constructor(private val apiInterface: ApiInterface) {
-
- // MainActivity
- suspend fun getStepsCountResponse(requestBody: FDStepsCountRequest, token: String) =
- apiInterface.getFDStepsCount(requestBody, token)
-
- suspend fun getClientDetailsResponse(getClientDetails: getClientDetailsRequest, token: String) =
- apiInterface.getClientDetails(getClientDetails, token)
-
-
- // Step One
- suspend fun getRatesResponse(getRatesRequest: GetRatesRequest, token: String) =
- apiInterface.getRates(getRatesRequest, token)
-
- suspend fun getCodesResponse(requestBody: GetCodeRequest, token: String) =
- apiInterface.getCodes(requestBody, token)
-
- suspend fun createCalculateFDMaturityAmount(
- requestBody: GetMaturityAmountRequest,
- token: String
- ) =
- apiInterface.getCalculateFDMaturityAmount(requestBody, token)
-
-
- // Step Two
- suspend fun createFDKYCResponse(createFDRequest: CreateFDRequest, token: String) =
- apiInterface.createFDApp(createFDRequest, token)
-
- suspend fun panCheck(panCheck: PanCheckRequest, token: String) =
- apiInterface.panCheckApi(panCheck, token)
-
- suspend fun titleCheck(getCodeRequest: GetCodeRequest, token: String) =
- apiInterface.titleApi(getCodeRequest, token)
-
- suspend fun genderCheck(getCodeRequest: GetCodeRequest, token: String) =
- apiInterface.genderApi(getCodeRequest, token)
-
- suspend fun annualIncomeCheck(getCodeRequest: GetCodeRequest, token: String) =
- apiInterface.annualIncomeApi(getCodeRequest, token)
-
- suspend fun relationShipCheck(getCodeRequest: GetCodeRequest, token: String) =
- apiInterface.relationShipApi(getCodeRequest, token)
-
- suspend fun maritalStatusCheck(getCodeRequest: GetCodeRequest, token: String) =
- apiInterface.maritalStatusApi(getCodeRequest, token)
-
- suspend fun occupationCheck(getCodeRequest: GetCodeRequest, token: String) =
- apiInterface.occupationApi(getCodeRequest, token)
-
- suspend fun stateCheck(token: String) =
- apiInterface.stateApi(token)
-
- suspend fun cityCheck(cityRequest: CityRequest, token: String) =
- apiInterface.cityApi(cityRequest, token)
-
- suspend fun bankListCheck(token: String, language: String) =
- apiInterface.bankListApi(token, language)
-
- suspend fun ifscCodeCheck(str: String) =
- apiInterface.getIFSCApi(str)
-
- suspend fun ifscCodeBankDetailsCheck(str: String, token: String) =
- apiInterface.getIFSCBankDetailsApi(str, token)
-
- suspend fun payModeCheck(getCodeRequest: GetCodeRequest, token: String) =
- apiInterface.payModeApi(getCodeRequest, token)
-
- suspend fun bankValidationApiRequest(bankValidationApiRequest: BankValidationApiRequest, token: String) =
- apiInterface.bankValidationApi(bankValidationApiRequest, token)
-
-
-
- // Step Three
- suspend fun documentsUploadResponse(getRatesRequest: DocumentUpload, token: String) =
- apiInterface.documentsUpload(getRatesRequest, token)
-
-
- suspend fun saveFDOtherDataResponse(getRatesRequest: SaveFDOtherDataRequest, token: String) =
- apiInterface.saveFDOtherData(getRatesRequest, token)
-
- suspend fun getFDDetailsResponse(getRatesRequest: GetFDDetailsRequest, token: String) =
- apiInterface.getFDDetails(getRatesRequest, token)
-
- suspend fun updateFDPaymentStatusResponse(getRatesRequest: GetRatesRequest, token: String) =
- apiInterface.getRates(getRatesRequest, token)
-
-
- // Step 4
- suspend fun customerListCheck(getCodeRequest: GetCodeRequest, token: String) =
- apiInterface.customerListApi(getCodeRequest, token)
-
- suspend fun checkFDKYCRequest(checkFDKYCRequest: CheckFDKYCRequest, token: String) =
- apiInterface.checkFDKYC(checkFDKYCRequest, token)
-
-
- // Step 5
- suspend fun finaliseFDResponse(getRatesRequest: FinalizeFDRequest, token: String) =
- apiInterface.finaliseFD(getRatesRequest, token)
-
- suspend fun finaliseKYCResponse(getRatesRequest: FinalizeKYCRequest, token: String) =
- apiInterface.finaliseKYC(getRatesRequest, token)
-
- suspend fun paymentReQueryResponse(getRatesRequest: PaymentReQueryRequest, token: String) =
- apiInterface.paymentReQuery(getRatesRequest, token)
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/activity/NiveshFdMainActivity.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/activity/NiveshFdMainActivity.kt
deleted file mode 100644
index 7f72314..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/activity/NiveshFdMainActivity.kt
+++ /dev/null
@@ -1,481 +0,0 @@
-package com.nivesh.production.niveshfd.fd.ui.activity
-
-import android.annotation.SuppressLint
-import android.app.Dialog
-import android.content.Intent
-import android.graphics.Bitmap
-import android.graphics.drawable.Drawable
-import android.os.Bundle
-import android.util.Log
-import android.view.View
-import android.view.WindowManager
-import android.webkit.WebView
-import android.webkit.WebViewClient
-import android.widget.TextView
-import androidx.fragment.app.Fragment
-import androidx.lifecycle.ViewModelProvider
-import androidx.viewpager.widget.ViewPager
-import com.google.gson.Gson
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.databinding.ActivityNiveshFdBinding
-import com.nivesh.production.niveshfd.fd.adapter.DisableAdapter
-import com.nivesh.production.niveshfd.fd.adapter.SectionsPagerAdapter
-import com.nivesh.production.niveshfd.fd.api.ApiClient
-import com.nivesh.production.niveshfd.fd.db.PreferenceManager
-import com.nivesh.production.niveshfd.fd.model.CreateFDRequest
-import com.nivesh.production.niveshfd.fd.model.FdBankDetails
-import com.nivesh.production.niveshfd.fd.model.NomineeDetails
-import com.nivesh.production.niveshfd.fd.model.*
-import com.nivesh.production.niveshfd.fd.repositories.MainRepository
-import com.nivesh.production.niveshfd.fd.ui.fragment.*
-import com.nivesh.production.niveshfd.fd.ui.providerfactory.*
-import com.nivesh.production.niveshfd.fd.util.Common
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.defaultShape
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.selectedShape
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.showDialogValidation
-import com.nivesh.production.niveshfd.fd.util.ProgressUtil.hideLoading
-import com.nivesh.production.niveshfd.fd.util.ProgressUtil.showLoading
-import com.nivesh.production.niveshfd.fd.util.Resource
-import com.nivesh.production.niveshfd.fd.viewModel.*
-import com.nivesh.production.niveshfd.fd.ui.fragment.StepThreeNiveshFDFragment
-
-
-class NiveshFdMainActivity : BaseActivity() {
- lateinit var binding: ActivityNiveshFdBinding
- lateinit var viewModel: BajajFDViewModel
-
- private val stepOneNiveshFDFragment = StepOneNiveshFDFragment()
- private val stepTwoNiveshFDFragment = StepTwoNiveshFDFragment()
- private val stepThreeNiveshFDFragment = StepThreeNiveshFDFragment()
- private val stepFourBajajFDFragment = StepFourNiveshFDFragment()
- private val stepFiveNiveshFDFragment = StepFiveNiveshFDFragment()
-
- var createFDRequest: CreateFDRequest = CreateFDRequest()
- var createFDApplicantRequest: CreateFDApplicationRequest = CreateFDApplicationRequest()
- var applicantDetails: ApplicantDetails = ApplicantDetails()
- var fdInvestmentDetails: FDInvestmentDetails = FDInvestmentDetails()
- var applicantRelationDetails: ApplicantRelationDetails = ApplicantRelationDetails()
- var fdBankDetails: FdBankDetails = FdBankDetails()
- var nomineeDetails: NomineeDetails = NomineeDetails()
- var nomineeGuardianDetails: NomineeGuardianDetails = NomineeGuardianDetails()
- var getClientDetailsResponse: getClientDetailsResponse = getClientDetailsResponse()
-
- private lateinit var sectionsPagerAdapter: SectionsPagerAdapter
- private lateinit var fragments: Array
- var dialogWebView: Dialog? = null
- var stepCount: Int = 0
- var uniqueId: String = ""
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- init()
- }
-
-
- private fun init() {
- //start Repository
- viewModel = ViewModelProvider(
- this@NiveshFdMainActivity,
- FDModelProviderFactory(MainRepository(ApiClient.getApiClient))
- )[BajajFDViewModel::class.java]
- binding = ActivityNiveshFdBinding.inflate(layoutInflater)
- binding.apply {
- setContentView(this.root)
- }
-
- PreferenceManager(this@NiveshFdMainActivity).setLoginRole(5)
- PreferenceManager(this@NiveshFdMainActivity).setClientCode("8872")
- PreferenceManager(this@NiveshFdMainActivity).setSubBrokerID("1038")
- PreferenceManager(this@NiveshFdMainActivity).setToken("636F8F63-06C4-4D95-8562-392B34025FB0")
-
- if (Common.isNetworkAvailable(this)) {
- getStepsCountApi()
- }
-
- binding.imgBack.setOnClickListener {
- finish()
- }
- }
-
- private fun getStepsCountApi() {
- if (Common.isNetworkAvailable(this)) {
- val fdStepsCount = FDStepsCountRequest()
- fdStepsCount.FDProvider = getString(R.string.bajaj)
- fdStepsCount.NiveshClientCode =
- PreferenceManager(this@NiveshFdMainActivity).getClientCode()
- viewModel.getStepsCount(
- fdStepsCount,
- PreferenceManager(this@NiveshFdMainActivity).getToken(),
- this
- )
- viewModel.getStepsCountMutableData.observe(this) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("response", "-->${response.data.toString()}")
- val stepsCountResponse: StepsCountResponse =
- Gson().fromJson(
- response.data?.toString(),
- StepsCountResponse::class.java
- )
- stepsCountResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- stepCount = stepsCountResponse.Response.StepsCount
- if (stepCount == 3) {
- binding.llStep4.visibility = View.GONE
- }
- getClientDetailsApi(stepsCountResponse.Response.StepsCount)
- }
- 650 -> ""
- else -> {
- if (stepsCountResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- this@NiveshFdMainActivity,
- stepsCountResponse.Response.Errors[0].ErrorMessage
- )
- }else{
- showDialogValidation(
- this@NiveshFdMainActivity,
- "".plus(stepsCountResponse.Response.Message)
- )
- }
- }
- }
- }
- }
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(this@NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- else -> {
- showDialogValidation(this@NiveshFdMainActivity, response.message)
- }
-
- }
- }
- }
- }
-
- private fun getClientDetailsApi(stepsCount: Int) {
- if (Common.isNetworkAvailable(this@NiveshFdMainActivity)) {
- val getClientDetailsRequest = getClientDetailsRequest()
- getClientDetailsRequest.client_code =
- PreferenceManager(this@NiveshFdMainActivity).getClientCode()
- getClientDetailsRequest.AppOrWeb = getString(R.string.app)
- getClientDetailsRequest.sub_broker_code =
- PreferenceManager(this@NiveshFdMainActivity).getSubBrokerID()
- val userRequest = UserRequest()
- userRequest.UID = 0
- userRequest.IPAddress = ""
- userRequest.Source = getString(R.string.source)
- userRequest.AppOrWeb = getString(R.string.app)
- userRequest.LoggedInRoleId = PreferenceManager(this@NiveshFdMainActivity).getLoginRole()
-
- val deviceInfo = DeviceInfo()
- deviceInfo.device_id = ""
- deviceInfo.device_id_for_UMSId = ""
- deviceInfo.device_type = getString(R.string.app)
- deviceInfo.device_model = ""
- deviceInfo.device_token = ""
- deviceInfo.device_name = ""
- deviceInfo.app_version = ""
- deviceInfo.device_os_version = ""
- userRequest.deviceInfo = deviceInfo
- getClientDetailsRequest.UserRequest = userRequest
- Log.e("getClientDetail ", " Request -->" + Gson().toJson(getClientDetailsRequest))
- showLoading(this@NiveshFdMainActivity)
- viewModel.getClientDetails(
- getClientDetailsRequest,
- PreferenceManager(this@NiveshFdMainActivity).getToken(),
- this
- )
- viewModel.getClientDetailsMutableData.observe(this) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("getClientDetail ", " response -->${response.data.toString()}")
- getClientDetailsResponse =
- Gson().fromJson(
- response.data?.toString(),
- getClientDetailsResponse::class.java
- )
- getClientDetailsResponse.response?.status_code.let { code ->
- when (code) {
- 200 -> {
- setViewPager(stepsCount)
- }
- 650 -> ""
- else -> {
- showDialogValidation(
- this@NiveshFdMainActivity,
- response.message
- )
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(this@NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
- hideLoading()
- }
- is Resource.DataError -> {
-
- }
- else -> {
- showDialogValidation(this@NiveshFdMainActivity, response.message)
- }
- }
- }
- }
- }
-
- private fun setViewPager(stepsCount: Int) {
- // steps setting
- setBackground(selectedShape(), defaultShape(), defaultShape(), defaultShape(), stepsCount)
-
- if (stepCount == 3) {
- fragments = arrayOf(
- stepOneNiveshFDFragment,
- stepTwoNiveshFDFragment,
- stepFourBajajFDFragment,
- stepFiveNiveshFDFragment
- )
- } else if (stepCount == 4) {
- fragments = arrayOf(
- stepOneNiveshFDFragment,
- stepTwoNiveshFDFragment,
- stepThreeNiveshFDFragment,
- stepFourBajajFDFragment,
- stepFiveNiveshFDFragment
- )
- }
-
- // set viewPager
- sectionsPagerAdapter = SectionsPagerAdapter(supportFragmentManager, fragments)
- val viewPager: DisableAdapter = binding.viewPager
- viewPager.adapter = sectionsPagerAdapter
- viewPager.setPagingEnabled(false)
- // if (sectionsPagerAdapter.count > 1) {
- viewPager.offscreenPageLimit = stepCount
- // } else {
- // viewPager.offscreenPageLimit = 1
- // }
- viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
- override fun onPageScrolled(
- position: Int,
- positionOffset: Float,
- positionOffsetPixels: Int
- ) {
- }
-
- override fun onPageSelected(position: Int) {
- when (position) {
- 0 -> {
- setBackground(
- defaultShape(),
- defaultShape(),
- defaultShape(),
- defaultShape(),
- stepsCount
- )
- }
- 1 -> {
- setBackground(
- selectedShape(),
- defaultShape(),
- defaultShape(),
- defaultShape(),
- stepsCount
- )
- }
- 2 -> {
- setBackground(
- selectedShape(),
- selectedShape(),
- defaultShape(),
- defaultShape(),
- stepsCount
- )
- }
- 3 -> {
- setBackground(
- selectedShape(),
- selectedShape(),
- selectedShape(),
- defaultShape(),
- stepsCount
- )
- }
- 4 -> {
- setBackground(
- selectedShape(),
- selectedShape(),
- selectedShape(),
- selectedShape(),
- stepsCount
- )
- }
- }
- }
-
- override fun onPageScrollStateChanged(state: Int) {
-
- }
- })
-
- }
-
-
- // set background for selected/ default step
- private fun setBackground(
- drawable: Drawable?,
- drawable1: Drawable?,
- drawable2: Drawable?,
- drawable3: Drawable?,
- stepsCount: Int
- ) {
- binding.stepOne.background = drawable
- binding.stepTwo.background = drawable1
- binding.stepThree.background = drawable2
- if (stepsCount == 4) {
- binding.stepFour.background = drawable3
- }
-
- }
-
- // step 1 response
- fun stepOneApi() {
- binding.viewPager.currentItem = 1
- }
-
- // step 2 response
- fun stepTwoApi() {
- binding.viewPager.currentItem = 2
- if (stepCount == 3) {
- stepFourBajajFDFragment.displayReceivedData()
- }
- }
-
- // step 3 response
- fun stepThreeApi() {
- binding.viewPager.currentItem = 3
- stepFourBajajFDFragment.displayReceivedData()
- }
-
- // step 4 response
- fun stepFourApi(payUrl: String, value: String) {
- paymentDialog(payUrl, value)
- }
-
- @SuppressLint("SetJavaScriptEnabled")
- fun paymentDialog(payUrl: String, value: String) {
- Log.e("payUrl", "-->$payUrl")
- Log.e("value", "-->$value")
- dialogWebView = Dialog(this@NiveshFdMainActivity)
- dialogWebView!!.setContentView(R.layout.row_fd_pay1)
- dialogWebView!!.setCancelable(true)
- val tvCancel = dialogWebView!!.findViewById(R.id.tvCancel)
- tvCancel.setOnClickListener {
- dialogWebView!!.dismiss()
- }
- val lp = WindowManager.LayoutParams()
- lp.copyFrom(dialogWebView!!.window?.attributes)
- lp.width = WindowManager.LayoutParams.MATCH_PARENT
- lp.height = WindowManager.LayoutParams.MATCH_PARENT
- dialogWebView!!.window?.attributes = lp
- val wVPay = dialogWebView!!.findViewById(R.id.wVPay)
- wVPay.settings.javaScriptEnabled = true
- wVPay.settings.domStorageEnabled = true
- wVPay.loadData(
- " \n" +
- "",
- "text/html",
- "UTF-8"
- )
- wVPay.webViewClient = object : WebViewClient() {
- override fun onPageStarted(view: WebView, url: String, favicon: Bitmap?) {
- super.onPageStarted(view, url, favicon)
- Log.e("onPageStarted", "-->$url")
- if (url.isNotEmpty() && url.contains("https://uat.nivesh.com/bajajFD/OrderStatus")) {
- if (dialogWebView!!.isShowing) {
- dialogWebView!!.dismiss()
- paymentReQueryApi()
- }
- }
- }
- }
- dialogWebView!!.show()
- }
-
- fun paymentReQueryApi() {
- if (Common.isNetworkAvailable(this)) {
- val paymentReQueryRequest = PaymentReQueryRequest()
- paymentReQueryRequest.UniqueId = uniqueId
- paymentReQueryRequest.NiveshClientCode =
- getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
- showLoading(this@NiveshFdMainActivity)
- viewModel.getPaymentReQuery(
- paymentReQueryRequest,
- PreferenceManager(this@NiveshFdMainActivity).getToken(),
- this
- )
- viewModel.getPaymentReQueryMutableData.observe(this) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("paymentReQueryApi ", "response -->$response")
- val paymentReQueryResponse: PaymentReQueryResponse =
- Gson().fromJson(
- response.data?.toString(),
- PaymentReQueryResponse::class.java
- )
- paymentReQueryResponse.Response.StatusCode.let { code ->
- when (code) {
- 650 -> ""
- else -> {
- if (stepCount == 4) {
- binding.viewPager.currentItem = 4
- } else {
- binding.viewPager.currentItem = 3
- }
- stepFiveNiveshFDFragment.getData(paymentReQueryResponse)
- }
- }
- }
- }
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(this@NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
- hideLoading()
- }
- is Resource.DataError -> {
-
- }
- else -> {
- showDialogValidation(this@NiveshFdMainActivity, response.message)
- }
- }
- }
- }
- }
-
- fun retryMethod() {
- val intent: Intent = intent
- finish()
- startActivity(intent)
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/activity/PaymentActivity.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/activity/PaymentActivity.kt
deleted file mode 100644
index 2a98259..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/activity/PaymentActivity.kt
+++ /dev/null
@@ -1,187 +0,0 @@
-package com.nivesh.production.niveshfd.fd.ui.activity
-
-import android.app.Dialog
-import android.graphics.Bitmap
-import android.os.Bundle
-import android.util.Log
-import android.view.View
-import android.view.WindowManager
-import android.webkit.WebView
-import android.webkit.WebViewClient
-import android.widget.TextView
-import androidx.core.content.ContextCompat
-import androidx.lifecycle.ViewModelProvider
-import com.google.gson.Gson
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.databinding.FragmentNiveshfdStepFiveBinding
-import com.nivesh.production.niveshfd.fd.api.ApiClient
-import com.nivesh.production.niveshfd.fd.db.PreferenceManager
-import com.nivesh.production.niveshfd.fd.model.PaymentReQueryRequest
-import com.nivesh.production.niveshfd.fd.model.PaymentReQueryResponse
-import com.nivesh.production.niveshfd.fd.repositories.MainRepository
-import com.nivesh.production.niveshfd.fd.ui.providerfactory.FDModelProviderFactory
-import com.nivesh.production.niveshfd.fd.util.Common
-import com.nivesh.production.niveshfd.fd.util.Constants
-import com.nivesh.production.niveshfd.fd.util.ProgressUtil
-import com.nivesh.production.niveshfd.fd.util.Resource
-import com.nivesh.production.niveshfd.fd.viewModel.BajajFDViewModel
-
-class PaymentActivity : BaseActivity() {
-
- private lateinit var binding: FragmentNiveshfdStepFiveBinding
- var dialogWebView: Dialog? = null
- lateinit var viewModel: BajajFDViewModel
- private var clientCode : String = ""
- var uniqueId : String = ""
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
-
- viewModel = ViewModelProvider(
- this@PaymentActivity,
- FDModelProviderFactory(MainRepository(ApiClient.getApiClient))
- )[BajajFDViewModel::class.java]
- binding = FragmentNiveshfdStepFiveBinding.inflate(layoutInflater)
-
- binding.btnViewOrder.setOnClickListener {
- (this@PaymentActivity).setResult(RESULT_OK)
- (this@PaymentActivity).finish()
- }
-
- binding.tvRetry.setOnClickListener {
- (this@PaymentActivity).setResult(RESULT_OK)
- (this@PaymentActivity).finish()
- }
- if (intent != null){
-
- clientCode = intent.getStringExtra("clientCode").toString()
- paymentDialog(intent.getStringExtra("url").toString(), intent.getStringExtra("value").toString())
- }
-
- }
-
- private fun paymentDialog(payUrl: String, value: String) {
- Log.e("payUrl", "-->$payUrl")
- Log.e("value", "-->$value")
- dialogWebView = Dialog(this@PaymentActivity)
- dialogWebView!!.setContentView(R.layout.row_fd_pay1)
- dialogWebView!!.setCancelable(true)
- val tvCancel = dialogWebView!!.findViewById(R.id.tvCancel)
- tvCancel.setOnClickListener {
- dialogWebView!!.dismiss()
- (this@PaymentActivity).setResult(RESULT_OK)
- (this@PaymentActivity).finish()
- }
- val lp = WindowManager.LayoutParams()
- lp.copyFrom(dialogWebView!!.window?.attributes)
- lp.width = WindowManager.LayoutParams.MATCH_PARENT
- lp.height = WindowManager.LayoutParams.MATCH_PARENT
- dialogWebView!!.window?.attributes = lp
- val wVPay = dialogWebView!!.findViewById(R.id.wVPay)
- wVPay.settings.javaScriptEnabled = true
- wVPay.settings.domStorageEnabled = true
- wVPay.loadData(
- " \n" +
- "",
- "text/html",
- "UTF-8"
- )
- wVPay.webViewClient = object : WebViewClient() {
- override fun onPageStarted(view: WebView, url: String, favicon: Bitmap?) {
- super.onPageStarted(view, url, favicon)
- Log.e("onPageStarted", "-->$url")
- if (url.isNotEmpty() && url.contains(Constants.paymentUrl)) {
- if (dialogWebView!!.isShowing) {
- dialogWebView!!.dismiss()
- paymentReQueryApi()
- }
- }
- }
- }
- dialogWebView!!.show()
- }
-
- fun paymentReQueryApi() {
- if (Common.isNetworkAvailable(this)) {
- val paymentReQueryRequest = PaymentReQueryRequest()
- paymentReQueryRequest.UniqueId = uniqueId
- paymentReQueryRequest.NiveshClientCode = clientCode
- ProgressUtil.showLoading(this@PaymentActivity)
- viewModel.getPaymentReQuery(
- paymentReQueryRequest,
- PreferenceManager(this@PaymentActivity).getToken(),
- this
- )
- viewModel.getPaymentReQueryMutableData.observe(this) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("paymentReQueryApi ", "response -->$response")
- val paymentReQueryResponse: PaymentReQueryResponse =
- Gson().fromJson(
- response.data?.toString(),
- PaymentReQueryResponse::class.java
- )
- paymentReQueryResponse.Response.StatusCode.let { code ->
- when (code) {
- 650 -> ""
- else -> {
- getData(paymentReQueryResponse)
- }
- }
- }
- }
- is Resource.Error -> {
- response.message?.let { message ->
- Common.showDialogValidation(this@PaymentActivity, message)
- }
- }
- is Resource.Loading -> {
- ProgressUtil.hideLoading()
- }
- is Resource.DataError -> {
-
- }
- else -> {
- Common.showDialogValidation(this@PaymentActivity, response.message)
- }
- }
- }
- }
- }
-
-
- private fun getData(paymentReQueryResponse: PaymentReQueryResponse) {
- if (paymentReQueryResponse.Response.StatusCode == 200) {
- if (paymentReQueryResponse.Response.Message.isNotEmpty()) {
- val arrOfStr: List =
- paymentReQueryResponse.Response.Message.split(" ", limit = 2)
- binding.tvCongrats.text = arrOfStr[0]
- binding.tvCongrats.setTextColor(
- ContextCompat.getColor(
- this@PaymentActivity,
- R.color.green
- )
- )
- binding.tvSuccessMessage.text = arrOfStr[1]
- }
- } else {
- if (paymentReQueryResponse.Response.Message.isNotEmpty()) {
- if (paymentReQueryResponse.Response.Message.isNotEmpty()) {
- binding.tvCongrats.text = paymentReQueryResponse.Response.Status
- binding.tvCongrats.setTextColor(
- ContextCompat.getColor(
- this@PaymentActivity,
- R.color.red
- )
- )
- binding.tvSuccessMessage.text = paymentReQueryResponse.Response.Message
- }
- }
- binding.tvRetry.visibility = View.VISIBLE
- binding.btnViewOrder.visibility = View.GONE
- }
-
- }
-
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepFiveNiveshFDFragment.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepFiveNiveshFDFragment.kt
deleted file mode 100644
index c97801f..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepFiveNiveshFDFragment.kt
+++ /dev/null
@@ -1,208 +0,0 @@
-package com.nivesh.production.niveshfd.fd.ui.fragment
-
-import android.app.Activity
-import android.os.Bundle
-import android.util.Log
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import androidx.core.content.ContextCompat
-import androidx.fragment.app.Fragment
-import com.google.gson.Gson
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.databinding.FragmentNiveshfdStepFiveBinding
-import com.nivesh.production.niveshfd.fd.db.PreferenceManager
-import com.nivesh.production.niveshfd.fd.model.*
-import com.nivesh.production.niveshfd.fd.ui.activity.NiveshFdMainActivity
-import com.nivesh.production.niveshfd.fd.util.Common
-import com.nivesh.production.niveshfd.fd.util.Resource
-
-class StepFiveNiveshFDFragment : Fragment() {
-
- private var _binding: FragmentNiveshfdStepFiveBinding? = null
- private val binding get() = _binding!!
-
- override fun onCreateView(
- inflater: LayoutInflater, container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View {
-
- _binding = FragmentNiveshfdStepFiveBinding.inflate(inflater, container, false)
- return binding.root
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
-
- binding.btnViewOrder.setOnClickListener {
- (activity as NiveshFdMainActivity).setResult(Activity.RESULT_OK)
- (activity as NiveshFdMainActivity).finish()
- }
-
- binding.tvRetry.setOnClickListener {
- (activity as NiveshFdMainActivity).retryMethod()
- }
- }
-
- fun getData(paymentReQueryResponse: PaymentReQueryResponse) {
- if (paymentReQueryResponse.Response.StatusCode == 200) {
- if (paymentReQueryResponse.Response.Message.isNotEmpty()) {
- val arrOfStr: List =
- paymentReQueryResponse.Response.Message.split(" ", limit = 2)
- binding.tvCongrats.text = arrOfStr[0]
- binding.tvCongrats.setTextColor(
- ContextCompat.getColor(
- activity as NiveshFdMainActivity,
- R.color.green
- )
- )
- binding.tvSuccessMessage.text = arrOfStr[1]
- }
- finalizeFDApi()
-
- } else {
- if (paymentReQueryResponse.Response.Message.isNotEmpty()) {
- if (paymentReQueryResponse.Response.Message.isNotEmpty()) {
- binding.tvCongrats.text = paymentReQueryResponse.Response.Status
- binding.tvCongrats.setTextColor(
- ContextCompat.getColor(
- activity as NiveshFdMainActivity,
- R.color.red
- )
- )
- binding.tvSuccessMessage.text = paymentReQueryResponse.Response.Message
- }
- }
- binding.tvRetry.visibility = View.VISIBLE
- binding.btnViewOrder.visibility = View.GONE
- }
-
- }
-
- private fun finalizeFDApi() {
- val finalizeFDRequest = FinalizeFDRequest()
- val finaliseFD = FinaliseFD()
- finaliseFD.FDProvider = getString(R.string.bajaj)
- finaliseFD.NiveshClientCode =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
- finaliseFD.UniqueId = (activity as NiveshFdMainActivity).uniqueId
- finalizeFDRequest.FinaliseFD = finaliseFD
-
- (activity as NiveshFdMainActivity).viewModel.finaliseFD(
- finalizeFDRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getFinalizeFDMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("finalizeKYC ", " response-->${response.data.toString()}")
- val finalizeFDResponse: FinalizeFDResponse =
- Gson().fromJson(response.data?.toString(), FinalizeFDResponse::class.java)
- finalizeFDResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- if ( finalizeFDResponse.Response.KYCFlag == 0){
- finalizeKYCApi()
- } else {
-
- }
- }
- 650 -> ""
- else -> {
- if (finalizeFDResponse.Response.Errors.isNotEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- finalizeFDResponse.Response.Errors[0].ErrorMessage
- )
- }else{
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(finalizeFDResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- Common.showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun finalizeKYCApi() {
- val finalizeKYCRequest = FinalizeKYCRequest()
- finalizeKYCRequest.FDProvider = getString(R.string.bajaj)
- finalizeKYCRequest.NiveshClientCode =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
- finalizeKYCRequest.UniqueId = (activity as NiveshFdMainActivity).uniqueId
- (activity as NiveshFdMainActivity).viewModel.finaliseKYC(
- finalizeKYCRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getFinalizeKYCMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("finalizeKYC ", " response-->${response.data.toString()}")
- val finalizeFDResponse: FinalizeFDResponse =
- Gson().fromJson(response.data?.toString(), FinalizeFDResponse::class.java)
- finalizeFDResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
-
- }
- 650 -> ""
- else -> {
- if (finalizeFDResponse.Response.Errors.isNotEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- finalizeFDResponse.Response.Errors[0].ErrorMessage
- )
- }else{
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(finalizeFDResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- Common.showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
-
- }
-
- override fun onDestroyView() {
- super.onDestroyView()
- _binding = null
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepFourNiveshFDFragment.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepFourNiveshFDFragment.kt
deleted file mode 100644
index a8fa3f7..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepFourNiveshFDFragment.kt
+++ /dev/null
@@ -1,329 +0,0 @@
-package com.nivesh.production.niveshfd.fd.ui.fragment
-
-import android.os.Bundle
-import android.util.Log
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import androidx.core.content.res.ResourcesCompat
-import androidx.fragment.app.Fragment
-import androidx.recyclerview.widget.LinearLayoutManager
-import com.google.gson.Gson
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.databinding.FragmentNiveshfdStepFourBinding
-import com.nivesh.production.niveshfd.fd.adapter.CustomerListAdapter
-import com.nivesh.production.niveshfd.fd.db.PreferenceManager
-import com.nivesh.production.niveshfd.fd.model.*
-import com.nivesh.production.niveshfd.fd.ui.activity.NiveshFdMainActivity
-import com.nivesh.production.niveshfd.fd.util.Common
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.showDialogValidation
-import com.nivesh.production.niveshfd.fd.util.Resource
-
-class StepFourNiveshFDFragment : Fragment() {
-
- private var _binding: FragmentNiveshfdStepFourBinding? = null
- private val binding get() = _binding!!
-
- private lateinit var listOfCustomer: MutableList
- private var selectedList: String = ""
- private var payUrl: String = ""
- private var value: String = ""
- private var checkNRI: Boolean = false
-
- override fun onCreateView(
- inflater: LayoutInflater, container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View {
-
- _binding = FragmentNiveshfdStepFourBinding.inflate(inflater, container, false)
- return binding.root
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
-
- if (PreferenceManager(activity as NiveshFdMainActivity).getLoginRole() == 5) {
- binding.btnNext.text = getString(R.string.pay)
- binding.btnNext.setBackgroundColor(
- ResourcesCompat.getColor(
- resources,
- R.color.green,
- null
- )
- )
- } else {
- binding.btnNext.text = getString(R.string.viewOrder)
- binding.btnNext.setBackgroundColor(
- ResourcesCompat.getColor(
- resources,
- R.color.red,
- null
- )
- )
- }
- checkNRI = true
- binding.btnNext.setOnClickListener {
- selectedList = ""
- for (getCodes in listOfCustomer) {
- if (getCodes.isSelected) {
- selectedList = if (selectedList.isEmpty()) {
- getCodes.Value
- } else {
- if (getCodes.Value.contains("outside of india", true)) {
- checkNRI = getCodes.isSelected
- }
- selectedList.plus(",").plus(getCodes.Value)
- }
- }
- }
- if (validated()) {
- if (PreferenceManager(activity as NiveshFdMainActivity).getLoginRole() == 5) {
- val saveFDOtherDataRequest = SaveFDOtherDataRequest()
- saveFDOtherDataRequest.FDProvider = getString(R.string.bajaj)
- saveFDOtherDataRequest.UniqueId = (activity as NiveshFdMainActivity).uniqueId
- saveFDOtherDataRequest.Values = selectedList
- saveFDOtherDataRequest.NiveshClientCode =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
- saveFDOtherData(saveFDOtherDataRequest, payUrl, value)
- } else {
- // go to view order
- }
- }
- }
-
- binding.btnBack.setOnClickListener {
- if ((activity as NiveshFdMainActivity).stepCount == 4) {
- (activity as NiveshFdMainActivity).binding.viewPager.currentItem = 2
- } else {
- (activity as NiveshFdMainActivity).binding.viewPager.currentItem = 1
- }
- }
-
- customerListApi()
- }
-
- private fun customerListApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.customerCategory)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.customerListApi(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.customerListMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("customerListApi", " response -->${response.data.toString()}")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- if (getCodeResponse.Response.GetCodesList.isNotEmpty()) {
- listOfCustomer = getCodeResponse.Response.GetCodesList
- setUpRecyclerView(listOfCustomer)
- }
- }
- // 650 -> refreshToken()
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun validated(): Boolean {
- return if (!checkNRI) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getString(R.string.validNRI)
- )
- false
- } else if (!binding.checkBox.isChecked) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- resources.getString(R.string.validTermsConditions)
- )
- false
- } else {
- true
- }
- }
-
- private fun saveFDOtherData(data: SaveFDOtherDataRequest, payUrl: String, value: String) {
- // ProgressUtil.showLoading(activity as NiveshFdMainActivity)
- (activity as NiveshFdMainActivity).viewModel.saveFDOtherData(
- data,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getFDOtherMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("saveFDOtherData", " response -->${response.data.toString()}")
- val saveFDOtherDataResponse: SaveFDOtherDataResponse =
- Gson().fromJson(
- response.data?.toString(),
- SaveFDOtherDataResponse::class.java
- )
- saveFDOtherDataResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- (activity as NiveshFdMainActivity).stepFourApi(payUrl, value)
- }
- // 650 -> refreshToken()
- else -> {
- if (saveFDOtherDataResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- saveFDOtherDataResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(saveFDOtherDataResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
- // ProgressUtil.hideLoading()
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun setUpRecyclerView(getCustomerList: MutableList) {
- binding.rvTerms.layoutManager =
- LinearLayoutManager(activity as NiveshFdMainActivity)
- val customerListAdapter = CustomerListAdapter(getCustomerList)
- binding.rvTerms.adapter = customerListAdapter
-
- }
-
- fun displayReceivedData() {
- getFDDetailsApi()
- }
-
- private fun getFDDetailsApi() {
- if (Common.isNetworkAvailable(activity as NiveshFdMainActivity)) {
- val getFDDetailsRequest = GetFDDetailsRequest()
- getFDDetailsRequest.FDProvider = getString(R.string.bajaj)
- getFDDetailsRequest.NiveshClientCode =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
- getFDDetailsRequest.UniqueId = (activity as NiveshFdMainActivity).uniqueId
- (activity as NiveshFdMainActivity).viewModel.getFDDetails(
- getFDDetailsRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getFDDetailsMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("getFDDetailsApi", " response -->${response.data.toString()}")
- val getFDDetailsResponse: GetFDDetailsResponse =
- Gson().fromJson(
- response.data?.toString(),
- GetFDDetailsResponse::class.java
- )
- getFDDetailsResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- binding.tvInvestedAmount.text =
- getString(R.string.rs).plus(getFDDetailsResponse.Response.FDDataResponse.FDAmount.toString())
- binding.tvTenure.text =
- getFDDetailsResponse.Response.FDDataResponse.Tenure.toString()
- .plus(" Months")
- binding.tvInterestPayout.text =
- getFDDetailsResponse.Response.FDDataResponse.Frequency
- binding.tvRateOfInterest.text =
- getFDDetailsResponse.Response.FDDataResponse.RateOfInterest.toString()
- .plus(" % p.a.")
- payUrl = getFDDetailsResponse.Response.FDDataResponse.PaymentUrl
- value = getFDDetailsResponse.Response.FDDataResponse.Value
- }
- // 650 -> refreshToken()
- else -> {
- if (getFDDetailsResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getFDDetailsResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getFDDetailsResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
-
- }
- }
-
- override fun onDestroyView() {
- super.onDestroyView()
- _binding = null
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepOneNiveshFDFragment.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepOneNiveshFDFragment.kt
deleted file mode 100644
index 02059f5..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepOneNiveshFDFragment.kt
+++ /dev/null
@@ -1,592 +0,0 @@
-package com.nivesh.production.niveshfd.fd.ui.fragment
-
-import android.os.Bundle
-import android.text.Editable
-import android.text.InputFilter
-import android.text.TextWatcher
-import android.util.Log
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.ArrayAdapter
-import android.widget.RadioButton
-import androidx.fragment.app.Fragment
-import androidx.fragment.app.activityViewModels
-import androidx.recyclerview.widget.DefaultItemAnimator
-import androidx.recyclerview.widget.LinearLayoutManager
-import androidx.recyclerview.widget.RecyclerView.LayoutManager
-import com.google.gson.Gson
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.databinding.FragmentNiveshfdStepOneBinding
-import com.nivesh.production.niveshfd.fd.adapter.HorizontalRecyclerViewAdapter
-import com.nivesh.production.niveshfd.fd.db.PreferenceManager
-import com.nivesh.production.niveshfd.fd.model.*
-import com.nivesh.production.niveshfd.fd.ui.activity.NiveshFdMainActivity
-import com.nivesh.production.niveshfd.fd.util.Common
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.commonErrorMethod
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.removeError
-import com.nivesh.production.niveshfd.fd.util.Resource
-import com.nivesh.production.niveshfd.fd.viewModel.MyObseravble
-
-
-class StepOneNiveshFDFragment : Fragment() {
- private var _binding: FragmentNiveshfdStepOneBinding? = null
- private val binding get() = _binding!!
-
- private val observerViewModel: MyObseravble by activityViewModels()
- private lateinit var rgMaturity: RadioButton
- private lateinit var listOfTenure: MutableList
- private lateinit var recyclerViewDropDownAdapter: HorizontalRecyclerViewAdapter
- private lateinit var listOfMinAmount: List
- private lateinit var listOfMaxAmount: List
- private lateinit var listOfFrequency: List
-
- private var tenure: Int = 0
- private var interest: Double = 0.0
- private var maturityText: String = ""
-
- override fun onCreateView(
- inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
- ): View {
- _binding = FragmentNiveshfdStepOneBinding.inflate(inflater, container, false)
- return binding.root
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
-
- listOfTenure = ArrayList()
- listOfMinAmount = ArrayList()
- listOfMaxAmount = ArrayList()
- listOfFrequency = ArrayList()
-
- rgMaturity = RadioButton(activity as NiveshFdMainActivity)
- binding.edtAmount.filters = arrayOf(InputFilter.LengthFilter(8)) // upto 1 Cr
- // Amount
- binding.edtAmount.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.tlDepositAmount)
- if (s.toString().trim().length >= 4) {
- maturityAmountApi(tenure, interest)
- }
- }
- })
-
- // Frequency
- binding.spInterestPayout.setOnItemClickListener { _, _, position, _ ->
- removeError(binding.tlInterestPayout)
- if (listOfFrequency.isNotEmpty()) {
- binding.tvFrequency.text = listOfFrequency[position].Value
- if (!binding.tvFrequency.text.equals(getString(R.string.cumulativeText))) {
- binding.txtCumulativeNon.text = getString(R.string.nonCumulativeROI)
- } else {
- binding.txtCumulativeNon.text = getString(R.string.cumulativeROI)
- }
- if (binding.edtAmount.text.toString().trim().isNotEmpty()) {
- maturityAmountApi(tenure, interest)
- }
- }
- }
-
- // Tenure
- binding.spTenure.setOnItemClickListener { _, _, position, _ ->
- removeError(binding.tlInterestTenure)
- if (listOfTenure.isNotEmpty()) {
- tenure = listOfTenure[position].Tenure.toInt()
- interest = listOfTenure[position].ROI
- binding.tvROI.text = interest.toString().plus(" %")
- maturityAmountApi(tenure, interest)
- recyclerViewDropDownAdapter.refresh()
- }
- }
-
- // Senior / Non Senior Citizen
- binding.swSeniorCitizen.setOnCheckedChangeListener { _, _ ->
- getRatesApi()
- }
-
- // Maturity Options
- maturityText = getString(R.string.totalDeduction)
- rgMaturity.text = getString(R.string.additionalDetailOne)
- binding.radioGroup.setOnCheckedChangeListener { group, checkedId ->
- rgMaturity = group.findViewById(checkedId)
- Log.e("Maturity", "-->" + rgMaturity.text)
- maturityText = if (rgMaturity.text.contains("credit")) {
- getString(R.string.totalDeduction)
- } else {
- getString(R.string.principalDeduction)
- }
- }
-
- // Next Button
- binding.btnNext.setOnClickListener {
- if (validation()) {
-
- (activity as NiveshFdMainActivity).fdInvestmentDetails.FDAmount =
- binding.edtAmount.text.toString().toDouble()
- observerViewModel.data.value = binding.edtAmount.text.toString()
- (activity as NiveshFdMainActivity).fdInvestmentDetails.Frequency =
- binding.spInterestPayout.text.toString()
- (activity as NiveshFdMainActivity).fdInvestmentDetails.Tenure = tenure
- (activity as NiveshFdMainActivity).fdInvestmentDetails.Interest = interest
- (activity as NiveshFdMainActivity).fdInvestmentDetails.NiveshClientCode =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
- (activity as NiveshFdMainActivity).fdInvestmentDetails.Provider =
- getString(R.string.bajaj)
- (activity as NiveshFdMainActivity).fdInvestmentDetails.IPAddress = "192.168.1.23"
- (activity as NiveshFdMainActivity).fdInvestmentDetails.Device =
- getString(R.string.app)
- (activity as NiveshFdMainActivity).fdInvestmentDetails.Source =
- getString(R.string.source)
- if (binding.swSeniorCitizen.isChecked) {
- (activity as NiveshFdMainActivity).fdInvestmentDetails.CitizenType =
- getString(R.string.seniorCitizen)
- } else {
- (activity as NiveshFdMainActivity).fdInvestmentDetails.CitizenType =
- getString(R.string.nonSeniorCitizen)
- }
- (activity as NiveshFdMainActivity).fdInvestmentDetails.CustomerType = ""
- (activity as NiveshFdMainActivity).fdInvestmentDetails.CKYCNumber = ""
- (activity as NiveshFdMainActivity).fdInvestmentDetails.UniqueId =
- (activity as NiveshFdMainActivity).uniqueId
- (activity as NiveshFdMainActivity).fdInvestmentDetails.RenewOption = maturityText
-
- (activity as NiveshFdMainActivity).createFDApplicantRequest.FDInvestmentDetails =
- (activity as NiveshFdMainActivity).fdInvestmentDetails
- Log.e(
- "StepOneData",
- "-->" + Gson().toJson((activity as NiveshFdMainActivity).fdInvestmentDetails)
- )
- (activity as NiveshFdMainActivity).stepOneApi()
- }
- }
-
- minAmountApi()
- interestPayoutApi()
- }
-
- private fun interestPayoutApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.niveshCategory)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.getCode(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getCodeMutableData.observe(viewLifecycleOwner) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("interestPayoutApi", " response -->${response.data.toString()}")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- listOfFrequency = getCodeResponse.Response.GetCodesList
- if (listOfFrequency.isNotEmpty()) {
- val adapter = ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfFrequency
- )
- binding.spInterestPayout.setAdapter(adapter)
- binding.spInterestPayout.setText(
- adapter.getItem(listOfFrequency.size - 1)?.Value,
- false
- )
- binding.tvFrequency.text =
- adapter.getItem(listOfFrequency.size - 1)?.Value
- getRatesApi()
- } else {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "Interest Payout Frequency Data Is Missing."
- )
- }
- }
- 650 -> ""
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- }else{
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- Common.showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun minAmountApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.minAmountCategory)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.getMinAmount(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getMinAmountMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("minAmountApi ", " response-->${response.data.toString()}")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- listOfMinAmount = getCodeResponse.Response.GetCodesList
-// if (listOfMinAmount.isNotEmpty()) {
-// binding.txtMinAmount.text = getString(R.string.minAmount).plus(listOfMinAmount[0].Value)
-// }
- maxAmountApi()
- }
- 650 -> ""
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- }else{
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- Common.showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun maxAmountApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.MaxAmountCategory)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.getMaxAmount(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getMaxAmountMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("maxAmountApi ", " response-->${response.data.toString()}")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- listOfMaxAmount = getCodeResponse.Response.GetCodesList
- }
- 650 -> ""
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- }else{
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- Common.showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun setUpRecyclerView() {
-
- recyclerViewDropDownAdapter = HorizontalRecyclerViewAdapter(
- activity as NiveshFdMainActivity,
- listOfTenure
- ) { position ->
- tenure = listOfTenure[position].Tenure.toInt()
- interest = listOfTenure[position].ROI
- binding.tvROI.text = interest.toString().plus(" %")
- maturityAmountApi(tenure, interest)
- }
- val mLayoutManager: LayoutManager =
- LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, true)
- binding.rvTenure.layoutManager = mLayoutManager
- binding.rvTenure.setHasFixedSize(true)
- binding.rvTenure.itemAnimator = DefaultItemAnimator()
- binding.rvTenure.adapter = recyclerViewDropDownAdapter
- }
-
- private fun maturityAmountApi(tenure: Int, interest: Double) {
- if (binding.edtAmount.text.toString().length >= 4 && interest != 0.0 && tenure != 0 && binding.spInterestPayout.text.toString()
- .isNotEmpty()
- ) {
- val maturityAmountRequest = GetMaturityAmountRequest()
- maturityAmountRequest.FDProvider = getString(R.string.bajaj)
- maturityAmountRequest.FDAmount = binding.edtAmount.text.toString().toInt()
- maturityAmountRequest.Frequency = binding.spInterestPayout.text.toString()
- maturityAmountRequest.Tenure = tenure
- maturityAmountRequest.Interest = interest
- (activity as NiveshFdMainActivity).viewModel.getMaturityAmount(
- maturityAmountRequest,
- activity as NiveshFdMainActivity,
- PreferenceManager(activity as NiveshFdMainActivity).getToken()
- )
- (activity as NiveshFdMainActivity).viewModel.getMaturityAmountMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("maturityAmountApi ", " response-->${response.data.toString()}")
- val getMaturityAmountResponse =
- Gson().fromJson(
- response.data?.toString(),
- GetCalculateMaturityAmountResponse::class.java
- )
- getMaturityAmountResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- binding.tvMaturityAmount.text =
- getString(R.string.rs).plus(" ").plus(
- getMaturityAmountResponse.Response.MaturityAmount.toString()
- )
- }
- // 650 -> refreshToken()
- else -> {
- if (getMaturityAmountResponse.Response.Errors.isNotEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- getMaturityAmountResponse.Response.Errors[0].ErrorMessage
- )
- }else{
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getMaturityAmountResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- message
- )
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
- }
-
- private fun validation(): Boolean {
- return if (binding.edtAmount.text.toString().isEmpty()) {
- commonErrorMethod(
- binding.edtAmount,
- binding.tlDepositAmount,
- getString(R.string.emptyAmount)
- )
- } else if (binding.edtAmount.text.toString()
- .toDouble() < listOfMinAmount[0].Value.toDouble()
- ) {
- commonErrorMethod(
- binding.edtAmount,
- binding.tlDepositAmount,
- getString(R.string.validMinAmount)
- )
- } else if (binding.edtAmount.text.toString().toInt() % 1000 != 0) {
- commonErrorMethod(
- binding.edtAmount,
- binding.tlDepositAmount,
- getString(R.string.validMultipleAmount)
- )
- } else if (binding.edtAmount.text.toString()
- .toDouble() > listOfMaxAmount[0].Value.toDouble()
- ) {
- commonErrorMethod(
- binding.edtAmount,
- binding.tlDepositAmount,
- getString(R.string.validMaxAmount)
- )
- } else if (binding.spInterestPayout.text.isEmpty()) {
- Common.commonSpinnerErrorMethod(
- binding.spInterestPayout,
- binding.tlInterestPayout,
- getString(R.string.emptyInterestPayout)
- )
- } else if (binding.spTenure.text.isEmpty()) {
- Common.commonSpinnerErrorMethod(
- binding.spTenure,
- binding.tlInterestTenure,
- getString(R.string.emptyInterestTenure)
- )
- } else {
- true
- }
- }
-
- private fun getRatesApi() {
- val getRatesRequest = GetRatesRequest()
- getRatesRequest.fdProvider = getString(R.string.bajaj)
- getRatesRequest.frequency = binding.spInterestPayout.text.toString()
- if (binding.swSeniorCitizen.isChecked) {
- getRatesRequest.type = getString(R.string.seniorCitizen)
- } else {
- getRatesRequest.type = getString(R.string.nonSeniorCitizen)
- }
- (activity as NiveshFdMainActivity).viewModel.getRates(
- getRatesRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getRatesMutableData.observe(viewLifecycleOwner) { response ->
- when (response) {
- is Resource.Success -> {
- val getRatesResponse: GetRatesResponse =
- Gson().fromJson(response.data?.toString(), GetRatesResponse::class.java)
- getRatesResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- if (listOfTenure.isNotEmpty()) {
- listOfTenure.clear()
- }
- listOfTenure = getRatesResponse.Response.ROIDatalist
- // Tenure
- if (listOfTenure.isNotEmpty()) {
- listOfTenure.sortWith { lhs: ROIDataList, rhs: ROIDataList ->
- rhs.Tenure.compareTo(
- lhs.Tenure
- )
- }
- binding.ORLayout.visibility = View.VISIBLE
- val tenureAdapter =
- ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfTenure
- )
- binding.spTenure.setAdapter(tenureAdapter)
-
- binding.spTenure.setText(
- tenureAdapter.getItem(0)?.Tenure.plus(
- " Months | "
- ).plus(tenureAdapter.getItem(0)?.ROI).plus(" %"), false
- )
- tenure = tenureAdapter.getItem(0)?.Tenure.toString().toInt()
- interest = tenureAdapter.getItem(0)?.ROI ?: 0.0
- binding.tvROI.text =
- tenureAdapter.getItem(0)?.ROI.toString().plus(" %")
- setUpRecyclerView()
- } else {
- binding.ORLayout.visibility = View.GONE
- }
- }
- // 650 -> refreshToken()
- else -> {
- if (getRatesResponse.Response.Errors.isNotEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- getRatesResponse.Response.Errors[0].ErrorMessage
- )
- }else{
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getRatesResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- Common.showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- override fun onDestroyView() {
- super.onDestroyView()
- _binding = null
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepThreeNiveshFDFragment.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepThreeNiveshFDFragment.kt
deleted file mode 100644
index 978252b..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepThreeNiveshFDFragment.kt
+++ /dev/null
@@ -1,725 +0,0 @@
-package com.nivesh.production.niveshfd.fd.ui.fragment
-
-import android.Manifest
-import android.annotation.SuppressLint
-import android.app.Activity
-import android.content.DialogInterface
-import android.content.pm.PackageManager
-import android.database.Cursor
-import android.graphics.Bitmap
-import android.graphics.BitmapFactory
-import android.net.Uri
-import android.os.Build
-import android.os.Bundle
-import android.provider.OpenableColumns
-import android.util.Base64
-import android.util.Log
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.*
-import androidx.activity.result.ActivityResultLauncher
-import androidx.activity.result.contract.ActivityResultContracts
-import androidx.appcompat.app.AlertDialog
-import androidx.core.app.ActivityCompat
-import androidx.core.content.ContextCompat
-import androidx.core.content.FileProvider
-import androidx.fragment.app.Fragment
-import androidx.lifecycle.lifecycleScope
-import com.google.gson.Gson
-import com.nivesh.production.niveshfd.BuildConfig
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.databinding.FragmentNiveshfdStepThreeBinding
-import com.nivesh.production.niveshfd.fd.db.PreferenceManager
-import com.nivesh.production.niveshfd.fd.model.*
-import com.nivesh.production.niveshfd.fd.ui.activity.NiveshFdMainActivity
-import com.nivesh.production.niveshfd.fd.util.Common
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.getFileExtension
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.showDialogWithTwoButtons
-import com.nivesh.production.niveshfd.fd.util.ImageUtil
-import com.nivesh.production.niveshfd.fd.util.Resource
-import java.io.*
-import java.util.*
-
-
-class StepThreeNiveshFDFragment : Fragment() {
-
-// private var _binding: FragmentNiveshfdStepThreeBinding? = null
- private var _binding: FragmentNiveshfdStepThreeBinding? = null
- private val binding get() = _binding!!
-
- private var takeImageResult: ActivityResultLauncher? = null
- private var selectImageIntent: ActivityResultLauncher? = null
- private var bitmap: Bitmap? = null
- private var latestTmpUri: Uri? = null
-
- private val mapImage: HashMap = HashMap()
- private lateinit var listOfDocType: List
-
- private var panString: String = ""
- private var photoString: String = ""
- private var docString: String = ""
- private var docString2: String = ""
- private var panFileExt: String? = ""
- private var photoFileExt: String? = ""
- private var doc1FileExt: String? = ""
- private var doc2fileExt: String? = ""
- private var docValue: String = ""
- private val mainPANUpload: Int = 1
- private val mainPhotoUpload: Int = 2
- private val firstDocUpload: Int = 3
- private val secondDocUpload: Int = 4
- private var actionType: Int = -1
-
- private val permissions = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
- arrayOf(
- Manifest.permission.READ_EXTERNAL_STORAGE,
- Manifest.permission.WRITE_EXTERNAL_STORAGE,
- Manifest.permission.READ_MEDIA_IMAGES
- )
- } else {
- arrayOf(
- Manifest.permission.READ_EXTERNAL_STORAGE,
- Manifest.permission.WRITE_EXTERNAL_STORAGE
- )
- }
-
- private val requestCameraPermission = registerForActivityResult(
- ActivityResultContracts.RequestPermission()
- ) { isGranted: Boolean ->
- if (isGranted) {
- takeImage()
- } else {
- showDialogWithTwoButtons(
- (activity as NiveshFdMainActivity), getString(R.string.cameraPermission), getString(
- R.string.permissionRequired
- )
- )
- }
- }
-
- private val requestGalleryPermission = registerForActivityResult(
- ActivityResultContracts.RequestMultiplePermissions()
- ) { permission ->
- if (!permission.containsValue(false)) {
- selectImageIntent?.launch("image/*")
- } else {
- showDialogWithTwoButtons(
- (activity as NiveshFdMainActivity),
- getString(R.string.galleryPermission),
- getString(
- R.string.permissionsRequired
- )
- )
- }
- }
-
- override fun onCreateView(
- inflater: LayoutInflater, container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View {
-
- _binding = FragmentNiveshfdStepThreeBinding.inflate(inflater, container, false)
- return binding.root
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
-
- selectImageIntent = registerForActivityResult(ActivityResultContracts.GetContent())
- { uri: Uri? ->
- if (uri != null) {
- bitmap = uriToBitmap(uri)
- uploadDocument(uri, "g")
- }
- }
-
- takeImageResult =
- registerForActivityResult(ActivityResultContracts.TakePicture()) { isSuccess ->
- if (isSuccess) {
- latestTmpUri?.let { uri ->
- uploadDocument(uri, "c")
- }
- }
- }
-
- binding.btnNext.setOnClickListener {
- if (validate()) {
- if (panString.isNotEmpty()) {
- mapImage["PAN"] = "data:image/".plus(panFileExt)
- .plus(";base64, ").plus(panString)
- }
- if (photoString.isNotEmpty()) {
- mapImage["Photograph"] = "data:image/".plus(photoFileExt)
- .plus(";base64, ").plus(photoString)
- }
- if (docString.isNotEmpty()) {
- mapImage["docValue"] = "data:image/".plus(doc1FileExt)
- .plus(";base64, ").plus(docString)
- }
- if (docString2.isNotEmpty()) {
- mapImage["Aadhar"] = "data:image/".plus(doc2fileExt)
- .plus(";base64, ").plus(docString2)
- }
- var uploadPosition = 0
- for (entry in mapImage.iterator()) {
- uploadPosition++
- uploadDocApi(entry.key, entry.value, uploadPosition)
- }
- }
- }
- binding.btnBack.setOnClickListener {
- (activity as NiveshFdMainActivity).binding.viewPager.currentItem = 1
- }
-
- binding.btnPANUpload.setOnClickListener {
- actionType = mainPANUpload
- selectImage()
- }
-
- binding.btnPhotoUpload.setOnClickListener {
- actionType = mainPhotoUpload
- selectImage()
- }
-
- binding.btnAadhaarFrontUpload.setOnClickListener {
- actionType = firstDocUpload
- selectImage()
- }
-
- binding.btnAadhaarBackUpload.setOnClickListener {
- actionType = secondDocUpload
- selectImage()
- }
-
- binding.spDocType.onItemClickListener =
- AdapterView.OnItemClickListener { parent, _, position, _ ->
- val getCodes: GetCodes = parent.getItemAtPosition(position) as GetCodes
- docValue = getCodes.Value
- docString = ""
- docString2 = ""
- when (getCodes.Label) {
- resources.getString(R.string.aadhar) ->
- setAadhaarUploadLayout()
- else -> {
- setOtherUploadLayout(getCodes.Value)
- }
- }
- }
-
- docTypeApi()
- }
-
- @SuppressLint("Range")
- fun getFileName(uri: Uri): String {
- var result = ""
- if (uri.scheme == "content") {
- val cursor: Cursor =
- requireActivity().contentResolver.query(uri, null, null, null, null)!!
- cursor.use { cursor1 ->
- if (cursor1.moveToFirst()) {
- result = cursor1.getString(cursor1.getColumnIndex(OpenableColumns.DISPLAY_NAME))
- }
- }
- }
- if (result.isEmpty()) {
- result = uri.path!!
- val cut = result.lastIndexOf('/')
- if (cut != -1) {
- result = result.substring(cut + 1)
- }
- }
- return result
- }
-
- private fun selectImage() {
- val builder = AlertDialog.Builder(
- activity as NiveshFdMainActivity
- )
- builder.setTitle(getString(R.string.addPhoto))
- builder.setItems(
- arrayOf(
- getString(R.string.takePhoto),
- getString(R.string.chooseFromGallery),
- getString(R.string.cancel)
- )
- ) { dialog: DialogInterface, pos ->
- when (pos) {
- 0 -> {
- if (hasPermissions(
- activity as NiveshFdMainActivity,
- Manifest.permission.CAMERA
- )
- ) {
- takeImage()
- } else {
- onClickRequestPermission()
- }
- dialog.dismiss()
- }
- 1 -> {
- if (hasPermissions(activity as NiveshFdMainActivity, *permissions)) {
- selectImageIntent?.launch("image/*")
- } else {
- requestGalleryPermission.launch(permissions)
- }
- dialog.dismiss()
- }
- else -> {
- dialog.dismiss()
- }
- }
- }
- builder.show()
- }
-
- private fun hasPermissions(activity: Activity, vararg permissions: String?): Boolean {
- for (permission in permissions) {
- if (ActivityCompat.checkSelfPermission(
- activity,
- permission!!
- ) != PackageManager.PERMISSION_GRANTED
- ) {
- return false
- }
- }
- return true
- }
-
- private fun onClickRequestPermission() {
- when {
- ContextCompat.checkSelfPermission(
- activity as NiveshFdMainActivity,
- Manifest.permission.CAMERA
- ) == PackageManager.PERMISSION_GRANTED -> {
-
- }
-
- ActivityCompat.shouldShowRequestPermissionRationale(
- activity as NiveshFdMainActivity,
- Manifest.permission.CAMERA
- ) -> {
- requestCameraPermission.launch(
- Manifest.permission.CAMERA
- )
- }
-
- else -> {
- requestCameraPermission.launch(
- Manifest.permission.CAMERA
- )
- }
- }
- }
-
- private fun setOtherUploadLayout(itemName: String?) {
- binding.tvAadhaarFront.text = itemName.plus(" Front *")
- if (binding.tvAadhaarBack.visibility == View.VISIBLE) binding.tvAadhaarBack.visibility =
- View.INVISIBLE
- if (binding.btnAadhaarBackUpload.visibility == View.VISIBLE) binding.btnAadhaarBackUpload.visibility =
- View.INVISIBLE
- }
-
- private fun setAadhaarUploadLayout() {
- binding.tvAadhaarFront.text = resources.getString(R.string.aadhaarFront)
- binding.tvAadhaarBack.text = resources.getString(R.string.aadhaarBack)
-
- binding.tvAadhaarBack.visibility = View.VISIBLE
- binding.btnAadhaarBackUpload.visibility = View.VISIBLE
-
- binding.tvAadhaarFront.visibility = View.VISIBLE
- binding.btnAadhaarFrontUpload.visibility = View.VISIBLE
- }
-
- private fun uploadDocument(uri: Uri, type: String) {
- when (actionType) {
- mainPANUpload -> {
- binding.ivPan.visibility = View.VISIBLE
- val fileDir: File = requireActivity().cacheDir
- val fileExtension = File(fileDir.toString().plus("/").plus(getFileName(uri)))
- panFileExt = getFileExtension(getFileName(uri))
- val size: Double = Common.getFileSizeInMB(fileExtension.length())
- if (size < 5) {
- if (type == "c") encodedPANBase64(fileExtension)
- else panString = bitmap?.let { ImageUtil.convert(it) }.toString()
- } else {
- panString = ""
- panFileExt = ""
- }
- }
- mainPhotoUpload -> {
- binding.ivPhotograph.visibility = View.VISIBLE
- binding.ivPan.visibility = View.VISIBLE
- val fileDir: File = requireActivity().cacheDir
- val fileExtension = File(fileDir.toString().plus("/").plus(getFileName(uri)))
- photoFileExt = getFileExtension(getFileName(uri))
- val size: Double = Common.getFileSizeInMB(fileExtension.length())
- if (size < 5) {
- if (type == "c") encodedPhotoBase64(fileExtension)
- else photoString = bitmap?.let { ImageUtil.convert(it) }.toString()
- } else {
- photoString = ""
- photoFileExt = ""
- }
- }
- firstDocUpload -> {
- binding.ivAadharFront.visibility = View.VISIBLE
- val fileDir: File = requireActivity().cacheDir
- val fileExtension = File(fileDir.toString().plus("/").plus(getFileName(uri)))
- doc1FileExt = getFileExtension(getFileName(uri))
- val size: Double = Common.getFileSizeInMB(fileExtension.length())
- if (size < 5) {
- if (type == "c") encodedUpload1Base64(fileExtension)
- else docString = bitmap?.let { ImageUtil.convert(it) }.toString()
- } else {
- docString = ""
- doc1FileExt = ""
- }
- }
- else -> {
- binding.ivAadharBack.visibility = View.VISIBLE
- val fileDir: File = requireActivity().cacheDir
- val fileExtension = File(fileDir.toString().plus("/").plus(getFileName(uri)))
- doc2fileExt = getFileExtension(getFileName(uri))
- val size: Double = Common.getFileSizeInMB(fileExtension.length())
- if (size < 5) {
- if (type == "c") encodedFileToBase64(fileExtension)
- else docString2 = bitmap?.let { ImageUtil.convert(it) }.toString()
- } else {
- docString2 = ""
- doc2fileExt = ""
- }
- }
- }
- }
-
- private fun encodedPANBase64(fileName: File) {
- panString = try {
- val bytes: ByteArray = loadFile(fileName)
- Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "")
- .replace("\\s+", "")
- } catch (e: Exception) {
- e.printStackTrace()
- ""
- }
- }
-
- private fun encodedPhotoBase64(fileName: File) {
- photoString = try {
- val bytes: ByteArray = loadFile(fileName)
- Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "")
- .replace("\\s+", "")
- } catch (e: Exception) {
- e.printStackTrace()
- ""
- }
- }
-
- private fun encodedUpload1Base64(fileName: File) {
- docString = try {
- val bytes: ByteArray = loadFile(fileName)
- Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "")
- .replace("\\s+", "")
- } catch (e: Exception) {
- e.printStackTrace()
- ""
- }
- }
-
- private fun encodedFileToBase64(fileName: File) {
- docString2 = try {
- val bytes: ByteArray = loadFile(fileName)
- Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "")
- .replace("\\s+", "")
- } catch (e: Exception) {
- e.printStackTrace()
- ""
- }
- }
-
- @Throws(IOException::class)
- private fun loadFile(file: File): ByteArray {
- val inputStream: InputStream = FileInputStream(file)
- val length = file.length()
- val bytes = ByteArray(length.toInt())
- var offset = 0
- var numRead = 0
- while (offset < bytes.size && inputStream.read(bytes, offset, bytes.size - offset).also {
- numRead = it
- } >= 0) {
- offset += numRead
- }
- if (offset < bytes.size) {
- throw IOException("Could not completely read file " + file.name)
- }
- inputStream.close()
- return bytes
- }
-
- private fun uploadDocApi(key: String, imageBase64: String, uploadPosition: Int) {
- val du = DocumentUpload()
- du.Description = key
- du.DocumentType = key
- du.FDProvider = getString(R.string.bajaj)
- du.ImageEncodeToBase64 = imageBase64
- du.NiveshClientCode =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
- du.UniqueId = (activity as NiveshFdMainActivity).uniqueId
- (activity as NiveshFdMainActivity).viewModel.documentsUpload(
- du,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getDocumentUploadMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("UploadImage", "Response-->" + response.data.toString())
- val getUploadResponse: UploadResponse =
- Gson().fromJson(response.data?.toString(), UploadResponse::class.java)
- getUploadResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- Log.e("check_upload_res", response.message.toString())
- if (uploadPosition == mapImage.size) {
- Toast.makeText(
- requireActivity(),
- "Documents Uploaded Successfully",
- Toast.LENGTH_SHORT
- ).show()
- createFDApi((activity as NiveshFdMainActivity).createFDRequest)
- }
- }
- // 650 -> refreshToken()
- else -> {
- if (getUploadResponse.Response.Errors.isNotEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- getUploadResponse.Response.Errors[0].ErrorMessage
- )
- }else{
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getUploadResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- Common.showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun createFDApi(data: CreateFDRequest) {
- (activity as NiveshFdMainActivity).viewModel.createFDApi(
- data,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getFDResponseMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("createFDApi", "response--> " + response.data.toString())
- val createFDApplicationResponse: CreateFDApplicationResponse =
- Gson().fromJson(
- response.data?.toString(),
- CreateFDApplicationResponse::class.java
- )
- createFDApplicationResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- (activity as NiveshFdMainActivity).stepThreeApi()
- }
- // 650 -> refreshToken()
- else -> {
- if (createFDApplicationResponse.Response.Errors.isNotEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- createFDApplicationResponse.Response.Errors[0].ErrorMessage
- )
- }else{
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(createFDApplicationResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- Common.showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun docTypeApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.docType)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.docTypeApi(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getDocTypeMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("response", "-->$response")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- listOfDocType = getCodeResponse.Response.GetCodesList
- if (listOfDocType.isNotEmpty()) {
- val adapter = ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfDocType
- )
- binding.spDocType.setAdapter(adapter)
- binding.spDocType.setText(
- adapter.getItem(0)?.Label,
- false
- )
- setOtherUploadLayout(adapter.getItem(0)?.Label)
- docValue = adapter.getItem(0)?.Label.toString()
-
- }
- }
- // 650 -> refreshToken()
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- }else{
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- Common.showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
-
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun validate(): Boolean {
- if (panString.isEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- getString(R.string.uploadPanDoc)
- )
- return false
- } else if (photoString.isEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- getString(R.string.uploadPhotoDoc)
- )
- return false
- } else if (docString.isEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- "Upload $docValue Document"
- )
- return false
- } else if (docValue == "Aadhar" && docString2.isEmpty()) {
- Common.showDialogValidation(
- activity as NiveshFdMainActivity,
- getString(R.string.uploadAadharBackDoc)
- )
- return false
- }
- return true
- }
-
- private fun takeImage() {
- lifecycleScope.launchWhenStarted {
- getTmpFileUri().let { uri ->
- latestTmpUri = uri
- takeImageResult?.launch(uri)
- }
- }
- }
-
- private fun getTmpFileUri(): Uri {
- val tmpFile =
- File.createTempFile("tmp_image_file", ".png", (activity as NiveshFdMainActivity).cacheDir).apply {
- createNewFile()
- deleteOnExit()
- }
-
- return FileProvider.getUriForFile(
- requireActivity(),
- "${BuildConfig.APPLICATION_ID}.provider",
- tmpFile
- )
- }
-
- private fun uriToBitmap(selectedFileUri: Uri): Bitmap? {
- try {
- val parcelFileDescriptor =
- requireActivity().contentResolver.openFileDescriptor(selectedFileUri, "r")
- val fileDescriptor: FileDescriptor = parcelFileDescriptor!!.fileDescriptor
- val image = BitmapFactory.decodeFileDescriptor(fileDescriptor)
- parcelFileDescriptor.close()
- return image
- } catch (e: IOException) {
- e.printStackTrace()
- }
- return null
- }
-
- override fun onDestroyView() {
- super.onDestroyView()
- _binding = null
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepTwoNiveshFDFragment.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepTwoNiveshFDFragment.kt
deleted file mode 100644
index 39f1b92..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/fragment/StepTwoNiveshFDFragment.kt
+++ /dev/null
@@ -1,2224 +0,0 @@
-package com.nivesh.production.niveshfd.fd.ui.fragment
-
-import android.app.DatePickerDialog
-import android.app.Dialog
-import android.os.Bundle
-import android.text.Editable
-import android.text.InputFilter
-import android.text.InputFilter.LengthFilter
-import android.text.TextWatcher
-import android.util.DisplayMetrics
-import android.util.Log
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.view.WindowManager
-import android.widget.ArrayAdapter
-import android.widget.RadioButton
-import android.widget.TextView
-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
-import com.google.android.material.textfield.TextInputEditText
-import com.google.gson.Gson
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.databinding.FragmentNiveshfdStepTwoBinding
-import com.nivesh.production.niveshfd.fd.adapter.BankListAdapter
-import com.nivesh.production.niveshfd.fd.adapter.PaymentModeAdapter
-import com.nivesh.production.niveshfd.fd.adapter.RecommendedBankListAdapter
-import com.nivesh.production.niveshfd.fd.db.PreferenceManager
-import com.nivesh.production.niveshfd.fd.model.*
-import com.nivesh.production.niveshfd.fd.ui.activity.NiveshFdMainActivity
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.commonErrorAutoCompleteMethod
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.commonErrorMethod
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.commonSpinnerErrorMethod
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.getDate
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.isIndianMobileNo
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.isMinor
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.isValidEmail
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.isValidIndividualPan
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.isValidName
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.isValidPan
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.removeError
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.showDialogValidation
-import com.nivesh.production.niveshfd.fd.util.ProgressUtil
-import com.nivesh.production.niveshfd.fd.util.Resource
-import com.nivesh.production.niveshfd.fd.viewModel.MyObseravble
-import java.util.*
-
-
-class StepTwoNiveshFDFragment : Fragment() {
-
- private var _binding: FragmentNiveshfdStepTwoBinding? = null
- private val binding get() = _binding!!
-
- private val observerViewModel: MyObseravble by activityViewModels()
- private lateinit var listOfTitle: List
- private lateinit var listOfGender: List
- private lateinit var listOfAnnualIncome: List
- private lateinit var listOfRelationShip: List
- private lateinit var listOfMaritalStatus: List
- private lateinit var listOfOccupation: List
- private lateinit var listOfPayMode: List
- private lateinit var listOfStates: List
- private lateinit var listOfCities: List
- private lateinit var listOfIFSC: MutableList
- private lateinit var listOfEligibleBank: MutableList
-
- private lateinit var bankListAdapter: BankListAdapter
- private lateinit var paymentModeAdapter: PaymentModeAdapter
- private lateinit var stateObject: DataObject
- private val listOfBanks: MutableList = 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 = FragmentNiveshfdStepTwoBinding.inflate(inflater, container, false)
- return binding.root
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
- listOfTitle = ArrayList()
- listOfGender = ArrayList()
- listOfAnnualIncome = ArrayList()
- listOfRelationShip = ArrayList()
- listOfMaritalStatus = ArrayList()
- listOfOccupation = ArrayList()
- listOfStates = ArrayList()
- listOfIFSC = ArrayList()
- listOfPayMode = ArrayList()
- stateObject = DataObject()
- listOfEligibleBank = ArrayList()
- rbPaymentMode = RadioButton(activity as NiveshFdMainActivity)
- rbBank = RadioButton(activity as NiveshFdMainActivity)
-
- // Personal Details
- binding.edtMobileNumber.filters = arrayOf(LengthFilter(10))
- binding.edtPANNumber.filters = arrayOf(LengthFilter(10))
- binding.edtPinCode.filters = arrayOf(LengthFilter(6))
- binding.edtIFSC.filters = arrayOf(LengthFilter(11))
-
- binding.edtMobileNumber.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.tlMobileNumber)
- }
- })
- binding.edtMobileNumber.setText((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.mobile)
- binding.edtMobileNumber.setSelection(binding.edtMobileNumber.text.toString().length)
- // create an OnDateSetListener
- if (!(activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_DOB.isNullOrEmpty()) {
- binding.edtDOB.setText(getDate((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_DOB.toString()))
- }
- binding.edtDOB.setOnClickListener {
- removeError(binding.tlDOB)
- datePicker(binding.edtDOB, 1)
- }
-
-
- binding.edtPANNumber.setText((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_PAN)
- binding.edtPANNumber.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.tlPanNumber)
- if (s.toString().trim().length == 10) {
- checkFDCKYCApi()
- }
- }
- })
-
- binding.spTitle.setOnItemClickListener { _, _, _, _ ->
- removeError(binding.tlTitle)
- }
-
- binding.edtFirstName.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.tlFirstName)
- }
- })
- binding.edtMiddleName.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.tlMiddleName)
- }
- })
- binding.edtLastName.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.tlLastName)
- }
- })
-
- val splitStringName =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_APPNAME1?.split(
- "\\s".toRegex()
- )?.toTypedArray()
- when (splitStringName?.size) {
- 1 -> {
- binding.edtFirstName.setText(splitStringName[0])
- }
- 2 -> {
- binding.edtFirstName.setText(splitStringName[0])
- binding.edtLastName.setText(splitStringName[1])
- }
- 3 -> {
- binding.edtFirstName.setText(splitStringName[0])
- binding.edtMiddleName.setText(splitStringName[1])
- binding.edtLastName.setText(splitStringName[2])
- }
- }
-
- binding.spGender.setOnItemClickListener { _, _, _, _ ->
- removeError(binding.tlGender)
- }
-
- binding.edtEmail.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.tlEmail)
- }
- })
- binding.edtEmail.setText((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_EMAIL)
-
- binding.spOccupation.setOnItemClickListener { _, _, _, _ ->
- removeError(binding.tlOccupation)
- }
-
- binding.edtQualification.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.tlQualification)
- }
- })
-
- binding.spMarital.setOnItemClickListener { _, _, _, _ ->
- removeError(binding.tlMarital)
- }
-
- binding.edtAddressLine1.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.tlAddressLine1)
- }
- })
- binding.edtAddressLine1.setText((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_ADD1)
- binding.edtAddressLine2.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.tlAddressLine2)
- }
- })
- binding.edtAddressLine2.setText((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_ADD2)
- binding.edtAddressLine3.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.tlAddressLine3)
- }
- })
- binding.edtAddressLine3.setText((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_ADD3)
-
- binding.spState.setOnItemClickListener { parent, _, position, _ ->
- removeError(binding.tlState)
- stateObject = parent.getItemAtPosition(position) as DataObject
- }
- binding.spCity.setOnItemClickListener { _, _, _, _ ->
- removeError(binding.tlCity)
- }
- binding.edtPinCode.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.tlPinCode)
- }
- })
- binding.edtPinCode.setText((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_PINCODE)
-
- // Nominee Details
- binding.spNomineeTitle.setOnItemClickListener { _, _, _, _ ->
- binding.tlNomineeTitle.error = null
- }
-
- binding.edtNomineeFirstName.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.tlNomineeFirstName)
- }
- })
- binding.edtNomineeMiddleName.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.tlNomineeMiddleName)
- }
- })
- binding.edtNomineeLastName.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.tlNomineeLastName)
- }
- })
-
- val splitNomineeName =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Nominees?.get(
- 0
- )?.NomineeName?.split(
- "\\s".toRegex()
- )?.toTypedArray()
- when (splitNomineeName?.size) {
- 1 -> {
- binding.edtNomineeFirstName.setText(splitNomineeName[0])
- }
- 2 -> {
- binding.edtNomineeFirstName.setText(splitNomineeName[0])
- binding.edtNomineeLastName.setText(splitNomineeName[1])
- }
- 3 -> {
- binding.edtNomineeFirstName.setText(splitNomineeName[0])
- binding.edtNomineeMiddleName.setText(splitNomineeName[1])
- binding.edtNomineeLastName.setText(splitNomineeName[2])
- }
- }
-
- if (!(activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Nominees?.get(
- 0
- )?.NomineeDOB.isNullOrEmpty()
- ) {
- binding.edtNomineeDOB.setText(
- getDate(
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Nominees?.get(
- 0
- )?.NomineeDOB.toString()
- )
- )
- }
- binding.edtNomineeDOB.setOnClickListener {
- removeError(binding.tlNomineeDOB)
- datePicker(binding.edtNomineeDOB, 2)
- }
-
- binding.spNomineeRelation.setText(
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Nominees?.get(
- 0
- )?.NomineeRelationship
- )
- binding.spNomineeRelation.setOnItemClickListener { _, _, _, _ ->
- removeError(binding.tlNomineeRelation)
- }
-
- // Guardian Details
- binding.edtGuardianName.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.tlGuardianName)
- }
- })
- binding.edtGuardianName.setText(
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Nominees?.get(
- 0
- )?.NomineeGuardian
- )
-
- binding.edtGuardianAge.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.tlGuardianAge)
- }
- })
-
- binding.spGuardianRelation.setOnItemClickListener { _, _, _, _ ->
- removeError(binding.tlGuardianRelation)
- }
-
- binding.edtGuardianAddress.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.tlGuardianAddress)
- }
- })
- binding.edtGuardianPinCode.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.tlGuardianPinCode)
- }
- })
-
- rbBank.setText(getString(R.string.savingsAccount))
- binding.rgBank.setOnCheckedChangeListener { group, checkedId ->
- rbBank = group.findViewById(checkedId)
- Log.e("BankType", "-->" + rbBank.text)
- }
-
-
- // Bank Details
- binding.edtIFSC.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.tlIFSC)
- ifscCodeCheckApi(s.toString())
- }
- })
- binding.edtAccountNumber.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.tlAccountNumber)
- }
- })
- binding.edtBankName.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.tlBankName)
- }
- })
- binding.edtBankBranch.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.tlBankBranchName)
- }
- })
-
- binding.btnAddBank.setOnClickListener {
- if (validateBank()) {
- verifyAccountNo(
- binding.edtAccountNumber.text.toString(),
- binding.edtIFSC.text.toString(),
- binding.edtFirstName.text.toString().plus(" ")
- .plus(binding.edtMiddleName.text.toString()).plus(" ")
- .plus(binding.edtLastName.text.toString()),
- binding.edtMobileNumber.text.toString(),
- PreferenceManager(activity as NiveshFdMainActivity).getLoginRole(),
- rbBank.text.toString()
- )
- }
- }
-
- binding.tvEligibleBankOption.setOnClickListener {
- // apiForEligibleBankList()
- if (listOfEligibleBank.isNotEmpty()) {
- dialogForBankList(listOfEligibleBank)
- }
- }
-
- if ((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.ClientBanklist?.isEmpty()!!) {
- binding.llBankDetails.visibility = View.VISIBLE
- } else {
- binding.llBankDetails.visibility = View.GONE
- }
-
- binding.addBankDetail.setOnClickListener {
- if (bankListAdapter.itemCount == 5) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getString(R.string.fiveAccountValidation)
- )
- } else {
- showHideBankDetail()
- }
- }
-
- titleApi()
- apiForEligibleBankList()
- setUpRecyclerView(
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.ClientBanklist,
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_ACCNO1
- )
-
- binding.tvPersonalDetails.setOnClickListener {
- if (binding.llPersonalDetail.visibility == View.VISIBLE) {
- binding.llPersonalDetail.visibility = View.GONE
- } else {
- binding.llPersonalDetail.visibility = View.VISIBLE
- }
- }
- binding.tvNomineeDetails.setOnClickListener {
- if (binding.llNomineeDetail.visibility == View.VISIBLE) {
- binding.llNomineeDetail.visibility = View.GONE
- } else {
- binding.llNomineeDetail.visibility = View.VISIBLE
- }
- }
- binding.tvBankDetails.setOnClickListener {
- if (binding.llBank.visibility == View.VISIBLE) {
- binding.llBank.visibility = View.GONE
- } else {
- binding.llBank.visibility = View.VISIBLE
- }
- }
-
- binding.btnNext.setOnClickListener {
- if (validation()) {
- // Applicant Details
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantSalutation =
- binding.spTitle.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantGender =
- binding.spGender.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantFirstName =
- binding.edtFirstName.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantMiddleName =
- binding.edtMiddleName.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantLastName =
- binding.edtLastName.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantDOB =
- binding.edtDOB.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantPAN =
- binding.edtPANNumber.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantMobile =
- binding.edtMobileNumber.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantOccupation =
- binding.spOccupation.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantQualification =
- binding.edtQualification.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantMaritalStatus =
- binding.spMarital.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantEmail =
- binding.edtEmail.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantAddress1 =
- binding.edtAddressLine1.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantAddress2 =
- binding.edtAddressLine2.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantAddress3 =
- binding.edtAddressLine3.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantCity =
- binding.spCity.text.toString()
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantState =
- stateObject.State_Code
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantCountry = "India"
- (activity as NiveshFdMainActivity).applicantDetails.ApplicantPincode =
- binding.edtPinCode.text.toString().toInt()
- (activity as NiveshFdMainActivity).applicantDetails.AnnualIncome =
- binding.spIncome.text.toString()
-
- // Applicant Relation Details
- (activity as NiveshFdMainActivity).applicantRelationDetails.ApplicantRelation = ""
- (activity as NiveshFdMainActivity).applicantRelationDetails.ApplicantRelationSalutation =
- ""
- (activity as NiveshFdMainActivity).applicantRelationDetails.ApplicantRelationFirstName =
- ""
- (activity as NiveshFdMainActivity).applicantRelationDetails.ApplicantRelationLastName =
- ""
- (activity as NiveshFdMainActivity).applicantRelationDetails.ApplicantMotherFirstName =
- ""
- (activity as NiveshFdMainActivity).applicantRelationDetails.ApplicantMotherLastName =
- ""
-
- // Applicant Nominee Details
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeSalutation =
- binding.spNomineeTitle.text.toString()
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeGender =
- binding.spGender.text.toString()
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeFirstName =
- binding.edtNomineeFirstName.text.toString()
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeMiddleName =
- binding.edtNomineeMiddleName.text.toString()
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeLastName =
- binding.edtNomineeLastName.text.toString()
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeDOB =
- binding.edtNomineeDOB.text.toString()
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeRelation =
- binding.spNomineeRelation.text.toString()
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeAddress1 = ""
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeAddress2 = ""
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeAddress3 = ""
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeCity = ""
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeState = ""
- (activity as NiveshFdMainActivity).nomineeDetails.NomineeCountry = "India"
- (activity as NiveshFdMainActivity).nomineeDetails.NomineePincode = 0
-
- // Applicant Nominee Guardian Details
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianSalutation =
- binding.spGuardianRelation.text.toString()
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianName =
- binding.edtGuardianName.text.toString()
- if (binding.edtGuardianAge.text.toString().isEmpty()) {
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianAge = 0
- } else {
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianAge =
- binding.edtGuardianAge.text.toString().toInt()
- }
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianCountry = "India"
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianCity = ""
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianState = ""
- if (binding.edtGuardianPinCode.text.toString().isEmpty()) {
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianPincode = 0
- } else {
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianPincode =
- binding.edtGuardianPinCode.text.toString().toInt()
- }
-
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianAddress1 =
- binding.edtGuardianAddress.text.toString()
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianAddress2 = ""
- (activity as NiveshFdMainActivity).nomineeGuardianDetails.GuardianAddress3 = ""
-
- // Applicant Bank Details
- (activity as NiveshFdMainActivity).fdBankDetails.AccountType =
- bankListAdapter.getSelected()?.AccountType
- (activity as NiveshFdMainActivity).fdBankDetails.BankBranch =
- bankListAdapter.getSelected()?.BranchName
- (activity as NiveshFdMainActivity).fdBankDetails.IFSCCode =
- bankListAdapter.getSelected()?.IFSCCode
- (activity as NiveshFdMainActivity).fdBankDetails.AccountNumber =
- bankListAdapter.getSelected()?.AccountNumber
- (activity as NiveshFdMainActivity).fdBankDetails.BankName = eligibleBank()
- (activity as NiveshFdMainActivity).fdBankDetails.PaymentMode =
- paymentModeAdapter.getSelected()?.Value
-
- (activity as NiveshFdMainActivity).createFDApplicantRequest.ApplicantDetails =
- (activity as NiveshFdMainActivity).applicantDetails
- (activity as NiveshFdMainActivity).createFDApplicantRequest.ApplicantRelationDetails =
- (activity as NiveshFdMainActivity).applicantRelationDetails
- (activity as NiveshFdMainActivity).createFDApplicantRequest.FdBankDetails =
- (activity as NiveshFdMainActivity).fdBankDetails
- (activity as NiveshFdMainActivity).createFDApplicantRequest.NomineeDetails =
- (activity as NiveshFdMainActivity).nomineeDetails
- (activity as NiveshFdMainActivity).createFDApplicantRequest.NomineeGuardianDetails =
- (activity as NiveshFdMainActivity).nomineeGuardianDetails
-
-
- (activity as NiveshFdMainActivity).createFDRequest.CreateFDApplicationRequest =
- (activity as NiveshFdMainActivity).createFDApplicantRequest
- Log.e(
- "StepTwoResponse",
- "-->" + Gson().toJson((activity as NiveshFdMainActivity).createFDRequest)
- )
- createFDApi((activity as NiveshFdMainActivity).createFDRequest)
- }
- }
-
- binding.btnBack.setOnClickListener {
- (activity as NiveshFdMainActivity).binding.viewPager.currentItem = 0
- }
-
- }
-
- private fun eligibleBank(): String {
- val enterIfsc = bankListAdapter.getSelected()?.IFSCCode?.substring(0, 4)
- for (bankList in listOfEligibleBank) {
- if (enterIfsc.equals(bankList.IFSCInitials)) {
- return bankList.BankName
- }
- }
- return ""
- }
-
- private fun checkFDCKYCApi() {
- if ((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CM_MOBILE?.isNotEmpty()!! && (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_DOB?.isNotEmpty()!! && binding.edtPANNumber.text.toString()
- .isNotEmpty() && (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE?.isNotEmpty()!!
- ) {
- val checkFDKYCRequest = CheckFDKYCRequest()
- checkFDKYCRequest.Mobile = binding.edtMobileNumber.text.toString()
- checkFDKYCRequest.DOB = binding.edtDOB.text.toString()
- checkFDKYCRequest.PAN = binding.edtPANNumber.text.toString()
- checkFDKYCRequest.NiveshClientCode =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE.toString()
- (activity as NiveshFdMainActivity).viewModel.checkFDKYC(
- checkFDKYCRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getFDKYCMutableData.observe(this) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("response", "-->${response.data.toString()}")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(
- response.data?.toString(),
- GetCodeResponse::class.java
- )
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- // fdInvestmentDetails.CustomerType = ""
- }
- 650 -> ""
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
- }
-
- private fun createFDApi(data: CreateFDRequest) {
- ProgressUtil.showLoading(activity as NiveshFdMainActivity)
- (activity as NiveshFdMainActivity).viewModel.createFDApi(
- data,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getFDResponseMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("createFDApi ", " response -->$response")
- val createFDApplicationResponse: CreateFDApplicationResponse =
- Gson().fromJson(
- response.data?.toString(),
- CreateFDApplicationResponse::class.java
- )
- createFDApplicationResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- (activity as NiveshFdMainActivity).uniqueId =
- createFDApplicationResponse.Response.FDCreationDetailsResponse.UniqueId
- (activity as NiveshFdMainActivity).stepTwoApi()
-
- }
- // 650 -> refreshToken()
- else -> {
- if (createFDApplicationResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- createFDApplicationResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(createFDApplicationResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
- ProgressUtil.hideLoading()
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun ifscCodeCheckApi(ifsc: String) {
- if (ifsc.length >= 10) {
- (activity as NiveshFdMainActivity).viewModel.ifscCodeApi(
- ifsc,
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getIfscCodeCheckMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("ifscCodeCheckApi ", " response -->$response")
- val getIFSCCodeListResponse =
- Gson().fromJson(
- response.data?.toString(),
- GetIFSCCodeListResponse::class.java
- )
- getIFSCCodeListResponse.Response.status_code.let { code ->
- when (code) {
- 200 -> {
- if (listOfIFSC.size > 0) {
- listOfIFSC.clear()
- }
- listOfIFSC = getIFSCCodeListResponse.IFSCCodes
- if (listOfIFSC.size > 0) {
- val adapter = ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfIFSC
- )
- binding.edtIFSC.setAdapter(adapter)
- binding.edtIFSC.setOnItemClickListener { _, _, position, _ ->
- if (listOfIFSC.size > 0) {
- binding.edtIFSC.setText(
- adapter.getItem(position).toString()
- )
- binding.edtIFSC.setSelection(binding.edtIFSC.text.toString().length)
- getIFSCDetailsApi(binding.edtIFSC.text.toString())
- }
- }
- }
- }
- // 650 -> refreshToken()
- else -> {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getIFSCCodeListResponse.Response.message
- )
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(
- activity as NiveshFdMainActivity,
- message
- )
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
- }
-
- private fun getIFSCDetailsApi(ifscCode: String) {
-
- (activity as NiveshFdMainActivity).viewModel.ifscCodeDetailsApi(
- ifscCode,
- activity as NiveshFdMainActivity,
- PreferenceManager(activity as NiveshFdMainActivity).getToken()
- )
- (activity as NiveshFdMainActivity).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
- )
- binding.edtBankName.setText(getIFSCCodeResponse.IFSCCODEServiceResult[0].BnkDescr)
- binding.edtBankName.setSelection(binding.edtBankName.text.toString().length)
- binding.edtBankBranch.setText(getIFSCCodeResponse.IFSCCODEServiceResult[0].BankBranch)
- binding.edtBankBranch.setSelection(binding.edtBankBranch.text.toString().length)
- }
- }
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
-
- }
-
- }
- }
-
- private fun verifyAccountNo(
- bankAccount: String,
- Ifsc: String,
- name: String,
- phoneNumber: String,
- loginRole: Int,
- accountType: String
- ) {
-
- val bankValidationApiRequest = BankValidationApiRequest()
- bankValidationApiRequest.BankAccountNo = bankAccount
- bankValidationApiRequest.IFSC = Ifsc
- bankValidationApiRequest.Name = name
- bankValidationApiRequest.PhoneNo = phoneNumber
- bankValidationApiRequest.RoleId = loginRole
- bankValidationApiRequest.BankNo = 1
- ProgressUtil.showLoading(activity as NiveshFdMainActivity)
- (activity as NiveshFdMainActivity).viewModel.bankValidationApi(
- bankValidationApiRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.bankValidationApiMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("verifyAccountNo ", " response -->$response")
- val getBankValidationApiResponse =
- Gson().fromJson(
- response.data?.toString(),
- BankValidationApiResponse::class.java
- )
- getBankValidationApiResponse.response.status_code.let { code ->
- if (binding.tvAcVerify.visibility == View.GONE) {
- binding.tvAcVerify.visibility = View.VISIBLE
- }
- when (code) {
- 200 -> {
- if (getBankValidationApiResponse.Message == getString(R.string.accountVerified) || getBankValidationApiResponse.Message == getString(
- R.string.accountVerified1
- )
- ) {
- val clientBankList = ClientBanklist()
- clientBankList.AccountNumber = bankAccount
- clientBankList.AccountType = accountType
- clientBankList.BankName =
- binding.edtBankName.text.toString()
- clientBankList.BranchName =
- binding.edtBankBranch.text.toString()
- clientBankList.IFSCCode = Ifsc
- clientBankList.IsValBank = 1
- listOfBanks.clear()
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.ClientBanklist?.let {
- listOfBanks.addAll(
- it
- )
- }
- listOfBanks.add(clientBankList)
- setUpRecyclerView(
- listOfBanks,
- clientBankList.AccountNumber.toString()
- )
- binding.llBankDetails.visibility = View.GONE
- binding.addBankDetail.setCompoundDrawablesWithIntrinsicBounds(
- 0,
- 0,
- R.drawable.ic_add_icon,
- 0
- )
- binding.edtAccountNumber.setText("")
- binding.edtIFSC.setText("")
- binding.edtBankName.setText("")
- binding.edtBankBranch.setText("")
-
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getBankValidationApiResponse.Message
- )
- }
- }
- else -> {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getBankValidationApiResponse.Message
- )
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
- ProgressUtil.hideLoading()
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun validateBank(): Boolean {
- return if (binding.edtIFSC.text.toString().isEmpty()) { // EditText
- commonErrorAutoCompleteMethod(
- binding.edtIFSC,
- binding.tlIFSC,
- getString(R.string.emptyIFSCCode)
- )
- } else if (binding.edtIFSC.text.toString().length != 11) { // EditText
- commonErrorAutoCompleteMethod(
- binding.edtIFSC,
- binding.tlIFSC,
- getString(R.string.validIFSCCode)
- )
- } else if (binding.edtAccountNumber.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtAccountNumber,
- binding.tlAccountNumber,
- getString(R.string.emptyAccNo)
- )
- } else if (binding.edtBankName.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtBankName,
- binding.tlBankName,
- getString(R.string.emptyBankName)
- )
- } else if (binding.edtBankBranch.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtBankBranch,
- binding.tlBankBranchName,
- getString(R.string.emptyBranchName)
- )
- } else {
- return true
- }
- }
-
- private fun setUpRecyclerView(
- bankList: List?,
- selectedAccount: String? = null
- ) {
- val displayMetrics = DisplayMetrics()
- requireActivity().windowManager.defaultDisplay.getMetrics(displayMetrics)
- val width = displayMetrics.widthPixels.toDouble()
- binding.rvClientBankList.layoutManager = LinearLayoutManager(
- activity as NiveshFdMainActivity,
- LinearLayoutManager.HORIZONTAL,
- false
- )
- bankListAdapter = BankListAdapter(bankList, selectedAccount, width)
- binding.rvClientBankList.adapter = bankListAdapter
- }
-
- private fun datePicker(edtDOB: TextInputEditText, number: Int) {
- val year = cal.get(Calendar.YEAR)
- val month = cal.get(Calendar.MONTH)
- val day = cal.get(Calendar.DAY_OF_MONTH)
- val datePickerDialog = DatePickerDialog(
- activity as NiveshFdMainActivity, { _, years, monthOfYear, dayOfMonth ->
- if (monthOfYear.toString().length == 1) {
- "0".plus(monthOfYear)
- }
- edtDOB.setText(
- years.toString().plus("-").plus(monthOfYear + 1).plus("-")
- .plus(dayOfMonth.toString())
- )
- edtDOB.setSelection(edtDOB.text.toString().length)
- if (number == 2) {
- if (isMinor(
- years.toString().plus("-").plus(monthOfYear + 1).plus("-")
- .plus(dayOfMonth.toString())
- )
- ) {
- guardianCodeVisibility(View.VISIBLE)
- } else {
- guardianCodeVisibility(View.GONE)
- }
- }
- }, year, month, day
- )
- datePickerDialog.datePicker.maxDate = cal.timeInMillis
- val c = Calendar.getInstance()
- c.add(Calendar.YEAR, -140)
- datePickerDialog.datePicker.minDate = c.timeInMillis
- datePickerDialog.show()
- }
-
- private fun guardianCodeVisibility(visibility: Int) {
- binding.tlGuardianName.visibility = visibility
- binding.tlGuardianAddress.visibility = visibility
- binding.tlGuardianAge.visibility = visibility
- binding.tlGuardianPinCode.visibility = visibility
- binding.tlGuardianRelation.visibility = visibility
-
- }
-
- private fun titleApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.salutationCategory)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.titleApi(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getTitleMutableData.observe(viewLifecycleOwner) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("titleApi ", " response -->$response")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- listOfTitle = getCodeResponse.Response.GetCodesList
- if (listOfTitle.isNotEmpty()) {
- val adapter = ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfTitle
- )
- binding.spTitle.setAdapter(adapter)
-
- val titleText =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.Client_Title
- val newTitleText = "$titleText."
-
- if (titleText.isNullOrEmpty()) {
- binding.spTitle.setText(
- adapter.getItem(0)?.Value,
- false
- )
- } else {
- for (title in listOfTitle) {
- if (title.Value == newTitleText) {
- binding.spTitle.setText(title.Value, false)
- break
- }
- }
- }
- binding.spNomineeTitle.setAdapter(adapter)
- binding.spNomineeTitle.setText(
- adapter.getItem(0)?.Value,
- false
- )
- }
- genderApi()
- relationShipApi()
- maritalStatusApi()
- occupationApi()
- annualIncomeApi()
- stateListApi()
- paymentModeApi()
-
- }
- // 650 -> refreshToken()
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun paymentModeApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.paymentModeCategory)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.paymentModeApi(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getPaymentModeMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("paymentModeApi ", " response -->$response")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- if (getCodeResponse.Response.GetCodesList.isNotEmpty()) {
- listOfPayMode = getCodeResponse.Response.GetCodesList
- setUpRecyclerViewPaymentMode(listOfPayMode as MutableList)
- }
- }
- // 650 -> refreshToken()
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun setUpRecyclerViewPaymentMode(listOfPayMode: MutableList) {
-
- observerViewModel.data.observe(viewLifecycleOwner) {
- val tempList = mutableListOf()
- 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)
- paymentModeAdapter = PaymentModeAdapter(
- listOfPayMode,
- listOfPayMode[0].Value
- )
- binding.rvPaymentMode.adapter = paymentModeAdapter
- }
-
- private fun genderApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.genderCategory)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.genderApi(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getGenderMutableData.observe(viewLifecycleOwner) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("genderApi ", " response -->$response")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- listOfGender = getCodeResponse.Response.GetCodesList
- if (listOfGender.isNotEmpty()) {
- val adapter = ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfGender
- )
- binding.spGender.setAdapter(adapter)
- binding.spGender.setText(
- adapter.getItem(0)?.Value,
- false
- )
- }
- }
- // 650 -> refreshToken()
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun relationShipApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.relationshipCategory)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.relationShipApi(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getRelationShipMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("relationShipApi ", " response -->$response")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- listOfRelationShip = getCodeResponse.Response.GetCodesList
- if (listOfGender.isNotEmpty()) {
- val adapter = ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfRelationShip
- )
- binding.spNomineeRelation.setAdapter(adapter)
-
- 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)?.Label,
- false
- )
- }
- }
- // 650 -> refreshToken()
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
-
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun maritalStatusApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.maritalCategory)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.maritalStatusApi(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getMaritalStatusMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("maritalStatusApi ", " response -->$response")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- listOfMaritalStatus = getCodeResponse.Response.GetCodesList
- if (listOfMaritalStatus.isNotEmpty()) {
- val adapter = ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfMaritalStatus
- )
- binding.spMarital.setAdapter(adapter)
- binding.spMarital.setText(
- adapter.getItem(0)?.Value,
- false
- )
- }
- }
- // 650 -> refreshToken()
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun occupationApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.occupationCategory)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.occupationApi(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getOccupationMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("occupationApi ", " response -->$response")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- listOfOccupation = getCodeResponse.Response.GetCodesList
- if (listOfOccupation.isNotEmpty()) {
- val adapter = ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfOccupation
- )
- binding.spOccupation.setAdapter(adapter)
-
- val occupationCode =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_OCCUPATION_CODE
- if (occupationCode.isNullOrEmpty()) {
-
- binding.spOccupation.setText(
- adapter.getItem(0)?.Label,
- false
- )
- } else {
- for (title in listOfOccupation) {
- if (title.Value == occupationCode) {
- binding.spOccupation.setText(title.Label, false)
- break
- }
- }
- }
- }
- }
- // 650 -> refreshToken()
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun annualIncomeApi() {
- val getCodeRequest = GetCodeRequest()
- getCodeRequest.ProductName = getString(R.string.bajajFD)
- getCodeRequest.Category = getString(R.string.annualIncome)
- getCodeRequest.Language = getString(R.string.language)
- getCodeRequest.InputValue = ""
- (activity as NiveshFdMainActivity).viewModel.annualIncomeApi(
- getCodeRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getAnnualIncomeMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("annualIncomeApi ", " response -->$response")
- val getCodeResponse: GetCodeResponse =
- Gson().fromJson(response.data?.toString(), GetCodeResponse::class.java)
- getCodeResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- listOfAnnualIncome = getCodeResponse.Response.GetCodesList
- if (listOfAnnualIncome.isNotEmpty()) {
- val adapter = ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfAnnualIncome
- )
- binding.spIncome.setAdapter(adapter)
- binding.spIncome.setText(
- adapter.getItem(0)?.Value,
- false
- )
- }
- }
- // 650 -> refreshToken()
- else -> {
- if (getCodeResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getCodeResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getCodeResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun stateListApi() {
- (activity as NiveshFdMainActivity).viewModel.stateApi(
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getStateMasterMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("stateListApi ", " response -->$response")
- val stateListResponse: StateListResponse =
- Gson().fromJson(
- response.data?.toString(),
- StateListResponse::class.java
- )
- stateListResponse.response.status_code.let { code ->
- when (code) {
- 200 -> {
- listOfStates = stateListResponse.DataObject
- if (listOfStates.isNotEmpty()) {
- val adapter = ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfStates
- )
- binding.spState.setAdapter(adapter)
- val newTitleText =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_STATE
- if (newTitleText?.isEmpty()!!) {
- binding.spState.setText(
- adapter.getItem(0)?.State_Name,
- false
- )
- cityListApi(adapter.getItem(0)?.State_Id)
-
- stateObject = adapter.getItem(0) as DataObject
- Log.e("if", " -->" + stateObject.State_Code)
- } else {
- for (title in listOfStates) {
- if (title.State_Code == newTitleText) {
- binding.spState.setText(title.State_Name, false)
- cityListApi(title.State_Id)
- stateObject = title
- Log.e("else", " -->" + stateObject.State_Code)
- break
- }
- }
- }
- }
- }
- // 650 -> refreshToken()
- else -> {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- stateListResponse.response.message
- )
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun cityListApi(stateCode: Int?) {
-
- val cityRequest = CityRequest()
- cityRequest.StateCode = stateCode
- cityRequest.Type = ""
- cityRequest.ClientCode =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CODE
- cityRequest.RoleID = PreferenceManager(activity as NiveshFdMainActivity).getLoginRole()
- cityRequest.APIName = ""
- cityRequest.UID = 0
- cityRequest.Subbroker_Code =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.sub_broker_code
- cityRequest.RMCode = ""
- cityRequest.HOCode = ""
- cityRequest.Source = getString(R.string.source)
- cityRequest.APP_Web = getString(R.string.app)
- (activity as NiveshFdMainActivity).viewModel.cityListApi(
- cityRequest,
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getCityListMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("cityListApi ", " response -->$response")
- val cityListResponse: CityListResponse =
- Gson().fromJson(response.data?.toString(), CityListResponse::class.java)
- cityListResponse.response.status_code.let { code ->
- when (code) {
- 200 -> {
- listOfCities = cityListResponse.DataObject
- if (listOfCities.isNotEmpty()) {
- val adapter = ArrayAdapter(
- activity as NiveshFdMainActivity,
- R.layout.spinner_dropdown,
- listOfCities
- )
- binding.spCity.setAdapter(adapter)
-
- val newTitleText =
- (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_CITY
- if (newTitleText?.isEmpty()!!) {
- binding.spCity.setText(
- adapter.getItem(0)?.city_name,
- false
- )
- } else {
- for (title in listOfCities) {
- if (title.city_name == newTitleText) {
- binding.spCity.setText(title.city_name, false)
- break
- }
- }
- }
- }
- }
- // 650 -> refreshToken()
- else -> {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- cityListResponse.response.message
- )
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
-
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun apiForEligibleBankList() {
- ProgressUtil.showLoading(activity as NiveshFdMainActivity)
- (activity as NiveshFdMainActivity).viewModel.bankListApi(
- PreferenceManager(activity as NiveshFdMainActivity).getToken(),
- getString(R.string.language),
- activity as NiveshFdMainActivity
- )
- (activity as NiveshFdMainActivity).viewModel.getFDBankListMutableData.observe(
- viewLifecycleOwner
- ) { response ->
- when (response) {
- is Resource.Success -> {
- Log.e("apiForEligibleBankList ", " response -->${response.data.toString()}")
- val getFDBankListResponse: GetFDBankListResponse =
- Gson().fromJson(
- response.data?.toString(),
- GetFDBankListResponse::class.java
- )
- getFDBankListResponse.Response.StatusCode.let { code ->
- when (code) {
- 200 -> {
- if (getFDBankListResponse.Response.BankList.isNotEmpty()) {
- listOfEligibleBank.addAll(getFDBankListResponse.Response.BankList)
-
- }
- }
- 650 -> refreshToken()
- else -> {
- if (getFDBankListResponse.Response.Errors.isNotEmpty()) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getFDBankListResponse.Response.Errors[0].ErrorMessage
- )
- } else {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- "".plus(getFDBankListResponse.Response.Message)
- )
- }
- }
- }
- }
- }
-
- is Resource.Error -> {
- response.message?.let { message ->
- showDialogValidation(activity as NiveshFdMainActivity, message)
- }
- }
- is Resource.Loading -> {
- ProgressUtil.hideLoading()
- }
- is Resource.DataError -> {
-
- }
- }
- }
- }
-
- private fun refreshToken() {
-
- }
-
- private fun dialogForBankList(bankList: List) {
- val dialog = Dialog(activity as NiveshFdMainActivity)
- dialog.setContentView(R.layout.layout_bank_list)
- dialog.setCancelable(true)
- dialog.window!!
- .setLayout(
- WindowManager.LayoutParams.MATCH_PARENT,
- WindowManager.LayoutParams.MATCH_PARENT
- )
- val rvClientList = dialog.findViewById(R.id.rvBankList)
- rvClientList.layoutManager = LinearLayoutManager(activity as NiveshFdMainActivity)
- val tvCancel = dialog.findViewById(R.id.tvCancel)
- tvCancel.setOnClickListener {
- dialog.dismiss()
- }
-
- if (bankList.isNotEmpty()) {
- val bankListAdapter = RecommendedBankListAdapter(bankList)
- rvClientList.adapter = bankListAdapter
- }
- dialog.show()
- }
-
- // validations
- private fun validation(): Boolean {
- return if (binding.edtMobileNumber.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtMobileNumber,
- binding.tlMobileNumber,
- getString(R.string.emptyMobileNumber)
- )
- } else if (!isIndianMobileNo(binding.edtMobileNumber.text.toString())) { // EditText
- commonErrorMethod(
- binding.edtMobileNumber,
- binding.tlMobileNumber,
- getString(R.string.inValidIndianMobileNumber)
- )
- } else if (binding.edtMobileNumber.text?.length != 10) { // EditText
- commonErrorMethod(
- binding.edtMobileNumber,
- binding.tlMobileNumber,
- getString(R.string.inValidMobileNumber)
- )
- } else if (binding.edtDOB.text.toString().isEmpty()) { // EditText
- commonErrorMethod(binding.edtDOB, binding.tlDOB, getString(R.string.emptyDOB))
- } else if (isMinor(binding.edtDOB.text.toString())) { // EditText
- commonErrorMethod(binding.edtDOB, binding.tlDOB, getString(R.string.minorApplicant))
- } else if (binding.edtPANNumber.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtPANNumber,
- binding.tlPanNumber,
- getString(R.string.emptyPAN)
- )
- } else if (!isValidPan(binding.edtPANNumber.text.toString())) { // EditText
- commonErrorMethod(
- binding.edtPANNumber,
- binding.tlPanNumber,
- getString(R.string.invalidPAN)
- )
- } else if (!isValidIndividualPan(binding.edtPANNumber.text.toString())) { // EditText
- commonErrorMethod(
- binding.edtPANNumber,
- binding.tlPanNumber,
- getString(R.string.invalidIndividualPAN)
- )
- } else if (binding.spTitle.text.isEmpty()) { // Spinner
- commonSpinnerErrorMethod(
- binding.spTitle,
- binding.tlTitle,
- getString(R.string.emptyTitle)
- )
- } else if (binding.spGender.text.toString().isEmpty()) { // Spinner
- commonSpinnerErrorMethod(
- binding.spGender,
- binding.tlGender,
- getString(R.string.emptyGender)
- )
- } else if (binding.edtFirstName.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtFirstName,
- binding.tlFirstName,
- getString(R.string.emptyFirstName)
- )
- } else if (!isValidName(binding.edtFirstName.text.toString())) { // EditText
- commonErrorMethod(
- binding.edtFirstName,
- binding.tlFirstName,
- getString(R.string.validFirstName)
- )
- } else if (binding.edtLastName.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtLastName,
- binding.tlLastName,
- getString(R.string.emptyLastName)
- )
- } else if (!isValidName(binding.edtLastName.text.toString())) { // EditText
- commonErrorMethod(
- binding.edtLastName,
- binding.tlLastName,
- getString(R.string.validLastName)
- )
- } else if (binding.spOccupation.text.toString().isEmpty()) { // EditText
- commonSpinnerErrorMethod(
- binding.spOccupation,
- binding.tlOccupation,
- getString(R.string.emptyOccupation)
- )
- } else if (binding.spIncome.text.toString().isEmpty()) { // EditText
- commonSpinnerErrorMethod(
- binding.spIncome,
- binding.tlIncome,
- getString(R.string.emptyIncome)
- )
- } else if (binding.edtQualification.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtQualification,
- binding.tlQualification,
- getString(R.string.emptyQualification)
- )
- } else if (binding.spMarital.text.toString().isEmpty()) { // Spinner
- commonSpinnerErrorMethod(
- binding.spMarital,
- binding.tlMarital,
- getString(R.string.emptyMaritalStatus)
- )
- } else if (binding.edtEmail.text.toString().isEmpty()) { // EditText
- commonErrorMethod(binding.edtEmail, binding.tlEmail, getString(R.string.emptyEmail))
- } else if (!isValidEmail(binding.edtEmail.text.toString())) { // EditText
- commonErrorMethod(binding.edtEmail, binding.tlEmail, getString(R.string.validEmail))
- } else if (binding.edtAddressLine1.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtAddressLine1,
- binding.tlAddressLine1,
- getString(R.string.emptyAddressLine1)
- )
- } else if (binding.edtAddressLine2.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtAddressLine2,
- binding.tlAddressLine2,
- getString(R.string.emptyAddressLine2)
- )
- } else if (binding.edtAddressLine3.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtAddressLine3,
- binding.tlAddressLine3,
- getString(R.string.emptyAddressLine3)
- )
- } else if (binding.spState.text.toString().isEmpty()) { // EditText
- commonSpinnerErrorMethod(
- binding.spState,
- binding.tlState,
- getString(R.string.emptyState)
- )
- } else if (binding.spCity.text.toString().isEmpty()) { // EditText
- commonSpinnerErrorMethod(
- binding.spCity,
- binding.tlCity,
- getString(R.string.emptyCity)
- )
- } else if (binding.edtPinCode.text.toString().isEmpty()) { // EditText
- commonErrorMethod(
- binding.edtPinCode,
- binding.tlPinCode,
- getString(R.string.emptyPinCode)
- )
- } else if (binding.edtPinCode.text.toString().length != 6) { // EditText
- commonErrorMethod(
- binding.edtPinCode,
- binding.tlPinCode,
- getString(R.string.validPinCode)
- )
- } else if (binding.edtNomineeDOB.text.toString()
- .isNotEmpty() && isMinor(binding.edtNomineeDOB.text.toString())
- ) {
- commonErrorMethod(
- binding.edtGuardianName,
- binding.tlGuardianName,
- getString(R.string.validGuardianDetails)
- )
- } else if ((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.ClientBanklist?.isEmpty()!! && binding.edtIFSC.text.toString()
- .isEmpty()
- ) { // EditText
- commonErrorAutoCompleteMethod(
- binding.edtIFSC,
- binding.tlIFSC,
- getString(R.string.emptyIFSCCode)
- )
- } else if ((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.ClientBanklist?.isEmpty()!! && binding.edtIFSC.text.toString()
- .length != 11
- ) { // EditText
- commonErrorAutoCompleteMethod(
- binding.edtIFSC,
- binding.tlIFSC,
- getString(R.string.validIFSCCode)
- )
- } else if ((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.ClientBanklist?.isEmpty()!! && binding.edtAccountNumber.text.toString()
- .isEmpty()
- ) { // EditText
- commonErrorMethod(
- binding.edtAccountNumber,
- binding.tlAccountNumber,
- getString(R.string.emptyAccNo)
- )
- } else if ((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.ClientBanklist?.isEmpty()!! && binding.edtBankName.text.toString()
- .isEmpty()
- ) { // EditText
- commonErrorMethod(
- binding.edtBankName,
- binding.tlBankName,
- getString(R.string.emptyBankName)
- )
- } else if (eligibleBank().isEmpty() && eligibleBank() != bankListAdapter.getSelected()?.BankName) {
- showDialogValidation(
- activity as NiveshFdMainActivity,
- getString(R.string.eligibleBankError)
- )
- return false
- } else if ((activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.ClientBanklist?.isEmpty()!! && binding.edtBankBranch.text.toString()
- .isEmpty()
- ) { // EditText
- commonErrorMethod(
- binding.edtBankBranch,
- binding.tlBankBranchName,
- getString(R.string.emptyBranchName)
- )
- } else {
- return true
- }
- }
-
- private fun showHideBankDetail() {
- if (binding.llBankDetails.visibility == View.GONE) {
- binding.llBankDetails.visibility = View.VISIBLE
- binding.addBankDetail.setCompoundDrawablesWithIntrinsicBounds(
- 0,
- 0,
- R.drawable.ic_minus,
- 0
- )
-
- } else {
- binding.llBankDetails.visibility = View.GONE
- binding.addBankDetail.setCompoundDrawablesWithIntrinsicBounds(
- 0,
- 0,
- R.drawable.ic_add_icon,
- 0
- )
- }
- }
-
- override fun onDestroyView() {
- super.onDestroyView()
- _binding = null
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/providerfactory/FDModelProviderFactory.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/providerfactory/FDModelProviderFactory.kt
deleted file mode 100644
index 7886ee6..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/providerfactory/FDModelProviderFactory.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.nivesh.production.niveshfd.fd.ui.providerfactory
-
-import androidx.lifecycle.ViewModel
-import androidx.lifecycle.ViewModelProvider
-import com.nivesh.production.niveshfd.fd.repositories.MainRepository
-import com.nivesh.production.niveshfd.fd.viewModel.BajajFDViewModel
-
-class FDModelProviderFactory(private val mainRepository: MainRepository) :
- ViewModelProvider.Factory {
-
- override fun create(modelClass: Class): T {
- return BajajFDViewModel(mainRepository) as T
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/viewModel/BajajFDViewModel.kt b/app/src/main/java/com/nivesh/production/niveshfd/fd/viewModel/BajajFDViewModel.kt
deleted file mode 100644
index 79e930f..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/viewModel/BajajFDViewModel.kt
+++ /dev/null
@@ -1,369 +0,0 @@
-package com.nivesh.production.niveshfd.fd.viewModel
-
-import android.app.Activity
-import androidx.lifecycle.MutableLiveData
-import androidx.lifecycle.ViewModel
-import androidx.lifecycle.viewModelScope
-import com.google.gson.JsonObject
-import com.nivesh.production.niveshfd.fd.model.*
-import com.nivesh.production.niveshfd.fd.repositories.MainRepository
-import com.nivesh.production.niveshfd.fd.util.Common
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.handleError
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.handleResponse
-import com.nivesh.production.niveshfd.fd.util.Constants
-import com.nivesh.production.niveshfd.fd.util.Resource
-import kotlinx.coroutines.launch
-
-open class BajajFDViewModel(private val mainRepository: MainRepository) : ViewModel() {
-
- val getStepsCountMutableData: MutableLiveData> = MutableLiveData()
- fun getStepsCount(
- requestBody: FDStepsCountRequest,
- token: String,
- activity: Activity
- ) = viewModelScope.launch(handleError(activity)) {
- if (Common.isNetworkAvailable(activity)) {
- getStepsCountMutableData.postValue(Resource.Loading())
- val response = mainRepository.getStepsCountResponse(requestBody, token)
- getStepsCountMutableData.postValue(handleResponse(response))
- }
- }
-
- val getClientDetailsMutableData: MutableLiveData> = MutableLiveData()
- fun getClientDetails(getClientDetailsRequest: getClientDetailsRequest, token: String, activity: Activity) =
- viewModelScope.launch(handleError(activity)) {
- if (Common.isNetworkAvailable(activity)) {
- getClientDetailsMutableData.postValue(Resource.Loading())
- val response =
- mainRepository.getClientDetailsResponse(getClientDetailsRequest, token)
- getClientDetailsMutableData.postValue(handleResponse(response))
- }
- }
-
-
-
- val getPaymentReQueryMutableData: MutableLiveData> = MutableLiveData()
- fun getPaymentReQuery(requestBody: PaymentReQueryRequest, token : String, activity: Activity) = viewModelScope.launch(handleError(activity)) {
- if (Common.isNetworkAvailable(activity)) {
- getPaymentReQueryMutableData.postValue(Resource.Loading())
- val response = mainRepository.paymentReQueryResponse(requestBody, token)
- getPaymentReQueryMutableData.postValue(handleResponse(response))
- }
- }
-
-
- // Step 1 Api
- val getMinAmountMutableData: MutableLiveData> = MutableLiveData()
- fun getMinAmount(requestBody: GetCodeRequest, token: String, activity: Activity) =
- viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getMinAmountMutableData.postValue(Resource.Loading())
- val response = mainRepository.getCodesResponse(requestBody, token)
- getMinAmountMutableData.postValue(handleResponse(response))
- }
- }
-
- val getMaxAmountMutableData: MutableLiveData> = MutableLiveData()
- fun getMaxAmount(requestBody: GetCodeRequest, token: String, activity: Activity) =
- viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getMaxAmountMutableData.postValue(Resource.Loading())
- val response = mainRepository.getCodesResponse(requestBody, token)
- getMaxAmountMutableData.postValue(handleResponse(response))
- }
- }
-
- val getMaturityAmountMutableData: MutableLiveData> = MutableLiveData()
- fun getMaturityAmount(requestBody: GetMaturityAmountRequest, activity: Activity, token: String) =
- viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getMaturityAmountMutableData.postValue(Resource.Loading())
- val response = mainRepository.createCalculateFDMaturityAmount(requestBody, token)
- getMaturityAmountMutableData.postValue(handleResponse(response))
- }
- }
-
- val getRatesMutableData: MutableLiveData> = MutableLiveData()
- fun getRates(getRatesRequest: GetRatesRequest, token: String, activity: Activity) =
- viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getRatesMutableData.postValue(Resource.Loading())
- val response = mainRepository.getRatesResponse(getRatesRequest, token)
- getRatesMutableData.postValue(handleResponse(response))
- }
- }
-
- val getCodeMutableData: MutableLiveData> = MutableLiveData()
- fun getCode(requestBody: GetCodeRequest, token: String, activity: Activity) =
- viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getCodeMutableData.postValue(Resource.Loading())
- val response = mainRepository.getCodesResponse(requestBody, token)
- getCodeMutableData.postValue(handleResponse(response))
- }
- }
-
-
- // Step 2
- val getFDKYCMutableData: MutableLiveData> = MutableLiveData()
- fun checkFDKYC(requestBody: CheckFDKYCRequest, token : String, activity: Activity) = viewModelScope.launch(handleError(activity)) {
- if (Common.isNetworkAvailable(activity)) {
- getFDKYCMutableData.postValue(Resource.Loading())
- val response = mainRepository.checkFDKYCRequest(requestBody, token)
- getFDKYCMutableData.postValue(handleResponse(response))
- }
- }
-
- val getTitleMutableData: MutableLiveData> = MutableLiveData()
- fun titleApi(getCodeRequest: GetCodeRequest, token: String, activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getTitleMutableData.postValue(Resource.Loading())
- val response = mainRepository.titleCheck(getCodeRequest, token)
- getTitleMutableData.postValue(handleResponse(response))
- }
- }
-
- val getGenderMutableData: MutableLiveData> = MutableLiveData()
- fun genderApi(getCodeRequest: GetCodeRequest, token: String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getGenderMutableData.postValue(Resource.Loading())
- val response = mainRepository.genderCheck(getCodeRequest, token)
- getGenderMutableData.postValue(handleResponse(response))
- }
- }
-
- val getAnnualIncomeMutableData: MutableLiveData> = MutableLiveData()
- fun annualIncomeApi(getCodeRequest: GetCodeRequest, token: String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getAnnualIncomeMutableData.postValue(Resource.Loading())
- val response = mainRepository.annualIncomeCheck(getCodeRequest, token)
- getAnnualIncomeMutableData.postValue(handleResponse(response))
- }
- }
-
- val getRelationShipMutableData: MutableLiveData> = MutableLiveData()
- fun relationShipApi(getCodeRequest: GetCodeRequest, token: String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getRelationShipMutableData.postValue(Resource.Loading())
- val response = mainRepository.relationShipCheck(getCodeRequest, token)
- getRelationShipMutableData.postValue(handleResponse(response))
- }
- }
-
- val getMaritalStatusMutableData: MutableLiveData> = MutableLiveData()
- fun maritalStatusApi(getCodeRequest: GetCodeRequest, token: String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getMaritalStatusMutableData.postValue(Resource.Loading())
- val response = mainRepository.maritalStatusCheck(getCodeRequest, token)
- getMaritalStatusMutableData.postValue(handleResponse(response))
- }
- }
-
- val getOccupationMutableData: MutableLiveData> = MutableLiveData()
- fun occupationApi(getCodeRequest: GetCodeRequest, token: String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getOccupationMutableData.postValue(Resource.Loading())
- val response = mainRepository.occupationCheck(getCodeRequest, token)
- getOccupationMutableData.postValue(handleResponse(response))
- }
- }
-
-
- val getStateMasterMutableData: MutableLiveData> = MutableLiveData()
- fun stateApi(token: String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getStateMasterMutableData.postValue(Resource.Loading())
- val response = mainRepository.stateCheck(token)
- getStateMasterMutableData.postValue(handleResponse(response))
- }
- }
-
- val getCityListMutableData: MutableLiveData> = MutableLiveData()
- fun cityListApi(cityRequest: CityRequest, token: String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getCityListMutableData.postValue(Resource.Loading())
- val response = mainRepository.cityCheck(cityRequest, token)
- getCityListMutableData.postValue(handleResponse(response))
- }
- }
-
- val getFDBankListMutableData: MutableLiveData> = MutableLiveData()
- fun bankListApi( token: String,language: String, activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getFDBankListMutableData.postValue(Resource.Loading())
- val response = mainRepository.bankListCheck(token, language)
- getFDBankListMutableData.postValue(handleResponse(response))
- }
- }
-
- val getIfscCodeCheckMutableData: MutableLiveData> = MutableLiveData()
- fun ifscCodeApi(ifsc : String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getIfscCodeCheckMutableData.postValue(Resource.Loading())
- val response = mainRepository.ifscCodeCheck(ifsc)
- getIfscCodeCheckMutableData.postValue(handleResponse(response))
- }
- }
-
- val getIfscCodeDetailsCheckMutableData: MutableLiveData> = MutableLiveData()
- fun ifscCodeDetailsApi(ifsc : String,activity : Activity, token:String) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getIfscCodeDetailsCheckMutableData.postValue(Resource.Loading())
- val response = mainRepository.ifscCodeBankDetailsCheck(ifsc, token)
- getIfscCodeDetailsCheckMutableData.postValue(Common.handleResponse1(response))
- }
- }
-
- val getPaymentModeMutableData: MutableLiveData> = MutableLiveData()
- fun paymentModeApi(getCodeRequest: GetCodeRequest, token: String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getPaymentModeMutableData.postValue(Resource.Loading())
- val response = mainRepository.payModeCheck(getCodeRequest, token)
- getPaymentModeMutableData.postValue(handleResponse(response))
- }
- }
-
- val getFDResponseMutableData: MutableLiveData> = MutableLiveData()
- fun createFDApi(getRatesRequest: CreateFDRequest, token: String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getFDResponseMutableData.postValue(Resource.Loading())
- val response = mainRepository.createFDKYCResponse(getRatesRequest, token)
- getFDResponseMutableData.postValue(handleResponse(response))
- }
- }
-
- val bankValidationApiMutableData: MutableLiveData> = MutableLiveData()
- fun bankValidationApi(bankValidationApiRequest : BankValidationApiRequest,token:String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- bankValidationApiMutableData.postValue(Resource.Loading())
- val response = mainRepository.bankValidationApiRequest(bankValidationApiRequest,token)
- bankValidationApiMutableData.postValue(handleResponse(response))
- }
- }
-
- // Step 3
- val getDocTypeMutableData: MutableLiveData> = MutableLiveData()
- fun docTypeApi(getCodeRequest: GetCodeRequest, token: String, activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getDocTypeMutableData.postValue(Resource.Loading())
- val response = mainRepository.titleCheck(getCodeRequest, token)
- getDocTypeMutableData.postValue(handleResponse(response))
- }
- }
-
-
- val getDocumentUploadMutableData: MutableLiveData> = MutableLiveData()
- fun documentsUpload(documentUpload: DocumentUpload, token: String, activity: Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- getDocumentUploadMutableData.postValue(Resource.Loading())
- val response = mainRepository.documentsUploadResponse(documentUpload, token)
- getDocumentUploadMutableData.postValue(handleResponse(response))
- }
- }
-
- // Step 4
- val getFDDetailsMutableData: MutableLiveData> = MutableLiveData()
- fun getFDDetails(getRatesRequest: GetFDDetailsRequest, token: String,
- activity: Activity) = viewModelScope.launch(handleError(activity)) {
- if (Common.isNetworkAvailable(activity)) {
- getFDDetailsMutableData.postValue(Resource.Loading())
- val response = mainRepository.getFDDetailsResponse(getRatesRequest, token)
- getFDDetailsMutableData.postValue(handleResponse(response))
- }
- }
-
- val getFDOtherMutableData: MutableLiveData> = MutableLiveData()
- fun saveFDOtherData(getRatesRequest: SaveFDOtherDataRequest, token: String,
- activity: Activity) = viewModelScope.launch(handleError(activity)) {
- if (Common.isNetworkAvailable(activity)) {
- getFDOtherMutableData.postValue(Resource.Loading())
- val response = mainRepository.saveFDOtherDataResponse(getRatesRequest, token)
- getFDOtherMutableData.postValue(handleResponse(response))
- }
- }
-
- val customerListMutableData: MutableLiveData> = MutableLiveData()
- fun customerListApi(getCodeRequest: GetCodeRequest, token: String,activity : Activity) = viewModelScope.launch(
- handleError(activity)
- ) {
- if (Common.isNetworkAvailable(activity)) {
- customerListMutableData.postValue(Resource.Loading())
- val response = mainRepository.customerListCheck(getCodeRequest, token)
- customerListMutableData.postValue(handleResponse(response))
- }
- }
-
- fun updateFDPaymentStatus(getRatesRequest: GetRatesRequest, token: String,
- activity: Activity
- ) =
- viewModelScope.launch(handleError(activity)) {
- if (Common.isNetworkAvailable(activity)) {
- getRatesMutableData.postValue(Resource.Loading())
- val response = mainRepository.updateFDPaymentStatusResponse(getRatesRequest, token)
- getRatesMutableData.postValue(handleResponse(response))
- }
- }
-
- val getFinalizeFDMutableData: MutableLiveData> = MutableLiveData()
- fun finaliseFD(finalizeFDRequest: FinalizeFDRequest, token: String,
- activity: Activity) = viewModelScope.launch(handleError(activity)) {
- if (Common.isNetworkAvailable(activity)) {
- getFinalizeFDMutableData.postValue(Resource.Loading())
- val response = mainRepository.finaliseFDResponse(finalizeFDRequest, token)
- getFinalizeFDMutableData.postValue(handleResponse(response))
- }
- }
-
- val getFinalizeKYCMutableData: MutableLiveData> = MutableLiveData()
- fun finaliseKYC(getRatesRequest: FinalizeKYCRequest, token: String,
- activity: Activity) = viewModelScope.launch(handleError(activity)) {
- if (Common.isNetworkAvailable(activity)) {
- getFinalizeKYCMutableData.postValue(Resource.Loading())
- val response = mainRepository.finaliseKYCResponse(getRatesRequest, token)
- getFinalizeKYCMutableData.postValue(handleResponse(response))
- }
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/api1/ApiCallback1.kt b/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/api1/ApiCallback1.kt
deleted file mode 100644
index 4e9184b..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/api1/ApiCallback1.kt
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.api1
-
-import com.nivesh.production.niveshfd.fd.util.Resource
-import retrofit2.Call
-import retrofit2.Callback
-import retrofit2.Response
-
-abstract class ApiCallback1 : Callback> {
-
- abstract fun onSuccess(response: Resource)
-
- abstract fun onFailure(response: Resource)
-
- override fun onResponse(call: Call>, response: Response>) {
- if (response.isSuccessful && response.body() != null && response.code() == 200) {
- onSuccess(response.body()!!)
- } else if (response.code() == 650){
- // handle 4xx & 5xx error codes here
-// val resp = Resource()
-// resp.status = false
-// resp.message = response.message()
-// onFailure(resp)
- }
- }
-
- override fun onFailure(call: Call>, t: Throwable) {
-// val response = Resource()
-// response.status = false
-// response.message = t.message.toString()
-// onFailure(response)
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/api1/ApiClient1.kt b/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/api1/ApiClient1.kt
deleted file mode 100644
index 1b33ef2..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/api1/ApiClient1.kt
+++ /dev/null
@@ -1,66 +0,0 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.api1
-
-import com.nivesh.production.niveshfd.fd.NiveshFdApplication
-import com.nivesh.production.niveshfd.fd.interfaces.ApiInterface
-import com.nivesh.production.niveshfd.fd.util.Constants.Companion.BASE_URL
-import okhttp3.OkHttpClient
-import okhttp3.logging.HttpLoggingInterceptor
-import retrofit2.Retrofit
-import retrofit2.converter.gson.GsonConverterFactory
-import java.security.KeyStore
-import java.util.*
-import java.util.concurrent.TimeUnit
-import javax.net.ssl.*
-
-class ApiClient1 {
- val context = NiveshFdApplication.appContext
-
- companion object {
- private val client by lazy {
- //lazy means we only initialize this here once
- val logging = HttpLoggingInterceptor()
- //loggingInterceptor use for see making request and for see what responses are
- logging.setLevel(HttpLoggingInterceptor.Level.BODY)
- //see the body of response
- //create client for retrofit
-
- val trustManagerFactory: TrustManagerFactory =
- TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm())
- trustManagerFactory.init(null as KeyStore?)
- val trustManagers: Array = trustManagerFactory.getTrustManagers()
- check(!(trustManagers.size != 1 || trustManagers[0] !is X509TrustManager)) {
- "Unexpected default trust managers:" + Arrays.toString(
- trustManagers
- )
- }
- val trustManager: X509TrustManager = trustManagers[0] as X509TrustManager
- val sslContext = SSLContext.getInstance("SSL")
- sslContext.init(null, arrayOf(trustManager), null)
- val sslSocketFactory: SSLSocketFactory = sslContext.socketFactory
-
- val client = OkHttpClient.Builder()
- .addInterceptor(logging)
- .sslSocketFactory(sslSocketFactory, trustManager)
- .retryOnConnectionFailure(true)
- .callTimeout(2, TimeUnit.MINUTES)
- .connectTimeout(20, TimeUnit.SECONDS)
- .readTimeout(30, TimeUnit.SECONDS)
- .writeTimeout(30, TimeUnit.SECONDS)
- .build()
-
- Retrofit.Builder()
- .baseUrl(BASE_URL)
- .addConverterFactory(GsonConverterFactory.create())
- .client(client)
- .build()
- }
- val getApiClient: ApiInterface by lazy {
- client.create(ApiInterface::class.java)
- }
- }
-
-}
-
-
-
-
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/interfaces1/ApiInterface1.kt b/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/interfaces1/ApiInterface1.kt
deleted file mode 100644
index 4ff248e..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/interfaces1/ApiInterface1.kt
+++ /dev/null
@@ -1,175 +0,0 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.api1
-
-import com.google.gson.JsonObject
-import com.nivesh.production.niveshfd.fd.model.*
-import okhttp3.RequestBody
-import retrofit2.Response
-import retrofit2.http.*
-
-interface ApiInterface1 {
-
- @POST("GetRates")
- suspend fun getRates(
- @Body getRatesRequest: GetRatesRequest,
- @Header("token") token: String
- ): Response
-
- @POST("CheckFDCKYC")
- suspend fun checkFDKYC(
- @Body checkFDKYCRequest: CheckFDKYCRequest,
- @Header("token") token: String
- ): Response
-
- @POST("CreateFDApplication")
- suspend fun createFDApp(
- @Body createFDRequest: CreateFDRequest,
- @Header("token") token: String
- ): Response
-
- @POST("DocumentsUpload")
- suspend fun documentsUpload(
- @Body requestBody: DocumentUpload,
- @Header("token") token: String
- ): Response
-
- @POST("SaveFDOtherData")
- suspend fun saveFDOtherData(
- @Body requestBody: SaveFDOtherDataRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetFDDetails")
- suspend fun getFDDetails(
- @Body requestBody: GetFDDetailsRequest,
- @Header("token") token: String
- ): Response
-
- @POST("FinaliseFD")
- suspend fun finaliseFD(
- @Body requestBody: FinalizeFDRequest,
- @Header("token") token: String
- ): Response
-
- @POST("FinaliseKYC")
- suspend fun finaliseKYC(
- @Body requestBody: FinalizeKYCRequest,
- @Header("token") token: String
- ): Response
-
- @POST("PaymentRequery")
- suspend fun paymentReQuery(
- @Body requestBody: PaymentReQueryRequest,
- @Header("token") token: String
- ): Response
-
- // @FormUrlEncoded
- @POST("GetCodes")
- suspend fun getCodes(
- @Body requestBody: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("CalculateFDMaturityAmount")
- suspend fun getCalculateFDMaturityAmount(
- @Body requestBody: GetMaturityAmountRequest,
- @Header("token") token: String
- ): Response
-
- @POST("PanCheck_S")
- suspend fun panCheckApi(
- @Body panCheck: PanCheckRequest,
- @Header("token") token: String
- ): Response
-
- @POST("getFDStepsCount")
- suspend fun getFDStepsCount(
- @Body fdStepsCountRequest: FDStepsCountRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetClientDetailV2_S")
- suspend fun getClientDetails(
- @Body getClientDetailsRequest: getClientDetailsRequest,
- @Header("token") token: String
- ): Response
-
-
- @POST("GetCodes")
- suspend fun titleApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun genderApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun annualIncomeApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun relationShipApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun maritalStatusApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun occupationApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetStateMaster")
- suspend fun stateApi(@Header("token") token: String): Response
-
- @POST("GetCity")
- suspend fun cityApi(
- @Body cityRequest: CityRequest,
- @Header("token") token: String
- ): Response
-
- @GET("GetFDBankList?FDProvider=Bajaj")
- suspend fun bankListApi(@Header("token") token: String, @Query("Language") language : String): Response
-
- @GET("GetIFSC_Autofill?")
- suspend fun getIFSCApi(@Query("prefix") ifsc : String): Response
-
- @GET("GetbankNames")
- suspend fun getIFSCBankDetailsApi(@Query( "bankname") ifsc : String, @Header("token") token: String): Response
-
- @POST("GetCodes")
- suspend fun payModeApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("GetCodes")
- suspend fun customerListApi(
- @Body getCodeRequest: GetCodeRequest,
- @Header("token") token: String
- ): Response
-
- @POST("BankValidationAPI_S")
- suspend fun bankValidationApi(
- @Body bankValidationApiRequest: BankValidationApiRequest,
- @Header("token") token: String
- ): Response
-
-
- @POST("BankValidationAPI_S")
- suspend fun getToken(
- @Body bankValidationApiRequest: BankValidationApiRequest,
- @Header("token") token: String
- ): Response
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/BasActivity.kt b/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/BasActivity.kt
deleted file mode 100644
index d644182..0000000
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/BasActivity.kt
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1
-
-import android.app.Activity
-import android.os.Bundle
-
-class BasActivity : Activity() {
-
- lateinit var mActivity : Activity
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- mActivity = this;
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/NiveshFdApplication.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/NiveshFdApplication.kt
similarity index 87%
rename from app/src/main/java/com/nivesh/production/niveshfd/NiveshFdApplication.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/NiveshFdApplication.kt
index 70cc618..4318af1 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/NiveshFdApplication.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/NiveshFdApplication.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.fd
+package com.nivesh.production.partnerOnBoarding
import android.app.Application
import android.content.Context
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/adapters1/DisableAdapter1.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/adapters/DisableAdapter1.kt
similarity index 92%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/adapters1/DisableAdapter1.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/adapters/DisableAdapter1.kt
index cf42cd7..e1eaf75 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/adapters1/DisableAdapter1.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/adapters/DisableAdapter1.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.adapters1
+package com.nivesh.production.partnerOnBoarding.adapters
import android.annotation.SuppressLint
import android.content.Context
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/adapters1/NewDistributorSignStepOneAdapter.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/adapters/NewDistributorSignStepOneAdapter.kt
similarity index 94%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/adapters1/NewDistributorSignStepOneAdapter.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/adapters/NewDistributorSignStepOneAdapter.kt
index 6ad5135..c80a417 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/adapters1/NewDistributorSignStepOneAdapter.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/adapters/NewDistributorSignStepOneAdapter.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.adapters1
+package com.nivesh.production.partnerOnBoarding.adapters
import android.content.Context
import android.view.LayoutInflater
@@ -10,11 +10,10 @@ import android.widget.RadioButton
import android.widget.RadioGroup
import android.widget.RelativeLayout
import android.widget.TextView
-import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.textfield.TextInputLayout
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1.NewDistributorSignStepOne
+import com.nivesh.production.partnerOnBoarding.R
+import com.nivesh.production.partnerOnBoarding.ui.fragments.NewDistributorSignStepOne
class NewDistributorSignStepOneAdapter(private var listData: MutableList) :
RecyclerView.Adapter() {
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/adapters1/SectionsPagerAdapter1.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/adapters/SectionsPagerAdapter1.kt
similarity index 89%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/adapters1/SectionsPagerAdapter1.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/adapters/SectionsPagerAdapter1.kt
index 3ad3d47..519ff68 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/adapters1/SectionsPagerAdapter1.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/adapters/SectionsPagerAdapter1.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.adapters1
+package com.nivesh.production.partnerOnBoarding.adapters
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/api/ApiCallback.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/api/ApiCallback.kt
similarity index 89%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/api/ApiCallback.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/api/ApiCallback.kt
index c5a6669..026d457 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/api/ApiCallback.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/api/ApiCallback.kt
@@ -1,6 +1,6 @@
-package com.nivesh.production.niveshfd.fd.api
+package com.nivesh.production.partnerOnBoarding.api
-import com.nivesh.production.niveshfd.fd.util.Resource
+import com.nivesh.production.partnerOnBoarding.util.Resource
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/api/ApiClient.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/api/ApiClient.kt
similarity index 90%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/api/ApiClient.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/api/ApiClient.kt
index c386360..1ec7f32 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/api/ApiClient.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/api/ApiClient.kt
@@ -1,8 +1,8 @@
-package com.nivesh.production.niveshfd.fd.api
+package com.nivesh.production.partnerOnBoarding.api
-import com.nivesh.production.niveshfd.fd.NiveshFdApplication
-import com.nivesh.production.niveshfd.fd.interfaces.ApiInterface
-import com.nivesh.production.niveshfd.fd.util.Constants.Companion.BASE_URL
+
+import com.nivesh.production.partnerOnBoarding.NiveshFdApplication
+import com.nivesh.production.partnerOnBoarding.util.Constants.Companion.BASE_URL
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/db/PreferenceManager.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/db/PreferenceManager.kt
similarity index 93%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/db/PreferenceManager.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/db/PreferenceManager.kt
index 6e64c82..52a3a02 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/db/PreferenceManager.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/db/PreferenceManager.kt
@@ -1,9 +1,8 @@
-package com.nivesh.production.niveshfd.fd.db
+package com.nivesh.production.partnerOnBoarding.db
import android.content.Context
import android.content.SharedPreferences
-import android.provider.UserDictionary.Words.APP_ID
-import com.nivesh.production.niveshfd.fd.interfaces.IPreferenceHelper
+import com.nivesh.production.partnerOnBoarding.interfaces.IPreferenceHelper
open class PreferenceManager(context: Context) : IPreferenceHelper {
private val preferenceName = "NiveshFDSDK"
@@ -19,7 +18,7 @@ open class PreferenceManager(context: Context) : IPreferenceHelper {
const val KEY_GET_TOKEN = "GetToken"
const val CLIENT_LANGUAGE = "LANGUAGE"
- const val ISFIRST_TIME = "IS FIRST TIME"
+ const val IS_FIRST_TIME = "IS FIRST TIME"
const val APP_ID = "AppId"
}
@@ -91,11 +90,11 @@ open class PreferenceManager(context: Context) : IPreferenceHelper {
override fun setIsFirstTime(appName: Boolean) {
- preferences[ISFIRST_TIME] = appName
+ preferences[IS_FIRST_TIME] = appName
}
override fun getFirstTime(): Boolean {
- return preferences[ISFIRST_TIME] ?: false
+ return preferences[IS_FIRST_TIME] ?: false
}
override fun getAppId(): String {
diff --git a/app/src/main/java/com/nivesh/production/partnerOnBoarding/interfaces/ApiInterface.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/interfaces/ApiInterface.kt
new file mode 100644
index 0000000..0e6a702
--- /dev/null
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/interfaces/ApiInterface.kt
@@ -0,0 +1,22 @@
+package com.nivesh.production.partnerOnBoarding.api
+
+import com.google.gson.JsonObject
+import retrofit2.Response
+import retrofit2.http.*
+
+interface ApiInterface {
+//
+// @POST("GetRates")
+// suspend fun getRates(
+// @Body getRatesRequest: GetRatesRequest,
+// @Header("token") token: String
+// ): Response
+
+
+ @GET("GetIFSC_Autofill?")
+ suspend fun getIFSCApi(@Query("prefix") ifsc : String): Response
+
+ @GET("GetbankNames")
+ suspend fun getIFSCBankDetailsApi(@Query( "bankname") ifsc : String, @Header("token") token: String): Response
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/IPreferenceHelper.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/interfaces/IPreferenceHelper.kt
similarity index 92%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/IPreferenceHelper.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/interfaces/IPreferenceHelper.kt
index fec0ca9..cbe4700 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/interfaces/IPreferenceHelper.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/interfaces/IPreferenceHelper.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.fd.interfaces
+package com.nivesh.production.partnerOnBoarding.interfaces
interface IPreferenceHelper {
diff --git a/app/src/main/java/com/nivesh/production/partnerOnBoarding/providerfactory/OnBoardingModelProviderFactory.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/providerfactory/OnBoardingModelProviderFactory.kt
new file mode 100644
index 0000000..5eff759
--- /dev/null
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/providerfactory/OnBoardingModelProviderFactory.kt
@@ -0,0 +1,15 @@
+package com.nivesh.production.partnerOnBoarding.providerfactory
+
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.ViewModelProvider
+import com.nivesh.production.partnerOnBoarding.repositories.MainRepository
+import com.nivesh.production.partnerOnBoarding.viewModels.OnBoardingViewModel
+
+class OnBoardingModelProviderFactory(private val mainRepository: MainRepository) :
+ ViewModelProvider.Factory {
+
+ override fun create(modelClass: Class): T {
+ return OnBoardingViewModel(mainRepository) as T
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/partnerOnBoarding/repositories/MainRepository.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/repositories/MainRepository.kt
new file mode 100644
index 0000000..c00a18f
--- /dev/null
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/repositories/MainRepository.kt
@@ -0,0 +1,15 @@
+package com.nivesh.production.partnerOnBoarding.repositories
+
+import com.nivesh.production.partnerOnBoarding.api.ApiInterface
+
+
+class MainRepository constructor(private val apiInterface: ApiInterface) {
+
+ // MainActivity
+// suspend fun getStepsCountResponse(requestBody: FDStepsCountRequest, token: String) =
+// apiInterface.getFDStepsCount(requestBody, token)
+//
+// suspend fun getClientDetailsResponse(getClientDetails: getClientDetailsRequest, token: String) =
+// apiInterface.getClientDetails(getClientDetails, token)
+//
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/activity/BaseActivity.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/BaseActivity.kt
similarity index 67%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/ui/activity/BaseActivity.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/BaseActivity.kt
index b6c2ffd..905d46a 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/ui/activity/BaseActivity.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/BaseActivity.kt
@@ -1,14 +1,14 @@
-package com.nivesh.production.niveshfd.fd.ui.activity
+package com.nivesh.production.partnerOnBoarding.ui.activities
import android.app.Activity
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
open class BaseActivity : AppCompatActivity() {
- private lateinit var mActivity: Activity
+ lateinit var mActivity : Activity
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
- mActivity = this
+ mActivity = this;
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/LoginActivity.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/LoginActivity.kt
similarity index 85%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/LoginActivity.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/LoginActivity.kt
index 4890e6e..0b354ec 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/LoginActivity.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/LoginActivity.kt
@@ -1,12 +1,11 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1
+package com.nivesh.production.partnerOnBoarding.ui.activities
import android.content.Intent
import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
-import com.nivesh.production.niveshfd.databinding.ActivityLoginBinding
-import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
-import com.nivesh.production.niveshfd.fd.util.Common
+import com.nivesh.production.partnerOnBoarding.databinding.ActivityLoginBinding
+import com.nivesh.production.partnerOnBoarding.util.Common
class LoginActivity : BaseActivity() {
lateinit var binding: ActivityLoginBinding
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/RegisterActivity.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/RegisterActivity.kt
similarity index 88%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/RegisterActivity.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/RegisterActivity.kt
index c4766a2..948b8ba 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/RegisterActivity.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/RegisterActivity.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1
+package com.nivesh.production.partnerOnBoarding.ui.activities
import android.content.Intent
import android.os.Build
@@ -6,10 +6,9 @@ import android.os.Bundle
import android.util.DisplayMetrics
import android.view.Display
import androidx.core.hardware.display.DisplayManagerCompat
-import com.nivesh.production.niveshfd.databinding.ActivityRegisterBinding
-import com.nivesh.production.niveshfd.fd.db.PreferenceManager
-import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.showWebViewDialogBottom
+import com.nivesh.production.partnerOnBoarding.databinding.ActivityRegisterBinding
+import com.nivesh.production.partnerOnBoarding.db.PreferenceManager
+import com.nivesh.production.partnerOnBoarding.util.Common.Companion.showWebViewDialogBottom
class RegisterActivity : BaseActivity() {
lateinit var binding: ActivityRegisterBinding
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/SignUpActivity.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/SignUpActivity.kt
similarity index 66%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/SignUpActivity.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/SignUpActivity.kt
index 1e81bbb..bec5935 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/SignUpActivity.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/SignUpActivity.kt
@@ -1,16 +1,13 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1
+package com.nivesh.production.partnerOnBoarding.ui.activities
import android.os.Bundle
-import android.util.Log
-import androidx.fragment.app.FragmentManager
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.databinding.ActivitySignupBinding
-import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
-import com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1.SignUpFragment
+import com.nivesh.production.partnerOnBoarding.R
+import com.nivesh.production.partnerOnBoarding.databinding.ActivitySignupBinding
+import com.nivesh.production.partnerOnBoarding.ui.fragments.SignUpFragment
class SignUpActivity : BaseActivity() {
lateinit var binding: ActivitySignupBinding
- var type : Int? = null
+ var type: Int? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@@ -29,9 +26,7 @@ class SignUpActivity : BaseActivity() {
val fragment = SignUpFragment()
fragment.arguments = bundle
- supportFragmentManager.beginTransaction()
- .add(R.id.signUpContainer, fragment)
- .commit()
+ supportFragmentManager.beginTransaction().add(R.id.signUpContainer, fragment).commit()
}
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/ViewPagerActivity.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/ViewPagerActivity.kt
similarity index 79%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/ViewPagerActivity.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/ViewPagerActivity.kt
index 12bb248..2f2a453 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/activities1/ViewPagerActivity.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/activities/ViewPagerActivity.kt
@@ -1,17 +1,16 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1
+package com.nivesh.production.partnerOnBoarding.ui.activities
import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.viewpager.widget.ViewPager
-import com.nivesh.production.niveshfd.databinding.ActivityViewpagerBinding
-import com.nivesh.production.niveshfd.fd.db.PreferenceManager
-import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
-import com.nivesh.production.niveshfd.partnerOnBoarding.adapters1.DisableAdapter1
-import com.nivesh.production.niveshfd.partnerOnBoarding.adapters1.SectionsPagerAdapter1
-import com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1.StepOnePagerFragment
-import com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1.StepThreePagerFragment
-import com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1.StepTwoPagerFragment
+import com.nivesh.production.partnerOnBoarding.databinding.ActivityViewpagerBinding
+import com.nivesh.production.partnerOnBoarding.db.PreferenceManager
+import com.nivesh.production.partnerOnBoarding.ui.fragments.StepTwoPagerFragment
+import com.nivesh.production.partnerOnBoarding.adapters.DisableAdapter1
+import com.nivesh.production.partnerOnBoarding.adapters.SectionsPagerAdapter1
+import com.nivesh.production.partnerOnBoarding.ui.fragments.StepOnePagerFragment
+import com.nivesh.production.partnerOnBoarding.ui.fragments.StepThreePagerFragment
class ViewPagerActivity : BaseActivity() {
lateinit var binding: ActivityViewpagerBinding
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/AlmostThereFragment.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/AlmostThereFragment.kt
similarity index 90%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/AlmostThereFragment.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/AlmostThereFragment.kt
index b429e24..6bedfaa 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/AlmostThereFragment.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/AlmostThereFragment.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1
+package com.nivesh.production.partnerOnBoarding.ui.fragments
import android.os.Bundle
import android.text.Editable
@@ -6,12 +6,9 @@ import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.Fragment
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.databinding.FragmentAlmostThereBinding
-import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
-import com.nivesh.production.niveshfd.fd.util.Common
-import com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1.SignUpActivity
+import com.nivesh.production.partnerOnBoarding.databinding.FragmentAlmostThereBinding
+import com.nivesh.production.partnerOnBoarding.util.Common
+import com.nivesh.production.partnerOnBoarding.ui.activities.SignUpActivity
class AlmostThereFragment : BaseFragment() {
private var _binding: FragmentAlmostThereBinding? = null
@@ -95,13 +92,13 @@ class AlmostThereFragment : BaseFragment() {
}
- binding.tvTermsAndCondition.setOnClickListener{
+ binding.tvTermsAndCondition.setOnClickListener {
}
- binding.tvPrivacyPolicy.setOnClickListener{
+ binding.tvPrivacyPolicy.setOnClickListener {
}
- binding.tvAgreement.setOnClickListener{
+ binding.tvAgreement.setOnClickListener {
}
@@ -184,8 +181,8 @@ class AlmostThereFragment : BaseFragment() {
binding.tlState,
""
)
- }else if (!binding.cbCheck.isChecked) { // EditText
- return false
+ } else if (!binding.cbCheck.isChecked) { // EditText
+ return false
} else {
return true
}
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/BaseFragment.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/BaseFragment.kt
similarity index 90%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/BaseFragment.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/BaseFragment.kt
index e68d2e1..94f95ed 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/BaseFragment.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/BaseFragment.kt
@@ -1,9 +1,9 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1
+package com.nivesh.production.partnerOnBoarding.ui.fragments
import android.app.Activity
import android.content.Context
import androidx.fragment.app.Fragment
-import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
+import com.nivesh.production.partnerOnBoarding.ui.activities.BaseActivity
open class BaseFragment : Fragment() {
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/GetStartedFragment.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/GetStartedFragment.kt
similarity index 92%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/GetStartedFragment.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/GetStartedFragment.kt
index 8503b02..e402ec9 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/GetStartedFragment.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/GetStartedFragment.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1
+package com.nivesh.production.partnerOnBoarding.ui.fragments
import android.Manifest
import android.annotation.SuppressLint
@@ -27,15 +27,15 @@ import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider
import androidx.lifecycle.lifecycleScope
-import com.nivesh.production.niveshfd.BuildConfig
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.databinding.FragmentGetStartedBinding
-import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
-import com.nivesh.production.niveshfd.fd.util.Common
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.getFileExtension
-import com.nivesh.production.niveshfd.fd.util.Common.Companion.showDialogWithTwoButtons
-import com.nivesh.production.niveshfd.fd.util.ImageUtil
-import com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1.SignUpActivity
+import com.nivesh.production.partnerOnBoarding.BuildConfig
+import com.nivesh.production.partnerOnBoarding.R
+import com.nivesh.production.partnerOnBoarding.databinding.FragmentGetStartedBinding
+import com.nivesh.production.partnerOnBoarding.ui.activities.BaseActivity
+import com.nivesh.production.partnerOnBoarding.ui.activities.SignUpActivity
+import com.nivesh.production.partnerOnBoarding.util.Common
+import com.nivesh.production.partnerOnBoarding.util.Common.Companion.getFileExtension
+import com.nivesh.production.partnerOnBoarding.util.Common.Companion.showDialogWithTwoButtons
+import com.nivesh.production.partnerOnBoarding.util.ImageUtil
import java.io.*
class GetStartedFragment : BaseFragment() {
@@ -136,7 +136,7 @@ class GetStartedFragment : BaseFragment() {
divider: Char
): Boolean {
var isCorrect = s.length <= totalSymbols // check size of entered string
- for (i in 0 until s.length) { // check that every element is right
+ for (i in s.indices) { // check that every element is right
isCorrect = if (i > 0 && (i + 1) % dividerModulo == 0) {
isCorrect and (divider == s[i])
} else {
@@ -154,12 +154,12 @@ class GetStartedFragment : BaseFragment() {
var DIVIDER_POSITION: Int = DIVIDER_MODULO - 1; // means divider position is every 4th symbol beginning with 0
var DIVIDER: Char = '-'
- binding.edtEuinNumber.addTextChangedListener(object : TextWatcher{
+ binding.edtEUINNumber.addTextChangedListener(object : TextWatcher{
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
- override fun afterTextChanged(s: Editable?) {
- if (!isInputCorrect(s!!, total_SYMBOLS, DIVIDER_MODULO, DIVIDER)) {
- s?.replace(0, s.length, buildCorrectString(getDigitArray(s, TOTAL_DIGITS)!!, DIVIDER_POSITION, DIVIDER))
+ override fun afterTextChanged(s: Editable) {
+ if (!isInputCorrect(s, total_SYMBOLS, DIVIDER_MODULO, DIVIDER)) {
+ s.replace(0, s.length, buildCorrectString(getDigitArray(s, TOTAL_DIGITS), DIVIDER_POSITION, DIVIDER))
}
}
@@ -184,7 +184,7 @@ class GetStartedFragment : BaseFragment() {
digits: CharArray,
dividerPosition: Int,
divider: Char
- ): String? {
+ ): String {
val formatted = StringBuilder()
for (i in digits.indices) {
if (digits[i].code != 0) {
@@ -197,7 +197,7 @@ class GetStartedFragment : BaseFragment() {
return formatted.toString()
}
- private fun getDigitArray(s: Editable, size: Int): CharArray? {
+ private fun getDigitArray(s: Editable, size: Int): CharArray {
val digits = CharArray(size)
var index = 0
var i = 0
@@ -214,11 +214,11 @@ class GetStartedFragment : BaseFragment() {
})
-// binding.edtEuinNumber.doAfterTextChanged {
-// val formattedText = binding.edtEuinNumber.toString().replace(" ", "").chunked(4).joinToString("/")
-// if (formattedText != binding.edtEuinNumber.toString()) {
-// binding.edtEuinNumber.setText(formattedText)
-// binding.edtEuinNumber.setSelection(binding.edtEuinNumber.length())
+// binding.edtEUINNumber.doAfterTextChanged {
+// val formattedText = binding.edtEUINNumber.toString().replace(" ", "").chunked(4).joinToString("/")
+// if (formattedText != binding.edtEUINNumber.toString()) {
+// binding.edtEUINNumber.setText(formattedText)
+// binding.edtEUINNumber.setSelection(binding.edtEUINNumber.length())
// }
// }
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/NewDistributorSignStepOne.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/NewDistributorSignStepOne.kt
similarity index 81%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/NewDistributorSignStepOne.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/NewDistributorSignStepOne.kt
index 553da97..39cffa7 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/NewDistributorSignStepOne.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/NewDistributorSignStepOne.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1
+package com.nivesh.production.partnerOnBoarding.ui.fragments
import android.os.Bundle
import android.view.LayoutInflater
@@ -6,9 +6,9 @@ import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
-import com.nivesh.production.niveshfd.databinding.NewDistributorSignStepOneBinding
-import com.nivesh.production.niveshfd.partnerOnBoarding.adapters1.NewDistributorSignStepOneAdapter
-import com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1.SignUpActivity
+import com.nivesh.production.partnerOnBoarding.databinding.NewDistributorSignStepOneBinding
+import com.nivesh.production.partnerOnBoarding.adapters.NewDistributorSignStepOneAdapter
+import com.nivesh.production.partnerOnBoarding.ui.activities.SignUpActivity
class NewDistributorSignStepOne : BaseFragment(){
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/OTPFragment.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/OTPFragment.kt
similarity index 95%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/OTPFragment.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/OTPFragment.kt
index 4e80216..f12383e 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/OTPFragment.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/OTPFragment.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1
+package com.nivesh.production.partnerOnBoarding.ui.fragments
import android.os.Bundle
import android.text.Editable
@@ -10,10 +10,10 @@ import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import androidx.fragment.app.Fragment
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.databinding.FragmentOtpBinding
-import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
-import com.nivesh.production.niveshfd.fd.util.Common
+import com.nivesh.production.partnerOnBoarding.R
+import com.nivesh.production.partnerOnBoarding.databinding.FragmentOtpBinding
+import com.nivesh.production.partnerOnBoarding.ui.activities.BaseActivity
+import com.nivesh.production.partnerOnBoarding.util.Common
class OTPFragment : BaseFragment() {
private var _binding: FragmentOtpBinding? = null
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/SignUpFragment.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/SignUpFragment.kt
similarity index 78%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/SignUpFragment.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/SignUpFragment.kt
index d97aef4..da97994 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/SignUpFragment.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/SignUpFragment.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1
+package com.nivesh.production.partnerOnBoarding.ui.fragments
import android.os.Bundle
import android.text.Editable
@@ -7,11 +7,9 @@ import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.Fragment
-import com.nivesh.production.niveshfd.databinding.FragmentSignupBinding
-import com.nivesh.production.niveshfd.fd.ui.activity.BaseActivity
-import com.nivesh.production.niveshfd.fd.util.Common
-
+import com.nivesh.production.partnerOnBoarding.databinding.FragmentSignupBinding
+import com.nivesh.production.partnerOnBoarding.ui.activities.BaseActivity
+import com.nivesh.production.partnerOnBoarding.util.Common
class SignUpFragment : BaseFragment() {
private var _binding: FragmentSignupBinding? = null
@@ -45,13 +43,13 @@ class SignUpFragment : BaseFragment() {
binding.btnSignUp.setOnClickListener {
if (validate()) {
val bundle = Bundle()
- bundle.putInt("type",type!!)
+ bundle.putInt("type", type!!)
val fragment = OTPFragment()
fragment.arguments = bundle
replaceFragment(
activity as BaseActivity,
- com.nivesh.production.niveshfd.R.id.signUpContainer,
+ com.nivesh.production.partnerOnBoarding.R.id.signUpContainer,
fragment,
"OTP",
true
@@ -66,19 +64,19 @@ class SignUpFragment : BaseFragment() {
Common.commonErrorMethod(
binding.edtMobileNumber,
binding.tlMobileNumber,
- getString(com.nivesh.production.niveshfd.R.string.emptyMobileNumber)
+ getString(com.nivesh.production.partnerOnBoarding.R.string.emptyMobileNumber)
)
} else if (binding.edtMobileNumber.text?.length != 10) { // EditText
Common.commonErrorMethod(
binding.edtMobileNumber,
binding.tlMobileNumber,
- getString(com.nivesh.production.niveshfd.R.string.inValidMobileNumber)
+ getString(com.nivesh.production.partnerOnBoarding.R.string.inValidMobileNumber)
)
} else if (!Common.isIndianMobileNo(binding.edtMobileNumber.text.toString())) { // EditText
Common.commonErrorMethod(
binding.edtMobileNumber,
binding.tlMobileNumber,
- getString(com.nivesh.production.niveshfd.R.string.inValidIndianMobileNumber)
+ getString(com.nivesh.production.partnerOnBoarding.R.string.inValidIndianMobileNumber)
)
} else {
return true
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/StepOnePagerFragment.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/StepOnePagerFragment.kt
similarity index 72%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/StepOnePagerFragment.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/StepOnePagerFragment.kt
index 989a596..e534d61 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/StepOnePagerFragment.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/StepOnePagerFragment.kt
@@ -1,13 +1,12 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1
+package com.nivesh.production.partnerOnBoarding.ui.fragments
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
-import com.nivesh.production.niveshfd.databinding.FragmentPagerStepOneBinding
-import com.nivesh.production.niveshfd.fd.ui.activity.NiveshFdMainActivity
-import com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1.ViewPagerActivity
+import com.nivesh.production.partnerOnBoarding.databinding.FragmentPagerStepOneBinding
+import com.nivesh.production.partnerOnBoarding.ui.activities.ViewPagerActivity
class StepOnePagerFragment : Fragment() {
private var _binding: FragmentPagerStepOneBinding? = null
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/StepThreePagerFragment.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/StepThreePagerFragment.kt
similarity index 80%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/StepThreePagerFragment.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/StepThreePagerFragment.kt
index 447f122..0a2d44e 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/StepThreePagerFragment.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/StepThreePagerFragment.kt
@@ -1,12 +1,12 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1
+package com.nivesh.production.partnerOnBoarding.ui.fragments
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
-import com.nivesh.production.niveshfd.databinding.FragmentPagerStepThreeBinding
-import com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1.ViewPagerActivity
+import com.nivesh.production.partnerOnBoarding.databinding.FragmentPagerStepThreeBinding
+import com.nivesh.production.partnerOnBoarding.ui.activities.ViewPagerActivity
class StepThreePagerFragment : Fragment() {
private var _binding: FragmentPagerStepThreeBinding? = null
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/StepTwoPagerFragment.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/StepTwoPagerFragment.kt
similarity index 80%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/StepTwoPagerFragment.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/StepTwoPagerFragment.kt
index 4691a08..b6fabc9 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/ui/fragments1/StepTwoPagerFragment.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/ui/fragments/StepTwoPagerFragment.kt
@@ -1,12 +1,12 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1
+package com.nivesh.production.partnerOnBoarding.ui.fragments
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
-import com.nivesh.production.niveshfd.databinding.FragmentPagerStepTwoBinding
-import com.nivesh.production.niveshfd.partnerOnBoarding.ui.activities1.ViewPagerActivity
+import com.nivesh.production.partnerOnBoarding.databinding.FragmentPagerStepTwoBinding
+import com.nivesh.production.partnerOnBoarding.ui.activities.ViewPagerActivity
class StepTwoPagerFragment : Fragment() {
private var _binding: FragmentPagerStepTwoBinding? = null
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/Colors.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Colors.kt
similarity index 54%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/util/Colors.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Colors.kt
index 8ac474f..2c71a1a 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/Colors.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Colors.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.fd.util
+package com.nivesh.production.partnerOnBoarding.util
object Colors {
const val colorDefault: String = "#17A31D"
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/Common.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Common.kt
similarity index 72%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/util/Common.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Common.kt
index 9814f22..f16fdd4 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/Common.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Common.kt
@@ -1,44 +1,30 @@
-package com.nivesh.production.niveshfd.fd.util
+package com.nivesh.production.partnerOnBoarding.util
-import android.Manifest
-import android.annotation.SuppressLint
import android.app.Activity
import android.app.AlertDialog
import android.app.Dialog
import android.content.Context
import android.content.Intent
-import android.content.pm.PackageManager
import android.graphics.Color
import android.graphics.drawable.GradientDrawable
-import android.hardware.display.DisplayManager
import android.net.ConnectivityManager
import android.net.NetworkCapabilities
import android.net.Uri
import android.os.Build
import android.provider.Settings
-import android.telephony.TelephonyManager
-import android.text.TextUtils
import android.text.format.DateFormat
-import android.util.DisplayMetrics
import android.util.Log
import android.util.Patterns
-import android.view.Display
import android.view.Gravity
import android.view.Window
import android.webkit.WebView
-import android.webkit.WebViewClient
import android.widget.ImageView
import androidx.appcompat.app.ActionBar
-import androidx.core.app.ActivityCompat
-import androidx.core.content.ContextCompat.getSystemService
-import androidx.core.hardware.display.DisplayManagerCompat
import com.google.android.material.textfield.MaterialAutoCompleteTextView
import com.google.android.material.textfield.TextInputEditText
import com.google.android.material.textfield.TextInputLayout
import com.google.gson.JsonObject
-import com.nivesh.production.niveshfd.R
-import com.nivesh.production.niveshfd.fd.model.DeviceInfo
-import com.nivesh.production.niveshfd.fd.ui.activity.NiveshFdMainActivity
+import com.nivesh.production.partnerOnBoarding.R
import kotlinx.coroutines.CoroutineExceptionHandler
import org.json.JSONObject
import retrofit2.HttpException
@@ -148,7 +134,7 @@ class Common {
builder.show()
}
- fun showWebViewDialogBottom(context: Context, url: String,height: Int){
+ fun showWebViewDialogBottom(context: Context, url: String, height: Int) {
val dialog = Dialog(context)
dialog.window?.setBackgroundDrawableResource(android.R.color.transparent)
dialog.setContentView(R.layout.web_view_bottom_dialog)
@@ -167,7 +153,7 @@ class Common {
dialog.show()
val window: Window = dialog.window!!
window.setGravity(Gravity.BOTTOM)
- window.setLayout(ActionBar.LayoutParams.MATCH_PARENT,(height-400))
+ window.setLayout(ActionBar.LayoutParams.MATCH_PARENT, (height - 400))
window.setWindowAnimations(R.style.DialogBottomAnimation)
}
@@ -181,7 +167,7 @@ class Common {
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts(
"package",
- (activity as NiveshFdMainActivity).packageName,
+ (activity).packageName,
null
)
)
@@ -323,88 +309,5 @@ class Common {
""
}
}
-
-
- @SuppressLint("HardwareIds")
- fun getDeviceInfo(mContext: Context): DeviceInfo {
- val deviceInfo = DeviceInfo()
- var deviceId: String? = ""
- try {
- val telephonyManager =
- mContext.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
- deviceInfo.device_model = if (TextUtils.isEmpty(Build.DEVICE)) "" else Build.DEVICE
- deviceInfo.device_os_version =
- if (TextUtils.isEmpty(Build.VERSION.RELEASE)) "" else Build.VERSION.RELEASE
- deviceInfo.device_name = if (TextUtils.isEmpty(Build.PRODUCT)) "" else Build.PRODUCT
- deviceInfo.device_type = "Android"
-
- if ((deviceId == null) || deviceId.isEmpty() || deviceId.equals(
- "unknown",
- ignoreCase = true
- )
- ) {
- deviceId = if (TextUtils.isEmpty(
- Settings.Secure.getString(
- mContext.contentResolver,
- Settings.Secure.ANDROID_ID
- )
- )
- ) "" else Settings.Secure.getString(
- mContext.contentResolver,
- Settings.Secure.ANDROID_ID
- )
- }
- // deviceInfo.device_id = device_id + "#" + preferenceHelper.getAppName()
- deviceInfo.device_id_for_UMSId = deviceId
- // deviceInfo.sdk_version = com.nivesh.production.BuildConfig.VERSION_NAME
-
- if (ActivityCompat.checkSelfPermission(
- mContext,
- Manifest.permission.READ_PHONE_STATE
- ) != PackageManager.PERMISSION_GRANTED
- ) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- deviceId = telephonyManager.imei
- if (deviceId == null) {
- deviceId =
- if (TextUtils.isEmpty(Build.getSerial())) "" else Build.getSerial()
- }
- } else {
- deviceId = telephonyManager.deviceId
- if (deviceId == null) {
- deviceId =
- if (TextUtils.isEmpty(Build.SERIAL)) "" else Build.SERIAL
- }
- }
- } else {
- deviceId = telephonyManager.deviceId
- if (deviceId == null) {
- deviceId = if (TextUtils.isEmpty(Build.SERIAL)) "" else Build.SERIAL
- }
- }
-
- } catch (e: Exception) {
- e.printStackTrace()
- if ((deviceId == null) || deviceId.isEmpty() || deviceId.equals(
- "unknown",
- ignoreCase = true
- )
- ) {
- deviceId = if (TextUtils.isEmpty(
- Settings.Secure.getString(
- mContext.contentResolver,
- Settings.Secure.ANDROID_ID
- )
- )
- ) "" else Settings.Secure.getString(
- mContext.contentResolver,
- Settings.Secure.ANDROID_ID
- )
- }
- // deviceInfo.deviceId = device_id + "#" + preferenceHelper.getAppName()
- deviceInfo.device_id_for_UMSId = deviceId
- }
- return deviceInfo
- }
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/Constants.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Constants.kt
similarity index 83%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/util/Constants.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Constants.kt
index 8cebc6f..a192f54 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/Constants.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Constants.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.fd.util
+package com.nivesh.production.partnerOnBoarding.util
class Constants() {
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/ImageUtil.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/ImageUtil.kt
similarity index 93%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/util/ImageUtil.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/util/ImageUtil.kt
index 092a38f..cfad66b 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/ImageUtil.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/ImageUtil.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.fd.util
+package com.nivesh.production.partnerOnBoarding.util
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/util/MaskWatcher.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/MaskWatcher.kt
similarity index 94%
rename from app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/util/MaskWatcher.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/util/MaskWatcher.kt
index bd3a48f..bc15ce5 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/partnerOnBoarding/util/MaskWatcher.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/MaskWatcher.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.partnerOnBoarding.util
+package com.nivesh.production.partnerOnBoarding.util
import android.text.Editable
import android.text.TextWatcher
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/ProgressUtil.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/ProgressUtil.kt
similarity index 97%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/util/ProgressUtil.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/util/ProgressUtil.kt
index 93a3cbb..c97d876 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/ProgressUtil.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/ProgressUtil.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.fd.util
+package com.nivesh.production.partnerOnBoarding.util
import android.annotation.SuppressLint
import android.app.AlertDialog
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/Resource.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Resource.kt
similarity index 88%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/util/Resource.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Resource.kt
index 45d82cd..538891a 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/util/Resource.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/util/Resource.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd.fd.util
+package com.nivesh.production.partnerOnBoarding.util
sealed class Resource(
val data: T? = null,
diff --git a/app/src/main/java/com/nivesh/production/niveshfd/fd/viewModel/MyObseravble.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/viewModels/MyObservable.kt
similarity index 65%
rename from app/src/main/java/com/nivesh/production/niveshfd/fd/viewModel/MyObseravble.kt
rename to app/src/main/java/com/nivesh/production/partnerOnBoarding/viewModels/MyObservable.kt
index 94bb929..562e7ce 100644
--- a/app/src/main/java/com/nivesh/production/niveshfd/fd/viewModel/MyObseravble.kt
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/viewModels/MyObservable.kt
@@ -1,9 +1,9 @@
-package com.nivesh.production.niveshfd.fd.viewModel
+package com.nivesh.production.partnerOnBoarding.viewModels
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
-open class MyObseravble : ViewModel()
+open class MyObservable : ViewModel()
{
val data = MutableLiveData()
fun data(item: String) {
diff --git a/app/src/main/java/com/nivesh/production/partnerOnBoarding/viewModels/OnBoardingViewModel.kt b/app/src/main/java/com/nivesh/production/partnerOnBoarding/viewModels/OnBoardingViewModel.kt
new file mode 100644
index 0000000..abfb055
--- /dev/null
+++ b/app/src/main/java/com/nivesh/production/partnerOnBoarding/viewModels/OnBoardingViewModel.kt
@@ -0,0 +1,32 @@
+package com.nivesh.production.partnerOnBoarding.viewModels
+
+import androidx.lifecycle.ViewModel
+import com.nivesh.production.partnerOnBoarding.repositories.MainRepository
+
+open class OnBoardingViewModel(private val mainRepository: MainRepository) : ViewModel() {
+
+// val getStepsCountMutableData: MutableLiveData> = MutableLiveData()
+// fun getStepsCount(
+// requestBody: FDStepsCountRequest,
+// token: String,
+// activity: Activity
+// ) = viewModelScope.launch(handleError(activity)) {
+// if (Common.isNetworkAvailable(activity)) {
+// getStepsCountMutableData.postValue(Resource.Loading())
+// val response = mainRepository.getStepsCountResponse(requestBody, token)
+// getStepsCountMutableData.postValue(handleResponse(response))
+// }
+// }
+//
+// val getClientDetailsMutableData: MutableLiveData> = MutableLiveData()
+// fun getClientDetails(getClientDetailsRequest: getClientDetailsRequest, token: String, activity: Activity) =
+// viewModelScope.launch(handleError(activity)) {
+// if (Common.isNetworkAvailable(activity)) {
+// getClientDetailsMutableData.postValue(Resource.Loading())
+// val response =
+// mainRepository.getClientDetailsResponse(getClientDetailsRequest, token)
+// getClientDetailsMutableData.postValue(handleResponse(response))
+// }
+// }
+
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/bajaj_logo.png b/app/src/main/res/drawable/bajaj_logo.png
deleted file mode 100644
index 906f1fc..0000000
Binary files a/app/src/main/res/drawable/bajaj_logo.png and /dev/null differ
diff --git a/app/src/main/res/drawable/camera.png b/app/src/main/res/drawable/camera.png
deleted file mode 100644
index 6ea6bca..0000000
Binary files a/app/src/main/res/drawable/camera.png and /dev/null differ
diff --git a/app/src/main/res/drawable/card_bg.xml b/app/src/main/res/drawable/card_bg.xml
deleted file mode 100644
index 3e643f0..0000000
--- a/app/src/main/res/drawable/card_bg.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/cursor_color.xml b/app/src/main/res/drawable/cursor_color.xml
deleted file mode 100644
index 0ec4a7a..0000000
--- a/app/src/main/res/drawable/cursor_color.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/dot_background.xml b/app/src/main/res/drawable/dot_background.xml
deleted file mode 100644
index 012bf8b..0000000
--- a/app/src/main/res/drawable/dot_background.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/gallery.png b/app/src/main/res/drawable/gallery.png
deleted file mode 100644
index d309f3e..0000000
Binary files a/app/src/main/res/drawable/gallery.png and /dev/null differ
diff --git a/app/src/main/res/drawable/ic_add_icon.xml b/app/src/main/res/drawable/ic_add_icon.xml
deleted file mode 100644
index a6bdf84..0000000
--- a/app/src/main/res/drawable/ic_add_icon.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/ic_arrow_down.xml b/app/src/main/res/drawable/ic_arrow_down.xml
deleted file mode 100644
index bf94fc1..0000000
--- a/app/src/main/res/drawable/ic_arrow_down.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/ic_baseline_check_24.xml b/app/src/main/res/drawable/ic_baseline_check_24.xml
deleted file mode 100644
index eb14651..0000000
--- a/app/src/main/res/drawable/ic_baseline_check_24.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_minus.xml b/app/src/main/res/drawable/ic_minus.xml
deleted file mode 100644
index f465978..0000000
--- a/app/src/main/res/drawable/ic_minus.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/ic_select_green.xml b/app/src/main/res/drawable/ic_select_green.xml
deleted file mode 100644
index c3bb144..0000000
--- a/app/src/main/res/drawable/ic_select_green.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/ic_select_outline.xml b/app/src/main/res/drawable/ic_select_outline.xml
deleted file mode 100644
index 35bec46..0000000
--- a/app/src/main/res/drawable/ic_select_outline.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/round_corner_button.xml b/app/src/main/res/drawable/round_corner_button.xml
deleted file mode 100644
index 5cb1b17..0000000
--- a/app/src/main/res/drawable/round_corner_button.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/round_corner_grey_button.xml b/app/src/main/res/drawable/round_corner_grey_button.xml
index 5ffb80a..e9c7cbf 100644
--- a/app/src/main/res/drawable/round_corner_grey_button.xml
+++ b/app/src/main/res/drawable/round_corner_grey_button.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/app/src/main/res/drawable/round_corner_grey_button_fill.xml b/app/src/main/res/drawable/round_corner_grey_button_fill.xml
index 2120174..81bb4d2 100644
--- a/app/src/main/res/drawable/round_corner_grey_button_fill.xml
+++ b/app/src/main/res/drawable/round_corner_grey_button_fill.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/app/src/main/res/drawable/round_corner_with_red_bg.xml b/app/src/main/res/drawable/round_corner_with_red_bg.xml
deleted file mode 100644
index 641fd21..0000000
--- a/app/src/main/res/drawable/round_corner_with_red_bg.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/drawable/rounded_corner_green_fill.xml b/app/src/main/res/drawable/rounded_corner_green_fill.xml
deleted file mode 100644
index 0f43eb7..0000000
--- a/app/src/main/res/drawable/rounded_corner_green_fill.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/rounded_corner_with_line_blue.xml b/app/src/main/res/drawable/rounded_corner_with_line_blue.xml
deleted file mode 100644
index 7b54a02..0000000
--- a/app/src/main/res/drawable/rounded_corner_with_line_blue.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/sp_bg.xml b/app/src/main/res/drawable/sp_bg.xml
deleted file mode 100644
index 1a4b686..0000000
--- a/app/src/main/res/drawable/sp_bg.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
- -
-
-
- -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/svg_back.xml b/app/src/main/res/drawable/svg_back.xml
deleted file mode 100644
index 13ba1de..0000000
--- a/app/src/main/res/drawable/svg_back.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/svg_cal.xml b/app/src/main/res/drawable/svg_cal.xml
deleted file mode 100644
index 3773633..0000000
--- a/app/src/main/res/drawable/svg_cal.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/svg_camera.xml b/app/src/main/res/drawable/svg_camera.xml
deleted file mode 100644
index 48a8a01..0000000
--- a/app/src/main/res/drawable/svg_camera.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
diff --git a/app/src/main/res/drawable/svg_cross.xml b/app/src/main/res/drawable/svg_cross.xml
deleted file mode 100644
index 5e8560a..0000000
--- a/app/src/main/res/drawable/svg_cross.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/svg_down_arrow.xml b/app/src/main/res/drawable/svg_down_arrow.xml
deleted file mode 100644
index 9e345b8..0000000
--- a/app/src/main/res/drawable/svg_down_arrow.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/svg_grey_bullet.xml b/app/src/main/res/drawable/svg_grey_bullet.xml
deleted file mode 100644
index 214aae6..0000000
--- a/app/src/main/res/drawable/svg_grey_bullet.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/svg_image.xml b/app/src/main/res/drawable/svg_image.xml
deleted file mode 100644
index 3ffb603..0000000
--- a/app/src/main/res/drawable/svg_image.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/svg_rect_dot.xml b/app/src/main/res/drawable/svg_rect_dot.xml
deleted file mode 100644
index 796b04e..0000000
--- a/app/src/main/res/drawable/svg_rect_dot.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/svg_rs.xml b/app/src/main/res/drawable/svg_rs.xml
deleted file mode 100644
index 83c522d..0000000
--- a/app/src/main/res/drawable/svg_rs.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/svg_star.xml b/app/src/main/res/drawable/svg_star.xml
deleted file mode 100644
index 8218c21..0000000
--- a/app/src/main/res/drawable/svg_star.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/svg_step_process.xml b/app/src/main/res/drawable/svg_step_process.xml
deleted file mode 100644
index 53c595f..0000000
--- a/app/src/main/res/drawable/svg_step_process.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/upload_background.xml b/app/src/main/res/drawable/upload_background.xml
deleted file mode 100644
index 6a02ce4..0000000
--- a/app/src/main/res/drawable/upload_background.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_nivesh_fd.xml b/app/src/main/res/layout/activity_nivesh_fd.xml
deleted file mode 100644
index 5e47de6..0000000
--- a/app/src/main/res/layout/activity_nivesh_fd.xml
+++ /dev/null
@@ -1,158 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_viewpager.xml b/app/src/main/res/layout/activity_viewpager.xml
index babf141..41141ac 100644
--- a/app/src/main/res/layout/activity_viewpager.xml
+++ b/app/src/main/res/layout/activity_viewpager.xml
@@ -5,7 +5,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/camera_gallery_layout.xml b/app/src/main/res/layout/camera_gallery_layout.xml
deleted file mode 100644
index eda34a7..0000000
--- a/app/src/main/res/layout/camera_gallery_layout.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/dot_layout.xml b/app/src/main/res/layout/dot_layout.xml
deleted file mode 100644
index 29e330c..0000000
--- a/app/src/main/res/layout/dot_layout.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_get_started.xml b/app/src/main/res/layout/fragment_get_started.xml
index 6463d27..c9e5059 100644
--- a/app/src/main/res/layout/fragment_get_started.xml
+++ b/app/src/main/res/layout/fragment_get_started.xml
@@ -85,7 +85,7 @@
+ app:layout_constraintTop_toBottomOf="@+id/tlEUINNumber">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_niveshfd_step_four.xml b/app/src/main/res/layout/fragment_niveshfd_step_four.xml
deleted file mode 100644
index 17e5520..0000000
--- a/app/src/main/res/layout/fragment_niveshfd_step_four.xml
+++ /dev/null
@@ -1,297 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_niveshfd_step_one.xml b/app/src/main/res/layout/fragment_niveshfd_step_one.xml
deleted file mode 100644
index 115d0dd..0000000
--- a/app/src/main/res/layout/fragment_niveshfd_step_one.xml
+++ /dev/null
@@ -1,389 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_niveshfd_step_three.xml b/app/src/main/res/layout/fragment_niveshfd_step_three.xml
deleted file mode 100644
index 6ecf090..0000000
--- a/app/src/main/res/layout/fragment_niveshfd_step_three.xml
+++ /dev/null
@@ -1,331 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_niveshfd_step_two.xml b/app/src/main/res/layout/fragment_niveshfd_step_two.xml
deleted file mode 100644
index e8b4df0..0000000
--- a/app/src/main/res/layout/fragment_niveshfd_step_two.xml
+++ /dev/null
@@ -1,1117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_pager_step_one.xml b/app/src/main/res/layout/fragment_pager_step_one.xml
index 2a8c176..b4b082d 100644
--- a/app/src/main/res/layout/fragment_pager_step_one.xml
+++ b/app/src/main/res/layout/fragment_pager_step_one.xml
@@ -7,7 +7,7 @@
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="@drawable/pager_1"
- tool:context="com.nivesh.production.niveshfd.partnerOnBoarding.ui.fragments1.StepOnePagerFragment">
+ tool:context="com.nivesh.production.partnerOnBoarding.ui.fragments.StepOnePagerFragment">
+ tool:context="com.nivesh.production.partnerOnBoarding.ui.fragments.StepThreePagerFragment">
+ tool:context="com.nivesh.production.partnerOnBoarding.ui.fragments.StepTwoPagerFragment">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/item_customer_list_preview.xml b/app/src/main/res/layout/item_customer_list_preview.xml
deleted file mode 100644
index 7261299..0000000
--- a/app/src/main/res/layout/item_customer_list_preview.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/item_payment_list_preview.xml b/app/src/main/res/layout/item_payment_list_preview.xml
deleted file mode 100644
index 5b9e9ca..0000000
--- a/app/src/main/res/layout/item_payment_list_preview.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/layout_bank_list.xml b/app/src/main/res/layout/layout_bank_list.xml
deleted file mode 100644
index 8893b1a..0000000
--- a/app/src/main/res/layout/layout_bank_list.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/row_bank_list.xml b/app/src/main/res/layout/row_bank_list.xml
deleted file mode 100644
index e109dab..0000000
--- a/app/src/main/res/layout/row_bank_list.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/row_dropdown.xml b/app/src/main/res/layout/row_dropdown.xml
deleted file mode 100644
index b2cb3d3..0000000
--- a/app/src/main/res/layout/row_dropdown.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/row_fd_pay1.xml b/app/src/main/res/layout/row_fd_pay1.xml
deleted file mode 100644
index a255157..0000000
--- a/app/src/main/res/layout/row_fd_pay1.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/spinner_dropdown.xml b/app/src/main/res/layout/spinner_dropdown.xml
deleted file mode 100644
index 599a9bc..0000000
--- a/app/src/main/res/layout/spinner_dropdown.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml
index fa0f996..9157acd 100644
--- a/app/src/main/res/xml/backup_rules.xml
+++ b/app/src/main/res/xml/backup_rules.xml
@@ -6,8 +6,4 @@
See https://developer.android.com/about/versions/12/backup-restore
-->
-
\ No newline at end of file
diff --git a/app/src/test/java/com/nivesh/production/bajajfd/ExampleUnitTest.kt b/app/src/test/java/com/nivesh/production/bajajfd/ExampleUnitTest.kt
index 18dd35b..82b521e 100644
--- a/app/src/test/java/com/nivesh/production/bajajfd/ExampleUnitTest.kt
+++ b/app/src/test/java/com/nivesh/production/bajajfd/ExampleUnitTest.kt
@@ -1,4 +1,4 @@
-package com.nivesh.production.niveshfd
+package com.nivesh.production.partnerOnBoarding
import org.junit.Test