[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 17/32: showUpDown if 25 entries
From: |
gnunet |
Subject: |
[taler-taler-ios] 17/32: showUpDown if 25 entries |
Date: |
Sun, 14 Jul 2024 00:19:26 +0200 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit 79df53432081cb405510fbd25a0685f40f65bc63
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Jul 12 23:34:53 2024 +0200
showUpDown if 25 entries
---
.../Views/Balances/BalancesSectionView.swift | 2 --
TalerWallet1/Views/Overview/OverviewSectionV.swift | 2 --
.../Views/Transactions/TransactionsListView.swift | 30 ++++++++++------------
3 files changed, 13 insertions(+), 21 deletions(-)
diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift
b/TalerWallet1/Views/Balances/BalancesSectionView.swift
index 88c8024..c72f945 100644
--- a/TalerWallet1/Views/Balances/BalancesSectionView.swift
+++ b/TalerWallet1/Views/Balances/BalancesSectionView.swift
@@ -190,7 +190,6 @@ fileprivate struct BalancesPendingRowView: View {
navTitle: String(localized: "Pending",
comment: "ViewTitle of TransactionList"),
scopeInfo: balance.scopeInfo,
transactions: pendingTransactions,
- showUpDown: false,
reloadAllAction: reloadPending,
reloadOneAction: reloadOneAction)
}
@@ -284,7 +283,6 @@ fileprivate struct BalancesNavigationLinksView: View {
navTitle: String(localized: "Transactions",
comment: "ViewTitle of TransactionList"),
scopeInfo: scopeInfo,
transactions: completedTransactions,
- showUpDown: true,
reloadAllAction: reloadAllAction,
reloadOneAction: reloadOneAction)
}
diff --git a/TalerWallet1/Views/Overview/OverviewSectionV.swift
b/TalerWallet1/Views/Overview/OverviewSectionV.swift
index e3bee97..bd4bdc1 100644
--- a/TalerWallet1/Views/Overview/OverviewSectionV.swift
+++ b/TalerWallet1/Views/Overview/OverviewSectionV.swift
@@ -161,7 +161,6 @@ fileprivate struct CurrenciesPendingRowV: View {
navTitle: String(localized: "Pending",
comment: "ViewTitle of TransactionList"),
scopeInfo: balance.scopeInfo,
transactions: pendingTransactions,
- showUpDown: false,
reloadAllAction: reloadPending,
reloadOneAction: reloadOneAction)
}
@@ -234,7 +233,6 @@ fileprivate struct CurrenciesNavigationLinksV: View {
navTitle: String(localized: "Transactions",
comment: "ViewTitle of TransactionList"),
scopeInfo: scopeInfo,
transactions: completedTransactions,
- showUpDown: true,
reloadAllAction: reloadAllAction,
reloadOneAction: reloadOneAction)
}
diff --git a/TalerWallet1/Views/Transactions/TransactionsListView.swift
b/TalerWallet1/Views/Transactions/TransactionsListView.swift
index 7ad5e9a..9002132 100644
--- a/TalerWallet1/Views/Transactions/TransactionsListView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionsListView.swift
@@ -5,6 +5,11 @@
import SwiftUI
import SymLog
+#if DEBUG
+fileprivate let showUpDown = 8 // show up+down buttons in the menubar if
list has many lines
+#else
+fileprivate let showUpDown = 25 // show up+down buttons in the menubar if
list has many lines
+#endif
struct TransactionsListView: View {
private let symLog = SymLogV(0)
let stack: CallStack
@@ -13,13 +18,11 @@ struct TransactionsListView: View {
let scopeInfo: ScopeInfo
let transactions: [Transaction]
- let showUpDown: Bool
let reloadAllAction: (_ stack: CallStack) async -> ()
let reloadOneAction: ((_ transactionId: String, _ viewHandles: Bool) async
throws -> Transaction)
@State private var viewId = UUID()
- @State private var upAction: () -> Void = {}
- @State private var downAction: () -> Void = {}
+
var body: some View {
#if PRINT_CHANGES
let _ = Self._printChanges()
@@ -43,24 +46,17 @@ struct TransactionsListView: View {
await reloadAllAction(stack.push())
}
#endif
- .navigationBarItems(trailing: HStack {
- if showUpDown {
- ArrowUpButton(action: upAction)
- ArrowDownButton(action: downAction)
- } else {
- EmptyView()
- }
- })
- .onAppear {
- if showUpDown {
- upAction = {
+ .if(count > showUpDown) { view in
+ view.navigationBarItems(trailing: HStack {
+ ArrowUpButton {
+// print("up")
withAnimation { scrollView.scrollTo(0) }
}
- downAction = {
+ ArrowDownButton {
+// print("down")
withAnimation { scrollView.scrollTo(transactions.count
- 1) }
}
-// downAction()
- }
+ })
}
} // ScrollView
.navigationTitle(navTitle)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 15/32: minimalistic: no currency name, (continued)
- [taler-taler-ios] 15/32: minimalistic: no currency name, gnunet, 2024/07/13
- [taler-taler-ios] 18/32: cleanup, gnunet, 2024/07/13
- [taler-taler-ios] 28/32: Icons in transactions, gnunet, 2024/07/13
- [taler-taler-ios] 30/32: IconBadge improvements, gnunet, 2024/07/13
- [taler-taler-ios] 31/32: Fix layout of tx list, gnunet, 2024/07/13
- [taler-taler-ios] 20/32: qrCodesForPayto WIP, gnunet, 2024/07/13
- [taler-taler-ios] 26/32: TwoRowButtons with icons, gnunet, 2024/07/13
- [taler-taler-ios] 25/32: Error+debugDescription, gnunet, 2024/07/13
- [taler-taler-ios] 27/32: Authorize instead of confirm, gnunet, 2024/07/13
- [taler-taler-ios] 09/32: remove QR from Overview, gnunet, 2024/07/13
- [taler-taler-ios] 17/32: showUpDown if 25 entries,
gnunet <=
- [taler-taler-ios] 13/32: comment out payto scheme, gnunet, 2024/07/13
- [taler-taler-ios] 10/32: QR button smaller, gnunet, 2024/07/13
- [taler-taler-ios] 12/32: disable hintNetworkAvailability, logging, gnunet, 2024/07/13
- [taler-taler-ios] 24/32: cleanup, gnunet, 2024/07/13
- [taler-taler-ios] 32/32: Spend button with icon, gnunet, 2024/07/13
- [taler-taler-ios] 16/32: hints for P2P expiration, gnunet, 2024/07/13
- [taler-taler-ios] 23/32: IconBadge, gnunet, 2024/07/13
- [taler-taler-ios] 11/32: L10N, gnunet, 2024/07/13
- [taler-taler-ios] 14/32: VIEW_OVERVIEW, gnunet, 2024/07/13
- [taler-taler-ios] 29/32: Bugfix: List mustn't be in ScrollView, gnunet, 2024/07/13