aboutsummaryrefslogtreecommitdiff
path: root/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
diff options
context:
space:
mode:
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt')
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt6
1 files changed, 6 insertions, 0 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..300c1ff 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
@@ -25,6 +25,7 @@ import android.view.View.VISIBLE
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
+import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat.getColor
import androidx.recyclerview.selection.ItemDetailsLookup
import androidx.recyclerview.selection.ItemKeyProvider
@@ -74,6 +75,7 @@ internal class TransactionAdapter(
internal inner class TransactionViewHolder(private val v: View) : ViewHolder(v) {
private val context: Context = v.context
+ private val root: ConstraintLayout = 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)
@@ -98,6 +100,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 R.color.transparent)
+ root.setBackgroundColor(bgColor)
}
private fun bindExtraInfo(transaction: Transaction) {