diff options
author | Iván Ávalos <avalos@disroot.org> | 2023-01-05 18:56:44 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2023-01-05 18:56:44 -0600 |
commit | 7b9e081d6323a89870d4787592f1ec2930b9fe14 (patch) | |
tree | 7ab57a99cab90f8b762b635dbfd11af4bed0b09c /wallet/src/main/java | |
parent | 6f45cd9e9f4e25df5048854cc421178f1cd66a59 (diff) | |
download | taler-android-7b9e081d6323a89870d4787592f1ec2930b9fe14.tar.gz taler-android-7b9e081d6323a89870d4787592f1ec2930b9fe14.tar.bz2 taler-android-7b9e081d6323a89870d4787592f1ec2930b9fe14.zip |
[wallet] Transactions background changes when selecting with a long pressbug-7478
#0007478
Diffstat (limited to 'wallet/src/main/java')
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt | 6 |
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) { |