diff options
author | Torsten Grote <t@grobox.de> | 2020-05-14 15:38:36 -0300 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2020-05-15 14:26:43 -0300 |
commit | dfc0db1432b181723e20efc01d46335ffd53115d (patch) | |
tree | f58fd9c067467c138fadbdf59292188f5bc3282d /wallet/src/main/java | |
parent | 7f36a54e5781c56d538f007f5565d79e1a2285fc (diff) | |
download | taler-android-dfc0db1432b181723e20efc01d46335ffd53115d.tar.gz taler-android-dfc0db1432b181723e20efc01d46335ffd53115d.tar.bz2 taler-android-dfc0db1432b181723e20efc01d46335ffd53115d.zip |
[wallet] provide extra info in transactions when withdrawal requires confirmation
Diffstat (limited to 'wallet/src/main/java')
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt b/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt index a2cd2e8..f93dd66 100644 --- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt +++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt @@ -70,12 +70,12 @@ internal class TransactionAdapter( tracker.select(it.transactionId) } - internal open inner class TransactionViewHolder(private val v: View) : ViewHolder(v) { - - protected val context: Context = v.context + internal inner class TransactionViewHolder(private val v: View) : ViewHolder(v) { + private val context: Context = v.context private val icon: ImageView = v.findViewById(R.id.icon) - protected val title: TextView = v.findViewById(R.id.title) + private val title: TextView = v.findViewById(R.id.title) + private val extraInfoView: TextView = v.findViewById(R.id.extraInfoView) private val time: TextView = v.findViewById(R.id.time) private val amount: TextView = v.findViewById(R.id.amount) private val pendingView: TextView = v.findViewById(R.id.pendingView) @@ -85,18 +85,19 @@ internal class TransactionAdapter( private val red = context.getColor(R.color.red) private val green = context.getColor(R.color.green) - open fun bind(transaction: Transaction, selected: Boolean) { - if (transaction.detailPageLayout != 0) { - v.foreground = selectableForeground - v.setOnClickListener { listener.onTransactionClicked(transaction) } - } else { - v.foreground = null - v.setOnClickListener(null) - } + fun bind(transaction: Transaction, selected: Boolean) { + v.foreground = selectableForeground + v.setOnClickListener { listener.onTransactionClicked(transaction) } v.isActivated = selected - icon.setImageResource(transaction.icon) + icon.setImageResource(transaction.icon) title.text = transaction.getTitle(context) + if (transaction is TransactionWithdrawal && !transaction.confirmed) { + extraInfoView.setText(R.string.withdraw_waiting_confirm) + extraInfoView.visibility = VISIBLE + } else { + extraInfoView.visibility = GONE + } time.text = transaction.timestamp.ms.toRelativeTime(context) bindAmount(transaction) pendingView.visibility = if (transaction.pending) VISIBLE else GONE |