gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

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