gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-android] branch master updated: Transactions background cha


From: gnunet
Subject: [taler-taler-android] branch master updated: Transactions background changes when selecting with a long press
Date: Fri, 06 Jan 2023 18:16:54 +0100

This is an automated email from the git hooks/post-receive script.

torsten-grote pushed a commit to branch master
in repository taler-android.

The following commit(s) were added to refs/heads/master by this push:
     new 84377ba  Transactions background changes when selecting with a long 
press
84377ba is described below

commit 84377ba0b58277bc964f8c04af2af6142384e785
Author: Iván Ávalos <avalos@disroot.org>
AuthorDate: Thu Jan 5 18:56:44 2023 -0600

    Transactions background changes when selecting with a long press
    
    #0007478
---
 .../main/java/net/taler/wallet/transactions/TransactionAdapter.kt   | 6 +++++-
 wallet/src/main/res/layout/list_item_transaction.xml                | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

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) {
diff --git a/wallet/src/main/res/layout/list_item_transaction.xml 
b/wallet/src/main/res/layout/list_item_transaction.xml
index ed031c3..64d9045 100644
--- a/wallet/src/main/res/layout/list_item_transaction.xml
+++ b/wallet/src/main/res/layout/list_item_transaction.xml
@@ -17,6 +17,7 @@
 <androidx.constraintlayout.widget.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android";
     xmlns:app="http://schemas.android.com/apk/res-auto";
     xmlns:tools="http://schemas.android.com/tools";
+    android:id="@+id/root"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="?attr/selectableItemBackground"

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]