Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor #1470: migrated bank package from java to kotlin #1471

Merged
merged 3 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package org.mifos.mobilewallet.mifospay.bank

import org.mifos.mobilewallet.core.domain.model.BankAccountDetails
import org.mifos.mobilewallet.mifospay.base.BasePresenter
import org.mifos.mobilewallet.mifospay.base.BaseView

/**
* Created by ankur on 09/July/2018
*/
interface BankContract {
interface BankAccountsPresenter : BasePresenter {
fun fetchLinkedBankAccounts()
}

interface BankAccountsView : BaseView<BankAccountsPresenter?> {
fun showLinkedBankAccounts(bankAccountList: List<BankAccountDetails?>?)
}

interface LinkBankAccountPresenter : BasePresenter {
fun fetchBankAccountDetails(bankName: String?)
}

interface LinkBankAccountView : BaseView<LinkBankAccountPresenter?> {
fun addBankAccount(bankAccountDetails: BankAccountDetails?)
}

interface BankAccountDetailPresenter : BasePresenter
interface BankAccountDetailView : BaseView<BankAccountDetailPresenter?>
interface DebitCardPresenter : BasePresenter {
fun verifyDebitCard(s: String?, s1: String?, s2: String?)
}

interface DebitCardView : BaseView<DebitCardPresenter?> {
fun verifyDebitCardSuccess(otp: String?)
fun verifyDebitCardError(message: String?)
}

interface UpiPinPresenter : BasePresenter
interface UpiPinView : BaseView<UpiPinPresenter?>
interface SetupUpiPinPresenter : BasePresenter {
fun setupUpiPin(bankAccountDetails: BankAccountDetails?, upiPin: String?)
fun requestOtp(bankAccountDetails: BankAccountDetails?)
}

interface SetupUpiPinView : BaseView<SetupUpiPinPresenter?> {
fun debitCardVerified(otp: String?)
fun setupUpiPinSuccess(mSetupUpiPin: String?)
fun setupUpiPinError(message: String?)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package org.mifos.mobilewallet.mifospay.bank.adapters

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 butterknife.BindView
import butterknife.ButterKnife
import org.mifos.mobilewallet.core.domain.model.BankAccountDetails
import org.mifos.mobilewallet.mifospay.R
import org.mifos.mobilewallet.mifospay.utils.DebugUtil
import javax.inject.Inject

/**
* Created by ankur on 09/July/2018
*/
class BankAccountsAdapter @Inject constructor() :
RecyclerView.Adapter<BankAccountsAdapter.ViewHolder?>() {
private var mBankAccountDetailsList: MutableList<BankAccountDetails>?

init {
mBankAccountDetailsList = ArrayList()
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val v = LayoutInflater.from(parent.context).inflate(
R.layout.item_casual_list,
parent, false
)
return ViewHolder(v)
}

override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val bankAccountDetails = mBankAccountDetailsList!![position]
holder.mTvBankName!!.text = bankAccountDetails.bankName
holder.mTvAccountHolderName!!.text = bankAccountDetails.accountholderName
holder.mTvBranch!!.text = bankAccountDetails.branch
holder.imageViewAccount!!.setImageResource(R.drawable.ic_bank)
}

override fun getItemCount(): Int {
return if (mBankAccountDetailsList != null) {
mBankAccountDetailsList!!.size
} else {
0
}
}

fun setData(bankAccountDetailsList: List<BankAccountDetails?>?) {
mBankAccountDetailsList = bankAccountDetailsList as MutableList<BankAccountDetails>?
notifyDataSetChanged()
}

fun getBankDetails(position: Int): BankAccountDetails {
return mBankAccountDetailsList!![position]
}

fun addBank(bankAccountDetails: BankAccountDetails) {
mBankAccountDetailsList!!.add(bankAccountDetails)
notifyDataSetChanged()
DebugUtil.log(mBankAccountDetailsList!!.size)
}

fun setBankDetails(index: Int, bankAccountDetails: BankAccountDetails) {
mBankAccountDetailsList!![index] = bankAccountDetails
notifyDataSetChanged()
}

inner class ViewHolder(v: View?) : RecyclerView.ViewHolder(v!!) {
@JvmField
@BindView(R.id.tv_item_casual_list_title)
var mTvBankName: TextView? = null

@JvmField
@BindView(R.id.tv_item_casual_list_subtitle)
var mTvAccountHolderName: TextView? = null

@JvmField
@BindView(R.id.tv_item_casual_list_optional_caption)
var mTvBranch: TextView? = null

@JvmField
@BindView(R.id.iv_item_casual_list_icon)
var imageViewAccount: ImageView? = null

init {
ButterKnife.bind(this, v!!)
}
}
}
Loading
Loading