Skip to content

Commit

Permalink
Showing 5 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ class ClientChargeAdapter(

override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val charge = getItem(position)
var currencyRepresentation = charge?.currency?.displaySymbol
var currencyRepresentation = charge?.currency?.displaySymbol ?: charge?.currency?.code
if (currencyRepresentation == null) {
currencyRepresentation = charge?.currency?.code
}
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ class RecentTransactionListAdapter @Inject constructor(@ActivityContext context:

override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val (_, _, _, type, _, currency, amount, submittedOnDate) = getItem(position)
var currencyRepresentation = currency?.displaySymbol
var currencyRepresentation = currency?.displaySymbol ?: currency?.code
if (currencyRepresentation == null) {
currencyRepresentation = currency?.code
}
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ class SavingAccountsListAdapter(
tvAccountBalance.setTextColor(ContextCompat.getColor(itemView.context, colorId))
tvAccountBalance.text = itemView.context.getString(
R.string.string_and_string,
savingAccount.currency?.displaySymbol,
savingAccount.currency?.displaySymbol ?: savingAccount.currency?.code,
formatCurrency(itemView.context, savingAccount.accountBalance),
)
}
Original file line number Diff line number Diff line change
@@ -106,15 +106,15 @@ class SavingAccountsTransactionListAdapter @Inject constructor() :
fun bind(transaction: Transactions?) {
with(binding) {
val (_, transactionType, _, _, date, currency, paymentDetailData, amount, runningBalance) = transaction!!

val displayedSymbol = currency?.displaySymbol ?: currency?.code
tvSavingAccountAmount.text = context?.getString(
R.string.string_and_string,
currency?.displaySymbol,
displayedSymbol,
formatCurrency(context, amount!!),
)
tvSavingAccountRunningBalance.text = context?.getString(
R.string.string_and_string,
currency?.displaySymbol,
displayedSymbol,
formatCurrency(context, runningBalance!!),
)
tvTransactionType.text = transactionType?.value
Original file line number Diff line number Diff line change
@@ -82,14 +82,17 @@ class LoanRepaymentScheduleFragment : BaseFragment() {
hideProgress()
showError(getString(it.message))
}

is LoanUiState.ShowLoan -> {
hideProgress()
showLoanRepaymentSchedule(it.loanWithAssociations)
}

is LoanUiState.ShowEmpty -> {
hideProgress()
showEmptyRepaymentsSchedule(loanWithAssociations)
}

else -> throw IllegalStateException("Unexpected state: $it")
}
}
@@ -150,7 +153,8 @@ class LoanRepaymentScheduleFragment : BaseFragment() {
*/
fun showLoanRepaymentSchedule(loanWithAssociations: LoanWithAssociations?) {
this.loanWithAssociations = loanWithAssociations
var currencyRepresentation = loanWithAssociations?.currency?.displaySymbol
var currencyRepresentation =
loanWithAssociations?.currency?.displaySymbol ?: loanWithAssociations?.currency?.code
loanRepaymentScheduleAdapter
?.setCurrency(currencyRepresentation)
setTableViewList(loanWithAssociations?.repaymentSchedule?.periods)

0 comments on commit 203cd9c

Please sign in to comment.