-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor #1470: migrated bank package from java to kotlin
- Loading branch information
1 parent
0dd07d5
commit 1c3379f
Showing
17 changed files
with
682 additions
and
774 deletions.
There are no files selected for viewing
97 changes: 0 additions & 97 deletions
97
...spay/src/main/java/org/mifos/mobilewallet/mifospay/bank/adapters/BankAccountsAdapter.java
This file was deleted.
Oops, something went wrong.
92 changes: 92 additions & 0 deletions
92
mifospay/src/main/java/org/mifos/mobilewallet/mifospay/bank/adapters/BankAccountsAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!!) | ||
} | ||
} | ||
} |
126 changes: 0 additions & 126 deletions
126
mifospay/src/main/java/org/mifos/mobilewallet/mifospay/bank/adapters/OtherBankAdapter.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.