From 151e860030a56aebff7d8ef55e275640a0c0cd97 Mon Sep 17 00:00:00 2001 From: Hemant Khadase Date: Fri, 6 Jan 2023 12:57:42 +0530 Subject: [PATCH 1/2] added missing code --- .../bajajfd/adapter/BankListAdapter.kt | 29 ++-------- .../ui/activity/BajajFdMainActivity.kt | 53 +++++++++---------- .../ui/fragment/StepTwoBajajFDFragment.kt | 48 +++++++++++------ 3 files changed, 61 insertions(+), 69 deletions(-) diff --git a/app/src/main/java/com/nivesh/production/bajajfd/adapter/BankListAdapter.kt b/app/src/main/java/com/nivesh/production/bajajfd/adapter/BankListAdapter.kt index 45a053f..814139f 100644 --- a/app/src/main/java/com/nivesh/production/bajajfd/adapter/BankListAdapter.kt +++ b/app/src/main/java/com/nivesh/production/bajajfd/adapter/BankListAdapter.kt @@ -23,28 +23,14 @@ class BankListAdapter( } private var checkedPosition: Int = -2 - override fun onCreateViewHolder( parent: ViewGroup, viewType: Int ): BankListViewHolder { -// return BankListViewHolder( -// LayoutInflater.from(parent.context).inflate( -// R.layout.item_bank_list_preview, -// parent, -// false -// ) -// ) - - - 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) { @@ -55,20 +41,14 @@ class BankListAdapter( holder.tvBankIFSC.text = bankList.IFSCCode holder.tvBankAccountNumber.text = bankList.AccountNumber - if (selectedAccount == bankList.AccountNumber && (checkedPosition == -2)) - { + if (selectedAccount == bankList.AccountNumber && (checkedPosition == -2)) { holder.bankSelector.setBackgroundResource(R.drawable.ic_select_green) checkedPosition = holder.adapterPosition - - } - else if (checkedPosition == -1) { + } else if (checkedPosition == -1) { holder.bankSelector.setBackgroundResource(R.drawable.ic_select_outline) - } - else if (checkedPosition == holder.adapterPosition) { + } else if (checkedPosition == holder.adapterPosition) { holder.bankSelector.setBackgroundResource(R.drawable.ic_select_green) - } - - else { + } else { holder.bankSelector.setBackgroundResource(R.drawable.ic_select_outline) } @@ -93,7 +73,6 @@ class BankListAdapter( onItemClickListener = listener } - fun getSelected(): ClientBanklist? { return if (checkedPosition != -1) { bankList?.get(checkedPosition) diff --git a/app/src/main/java/com/nivesh/production/bajajfd/ui/activity/BajajFdMainActivity.kt b/app/src/main/java/com/nivesh/production/bajajfd/ui/activity/BajajFdMainActivity.kt index 01f1eab..fa7b4da 100644 --- a/app/src/main/java/com/nivesh/production/bajajfd/ui/activity/BajajFdMainActivity.kt +++ b/app/src/main/java/com/nivesh/production/bajajfd/ui/activity/BajajFdMainActivity.kt @@ -226,7 +226,7 @@ class BajajFdMainActivity : BaseActivity() { // set viewPager sectionsPagerAdapter = SectionsPagerAdapter(supportFragmentManager, fragments, stepsCount) val viewPager: DisableAdapter = binding.viewPager - // viewPager.setPagingEnabled(false) + viewPager.setPagingEnabled(false) viewPager.adapter = sectionsPagerAdapter viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { override fun onPageScrolled( @@ -392,35 +392,34 @@ class BajajFdMainActivity : BaseActivity() { fun paymentDialog(payUrl: String, value: String) { Log.e("payUrl", "-->$payUrl") Log.e("value", "-->$value") - val dialogWebView = Dialog(this@BajajFdMainActivity) - dialogWebView.setContentView(R.layout.row_fd_pay) - dialogWebView.setCancelable(true) - - val tvCancel = dialogWebView.findViewById(R.id.tvCancel) - tvCancel.setOnClickListener { - dialogWebView.dismiss() - } +// val dialogWebView = Dialog(this@BajajFdMainActivity) +// dialogWebView.setContentView(R.layout.row_fd_pay) +// 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.webViewClient = MyWebViewClient() +// wVPay.settings.javaScriptEnabled = true +// wVPay.settings.domStorageEnabled = true +// val postData = "name=${URLEncoder.encode("msg", "UTF-8")}" + +// "&value=${URLEncoder.encode(value, "UTF-8")}" +// wVPay.postUrl(payUrl, postData.toByteArray()) +// dialogWebView.show() - 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.webViewClient = MyWebViewClient() - wVPay.settings.javaScriptEnabled = true - wVPay.settings.domStorageEnabled = true - // wVPay.loadUrl(payUrl) + val webView = WebView(this@BajajFdMainActivity) + setContentView(webView) val postData = "name=${URLEncoder.encode("msg", "UTF-8")}" + "&value=${URLEncoder.encode(value, "UTF-8")}" - wVPay.postUrl(payUrl, postData.toByteArray()) - dialogWebView.show() - -// val webView = WebView(this@BajajFdMainActivity) -// val postData = "type=${URLEncoder.encode("hidden", "UTF-8")}" + -// "name=${URLEncoder.encode("msg", "UTF-8")}" + -// "&value=${URLEncoder.encode(value, "UTF-8")}" -// webView.postUrl(payUrl, postData.toByteArray()) + webView.postUrl(payUrl, postData.toByteArray()) } class MyWebViewClient : WebViewClient() { diff --git a/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt index cd7f568..0d8bb05 100644 --- a/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt +++ b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt @@ -44,6 +44,7 @@ import com.nivesh.production.bajajfd.util.Common.Companion.isValidEmail import com.nivesh.production.bajajfd.util.Common.Companion.isValidName import com.nivesh.production.bajajfd.util.Common.Companion.isValidPan import com.nivesh.production.bajajfd.util.Common.Companion.removeError +import com.nivesh.production.bajajfd.util.Common.Companion.showDialogValidation import com.nivesh.production.bajajfd.util.Constants.Companion.token import com.nivesh.production.bajajfd.util.Resource import com.nivesh.production.bajajfd.viewModel.StepTwoBajajFDViewModel @@ -548,23 +549,12 @@ class StepTwoBajajFDFragment : BaseFragment() { } binding.addBankDetail.setOnClickListener { - if (binding.llBankDetails.visibility == View.GONE) { - binding.llBankDetails.visibility = View.VISIBLE - binding.addBankDetail.setCompoundDrawablesWithIntrinsicBounds( - 0, - 0, - R.drawable.ic_minus, - 0 - ) - + if (bankListAdapter.itemCount == 5) { + showDialogValidation(mActivity, "You Can Not Add More Than Five Account") } else { binding.llBankDetails.visibility = View.GONE - binding.addBankDetail.setCompoundDrawablesWithIntrinsicBounds( - 0, - 0, - R.drawable.ic_add_icon, - 0 - ) + binding.addBankDetail.setCompoundDrawablesWithIntrinsicBounds(0,0,R.drawable.ic_add_icon,0) + showHideBankDetail() } } @@ -943,18 +933,21 @@ class StepTwoBajajFDFragment : BaseFragment() { listOfBanks, clientBankList.AccountNumber.toString() ) + showHideBankDetail() } else { - Common.showDialogValidation( + showDialogValidation( activity as BajajFdMainActivity, getBankValidationApiResponse.Message ) + showHideBankDetail() } } else -> { - Common.showDialogValidation( + showDialogValidation( activity as BajajFdMainActivity, getBankValidationApiResponse.Message ) + showHideBankDetail() } } } @@ -1985,6 +1978,27 @@ class StepTwoBajajFDFragment : BaseFragment() { } } + 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 From f8d58f7d6a2cff11797be8121cd923b1ce5f6805 Mon Sep 17 00:00:00 2001 From: Hemant Khadase Date: Fri, 6 Jan 2023 13:15:23 +0530 Subject: [PATCH 2/2] added manoj's code --- .../bajajfd/adapter/BankListAdapter.kt | 11 +- .../ui/fragment/StepThreeBajajFDFragment.kt | 152 +++++++++--------- .../ui/fragment/StepTwoBajajFDFragment.kt | 6 +- 3 files changed, 81 insertions(+), 88 deletions(-) diff --git a/app/src/main/java/com/nivesh/production/bajajfd/adapter/BankListAdapter.kt b/app/src/main/java/com/nivesh/production/bajajfd/adapter/BankListAdapter.kt index 814139f..0fe96b9 100644 --- a/app/src/main/java/com/nivesh/production/bajajfd/adapter/BankListAdapter.kt +++ b/app/src/main/java/com/nivesh/production/bajajfd/adapter/BankListAdapter.kt @@ -7,13 +7,12 @@ import android.widget.ImageView import android.widget.TextView import androidx.recyclerview.widget.RecyclerView import com.nivesh.production.bajajfd.R -import com.nivesh.production.bajajfd.model.BankList import com.nivesh.production.bajajfd.model.ClientBanklist class BankListAdapter( private val bankList: List?, private val selectedAccount: String? = null, - private val width:Double? + private val width: Double? ) : RecyclerView.Adapter() { inner class BankListViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { val bankSelector: ImageView = itemView.findViewById(R.id.bankSelector) @@ -21,21 +20,23 @@ class BankListAdapter( 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); + 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) } + ?.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) { + if (bankList != null) { holder.itemView.apply { holder.tvBankName.text = bankList.BankName holder.tvBankIFSC.text = bankList.IFSCCode diff --git a/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepThreeBajajFDFragment.kt b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepThreeBajajFDFragment.kt index 3c261be..66778d7 100644 --- a/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepThreeBajajFDFragment.kt +++ b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepThreeBajajFDFragment.kt @@ -47,9 +47,6 @@ class StepThreeBajajFDFragment : BaseFragment() { private var latestTmpUri: Uri? = null private var _binding: FragmentBajajfdStepThreeBinding? = null private val binding get() = _binding!! - private lateinit var listOfDocType: List - private var docValue: String = "" - private lateinit var stepThreeBajajFDViewModel: StepThreeBajajFDViewModel private lateinit var dialog: Dialog @@ -65,12 +62,16 @@ class StepThreeBajajFDFragment : BaseFragment() { private var doc1FileExt: String? = "" private var doc2fileExt: String? = "" private var uniqueId: String? = "" - private val MAIN_PAN_UPLOAD: Int = 1 - private val MAIN_PHOTO_UPLOAD: Int = 2 - private val FIRST_UPLOAD: Int = 3 - private val SECOND_UPLOAD: Int = 4 + 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 mapImage: HashMap = HashMap() + private lateinit var listOfDocType: List + private val requestPermission = registerForActivityResult( ActivityResultContracts.RequestPermission() ) { isGranted: Boolean -> @@ -101,7 +102,7 @@ class StepThreeBajajFDFragment : BaseFragment() { { uri: Uri? -> if (uri != null) { bitmap = uriToBitmap(uri) - uploadDocument(uri,"g") + uploadDocument(uri, "g") } } @@ -109,48 +110,63 @@ class StepThreeBajajFDFragment : BaseFragment() { registerForActivityResult(ActivityResultContracts.TakePicture()) { isSuccess -> if (isSuccess) { latestTmpUri?.let { uri -> - uploadDocument(uri,"c") + uploadDocument(uri, "c") } } } binding.btnNext.setOnClickListener { -// if (validate()) { -// uploadDocApi( -// "PAN", -// "data:image/".plus(panFileExt).plus(";base64, ").plus(panString), -// 1 -// ) -// } - createFDApi((activity as BajajFdMainActivity).createFDRequest) + 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 BajajFdMainActivity).binding.viewPager.currentItem = 1 } binding.btnPANUpload.setOnClickListener { - actionType = MAIN_PAN_UPLOAD + actionType = mainPANUpload selectImage() } binding.btnPhotoUpload.setOnClickListener { - actionType = MAIN_PHOTO_UPLOAD + actionType = mainPhotoUpload selectImage() } binding.btnAadhaarFrontUpload.setOnClickListener { - actionType = FIRST_UPLOAD + actionType = firstDocUpload selectImage() } binding.btnAadhaarBackUpload.setOnClickListener { - actionType = SECOND_UPLOAD + actionType = secondDocUpload selectImage() } binding.spDocType.onItemClickListener = AdapterView.OnItemClickListener { parent, _, position, _ -> - val getCodes : GetCodes = parent.getItemAtPosition(position) as GetCodes + val getCodes: GetCodes = parent.getItemAtPosition(position) as GetCodes docValue = getCodes.Value docString = "" docString2 = "" @@ -252,47 +268,47 @@ class StepThreeBajajFDFragment : BaseFragment() { binding.btnAadhaarFrontUpload.visibility = View.VISIBLE } - private fun uploadDocument(uri: Uri,type: String) { + private fun uploadDocument(uri: Uri, type: String) { when (actionType) { - MAIN_PAN_UPLOAD -> { + 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) + val size: Double = Common.getFileSizeInMB(fileExtension.length()) + if (size < 5) { + if (type == "c") encodedPANBase64(fileExtension) else panString = bitmap?.let { ImageUtil.convert(it) }.toString() - } else{ + } else { panString = "" panFileExt = "" } } - MAIN_PHOTO_UPLOAD -> { + 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()) + val size: Double = Common.getFileSizeInMB(fileExtension.length()) if (size < 5) { if (type == "c") encodedPhotoBase64(fileExtension) else photoString = bitmap?.let { ImageUtil.convert(it) }.toString() - }else{ + } else { photoString = "" photoFileExt = "" } } - FIRST_UPLOAD -> { + 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()) + val size: Double = Common.getFileSizeInMB(fileExtension.length()) if (size < 5) { if (type == "c") encodedUpload1Base64(fileExtension) else docString = bitmap?.let { ImageUtil.convert(it) }.toString() - }else{ + } else { docString = "" doc1FileExt = "" } @@ -302,11 +318,11 @@ class StepThreeBajajFDFragment : BaseFragment() { 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()) + val size: Double = Common.getFileSizeInMB(fileExtension.length()) if (size < 5) { if (type == "c") encodedFileToBase64(fileExtension) else docString2 = bitmap?.let { ImageUtil.convert(it) }.toString() - }else{ + } else { docString2 = "" doc2fileExt = "" } @@ -314,12 +330,11 @@ class StepThreeBajajFDFragment : BaseFragment() { } } - - private fun encodedPANBase64(fileName: File) { panString = try { val bytes: ByteArray = loadFile(fileName) - Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "").replace("\\s+", "") + Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "") + .replace("\\s+", "") } catch (e: Exception) { e.printStackTrace() "" @@ -329,7 +344,8 @@ class StepThreeBajajFDFragment : BaseFragment() { private fun encodedPhotoBase64(fileName: File) { photoString = try { val bytes: ByteArray = loadFile(fileName) - Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "").replace("\\s+", "") + Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "") + .replace("\\s+", "") } catch (e: Exception) { e.printStackTrace() "" @@ -339,7 +355,8 @@ class StepThreeBajajFDFragment : BaseFragment() { private fun encodedUpload1Base64(fileName: File) { docString = try { val bytes: ByteArray = loadFile(fileName) - Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "").replace("\\s+", "") + Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "") + .replace("\\s+", "") } catch (e: Exception) { e.printStackTrace() "" @@ -349,7 +366,8 @@ class StepThreeBajajFDFragment : BaseFragment() { private fun encodedFileToBase64(fileName: File) { docString2 = try { val bytes: ByteArray = loadFile(fileName) - Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "").replace("\\s+", "") + Base64.encodeToString(bytes, Base64.DEFAULT).trim().replace("\n", "") + .replace("\\s+", "") } catch (e: Exception) { e.printStackTrace() "" @@ -399,36 +417,15 @@ class StepThreeBajajFDFragment : BaseFragment() { when (code) { 200 -> { Log.e("check_upload_res", response.message.toString()) - if (uploadPosition == 1) { - uploadDocApi( - "Photograph", - "data:image/".plus(photoFileExt).plus(";base64, ") - .plus(photoString), - 2 - ) - } else if (uploadPosition == 2) { - uploadDocApi( - docValue, - "data:image/".plus(doc1FileExt).plus(";base64, ") - .plus(docString), - 3 - ) - } else if (uploadPosition == 3) { - if (docValue == "Aadhar") { - uploadDocApi( - docValue, - "data:image/".plus(doc2fileExt).plus(";base64, ") - .plus(docString2), - 4 - ) - } else { - createFDApi((activity as BajajFdMainActivity).createFDRequest) - } - } else if (uploadPosition == 4) { + if (uploadPosition == mapImage.size) { + Toast.makeText( + requireActivity(), + "Documents Uploaded Successfully", + Toast.LENGTH_SHORT + ).show() createFDApi((activity as BajajFdMainActivity).createFDRequest) } } - // 650 -> refreshToken() else -> { Common.showDialogValidation( @@ -503,9 +500,7 @@ class StepThreeBajajFDFragment : BaseFragment() { } } - private fun docTypeApi() { - val getCodeRequest = GetCodeRequest() getCodeRequest.ProductName = getString(R.string.bajajFD) getCodeRequest.Category = getString(R.string.docType) @@ -569,7 +564,6 @@ class StepThreeBajajFDFragment : BaseFragment() { } } - private fun validate(): Boolean { if (panString.isEmpty()) { Common.showDialogValidation( @@ -622,19 +616,14 @@ class StepThreeBajajFDFragment : BaseFragment() { ) } - - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } - fun displayReceivedData(createFDApplicationResponse: CreateFDApplicationResponse) { uniqueId = createFDApplicationResponse.Response.FDCreationDetailsResponse.UniqueId } private fun uriToBitmap(selectedFileUri: Uri): Bitmap? { try { - val parcelFileDescriptor = requireActivity().contentResolver.openFileDescriptor(selectedFileUri, "r") + val parcelFileDescriptor = + requireActivity().contentResolver.openFileDescriptor(selectedFileUri, "r") val fileDescriptor: FileDescriptor = parcelFileDescriptor!!.fileDescriptor val image = BitmapFactory.decodeFileDescriptor(fileDescriptor) parcelFileDescriptor.close() @@ -644,4 +633,9 @@ class StepThreeBajajFDFragment : BaseFragment() { } 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/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt index 0d8bb05..6f7c801 100644 --- a/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt +++ b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt @@ -550,11 +550,9 @@ class StepTwoBajajFDFragment : BaseFragment() { binding.addBankDetail.setOnClickListener { if (bankListAdapter.itemCount == 5) { - showDialogValidation(mActivity, "You Can Not Add More Than Five Account") + showDialogValidation(mActivity, "You can not add more than five accounts") } else { - binding.llBankDetails.visibility = View.GONE - binding.addBankDetail.setCompoundDrawablesWithIntrinsicBounds(0,0,R.drawable.ic_add_icon,0) - showHideBankDetail() + showHideBankDetail() } }