summaryrefslogtreecommitdiff
path: root/wallet/src/main
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-04-10 00:36:35 -0600
committerTorsten Grote <t@grobox.de>2023-04-10 17:29:39 -0300
commitc2283c02428005a8ce0dc00df72535e27f7892d9 (patch)
tree91d2fabc8f4042216120a5b4415df8eacdf71882 /wallet/src/main
parent87cc3e28dfc4a2702a75ea3075ca7ac400ce719c (diff)
downloadtaler-android-c2283c02428005a8ce0dc00df72535e27f7892d9.tar.gz
taler-android-c2283c02428005a8ce0dc00df72535e27f7892d9.tar.bz2
taler-android-c2283c02428005a8ce0dc00df72535e27f7892d9.zip
[wallet] Removed action button from transaction list
Diffstat (limited to 'wallet/src/main')
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt22
-rw-r--r--wallet/src/main/res/layout/list_item_transaction.xml16
2 files changed, 1 insertions, 37 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 c2f7122..69c1a8a 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
@@ -32,11 +32,9 @@ import androidx.recyclerview.selection.SelectionTracker
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.Adapter
import androidx.recyclerview.widget.RecyclerView.ViewHolder
-import com.google.android.material.button.MaterialButton
import net.taler.common.exhaustive
import net.taler.common.toRelativeTime
import net.taler.wallet.R
-import net.taler.wallet.handleKyc
import net.taler.wallet.transactions.ExtendedStatus.Pending
import net.taler.wallet.transactions.TransactionAdapter.TransactionViewHolder
@@ -81,7 +79,6 @@ internal class TransactionAdapter(
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)
- private val actionButton: MaterialButton = v.findViewById(R.id.actionButton)
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)
@@ -99,7 +96,6 @@ internal class TransactionAdapter(
}
title.text = transaction.getTitle(context)
bindExtraInfo(transaction)
- bindActionButton(transaction)
time.text = transaction.timestamp.ms.toRelativeTime(context)
bindAmount(transaction)
pendingView.visibility = if (transaction.extendedStatus == Pending) VISIBLE else GONE
@@ -128,24 +124,6 @@ internal class TransactionAdapter(
}
}
- private fun bindActionButton(t: Transaction) {
- actionButton.setOnClickListener { listener.onActionButtonClicked(t) }
- if (t.error != null) {
- actionButton.visibility = t.handleKyc({ GONE }) {
- actionButton.setText(R.string.transaction_action_kyc)
- VISIBLE
- }
- } else if (t is TransactionWithdrawal && !t.confirmed) {
- actionButton.setIconResource(R.drawable.ic_account_balance)
- actionButton.visibility =
- if (t.withdrawalDetails is WithdrawalDetails.TalerBankIntegrationApi &&
- t.withdrawalDetails.bankConfirmationUrl != null) {
- actionButton.setText(R.string.withdraw_button_confirm_bank)
- VISIBLE
- } else GONE
- }
- }
-
private fun bindAmount(transaction: Transaction) {
val amountStr = transaction.amountEffective.amountStr
when (transaction.amountType) {
diff --git a/wallet/src/main/res/layout/list_item_transaction.xml b/wallet/src/main/res/layout/list_item_transaction.xml
index 8cd10a8..64d9045 100644
--- a/wallet/src/main/res/layout/list_item_transaction.xml
+++ b/wallet/src/main/res/layout/list_item_transaction.xml
@@ -62,20 +62,6 @@
tools:text="@string/withdraw_waiting_confirm"
tools:visibility="visible" />
- <com.google.android.material.button.MaterialButton
- android:id="@+id/actionButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="8dp"
- android:visibility="gone"
- android:textColor="?colorOnPrimary"
- app:iconTint="?colorOnPrimary"
- app:backgroundTint="?colorPrimary"
- app:layout_constraintStart_toStartOf="@id/title"
- app:layout_constraintTop_toBottomOf="@id/extraInfoView"
- tools:text="Complete KYC"
- tools:visibility="visible"/>
-
<TextView
android:id="@+id/time"
android:layout_width="0dp"
@@ -86,7 +72,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/barrier"
app:layout_constraintStart_toStartOf="@+id/title"
- app:layout_constraintTop_toBottomOf="@+id/actionButton"
+ app:layout_constraintTop_toBottomOf="@+id/extraInfoView"
tools:text="23 min ago" />
<androidx.constraintlayout.widget.Barrier