summaryrefslogtreecommitdiff
path: root/wallet/src/main/java/net/taler/wallet/transactions
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-01-05 18:56:44 -0600
committerTorsten Grote <t@grobox.de>2023-01-06 14:15:48 -0300
commit84377ba0b58277bc964f8c04af2af6142384e785 (patch)
treee4f8683ac863c48efec6ce0c3ee587f5b2d01f10 /wallet/src/main/java/net/taler/wallet/transactions
parenta5d6420ddf5c161eee31b6b12622e399cc5fb7e5 (diff)
downloadtaler-android-84377ba0b58277bc964f8c04af2af6142384e785.tar.gz
taler-android-84377ba0b58277bc964f8c04af2af6142384e785.tar.bz2
taler-android-84377ba0b58277bc964f8c04af2af6142384e785.zip
Transactions background changes when selecting with a long press
#0007478
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/transactions')
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt6
1 files changed, 5 insertions, 1 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 b8bf9af..b11f438 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
@@ -74,6 +74,7 @@ internal class TransactionAdapter(
internal inner class TransactionViewHolder(private val v: View) : ViewHolder(v) {
private val context: Context = v.context
+ private val root: ViewGroup = v.findViewById(R.id.root)
private val icon: ImageView = v.findViewById(R.id.icon)
private val title: TextView = v.findViewById(R.id.title)
private val extraInfoView: TextView = v.findViewById(R.id.extraInfoView)
@@ -87,7 +88,6 @@ internal class TransactionAdapter(
fun bind(transaction: Transaction, selected: Boolean) {
v.setOnClickListener { listener.onTransactionClicked(transaction) }
- v.isActivated = selected
if (transaction.error == null) {
icon.setImageResource(transaction.icon)
} else {
@@ -98,6 +98,10 @@ internal class TransactionAdapter(
time.text = transaction.timestamp.ms.toRelativeTime(context)
bindAmount(transaction)
pendingView.visibility = if (transaction.pending) VISIBLE else GONE
+ val bgColor = getColor(context,
+ if (selected) R.color.selectedBackground
+ else android.R.color.transparent)
+ root.setBackgroundColor(bgColor)
}
private fun bindExtraInfo(transaction: Transaction) {