[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 176/204: cleanup, comments
From: |
gnunet |
Subject: |
[taler-taler-ios] 176/204: cleanup, comments |
Date: |
Thu, 05 Dec 2024 23:52:24 +0100 |
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 7152b6eec54222b5b98c880bcdfb1bc537a53ae6
Author: Marc Stibane <marc@taler.net>
AuthorDate: Tue Nov 26 09:26:56 2024 +0100
cleanup, comments
---
TalerWallet1/Views/Main/MainView.swift | 74 +++++++++++++++++-----------------
1 file changed, 37 insertions(+), 37 deletions(-)
diff --git a/TalerWallet1/Views/Main/MainView.swift
b/TalerWallet1/Views/Main/MainView.swift
index d1515bc..c35c83b 100644
--- a/TalerWallet1/Views/Main/MainView.swift
+++ b/TalerWallet1/Views/Main/MainView.swift
@@ -310,36 +310,23 @@ extension MainView {
#else
let delay: UInt = 0 // no delay for release builds
#endif
- let balancesTitle = Tab.balances.title
-// let actionTitle = Tab.actions.title
- let settingsTitle = Tab.settings.title
- let tabBarView = TabBarView(selection: tabSelection(), userAction:
$userAction, hidden: $navModel.tabBarHidden) {
- logger.log("onActionTab")
- showActionSheet = true
- } onActionDrag: {
- logger.log("onActionDrag: showScanner = true")
- showScanner = true
- }
-
+ /// Destinations for the 4 actions
let sendDest = SendAmountV(stack: stack.push(Self.name),
selectedBalance: $selectedBalance,
// if nil shows currency picker
amountLastUsed: $amountLastUsed,
// currency needs to be updated!
summary: $summary)
-
let requestDest = RequestPayment(stack: stack.push(Self.name),
selectedBalance: $selectedBalance,
amountLastUsed: $amountLastUsed,
// currency needs to be updated!
summary: $summary)
-
let depositDest = DepositIbanV(stack: stack.push(Self.name),
selectedBalance: $selectedBalance,
amountLastUsed: $amountLastUsed)
-
let manualWithdrawDest = ManualWithdraw(stack:
stack.push(Self.name),
selectedBalance: $selectedBalance,
amountLastUsed: $amountLastUsed,
// currency needs to be updated!
isSheet: false)
-
+ /// each NavigationView needs its own NavLinks
let balanceActions = Group {
NavLink(1, $navModel.actionSelected) { sendDest }
NavLink(2, $navModel.actionSelected) { requestDest }
@@ -352,42 +339,55 @@ extension MainView {
NavLink(7, $navModel.actionSelected) { depositDest }
NavLink(8, $navModel.actionSelected) { manualWithdrawDest }
}
+ /// tab titles, and invisible tabItems which are only used for a11y
+ let balancesTitle = Tab.balances.title // "Balances"
+ let actionTitle = Tab.actions.title // "Actions"
+ let settingsTitle = Tab.settings.title // "Settings"
let a11yBalanceTab = Label(Tab.balances).labelStyle(.titleOnly)
- .accessibilityLabel(Tab.balances.title)
// "Balances"
+ .accessibilityLabel(balancesTitle)
let a11yActionsTab = Label(Tab.actions).labelStyle(.titleOnly)
- .accessibilityLabel(Tab.actions.title)
// "Actions"
+ .accessibilityLabel(actionTitle)
let a11ySettingsTab = Label(Tab.settings).labelStyle(.titleOnly)
- .accessibilityLabel(Tab.settings.title)
// "Settings"
+ .accessibilityLabel(settingsTitle)
+ /// NavigationViews for Balances & Settings
+ let balancesStack = NavigationView {
+ BalancesListView(stack: stack.push(balancesTitle),
+ selectedBalance: $selectedBalance,
+// shouldReloadPending: $shouldReloadPending,
+ shouldReloadBalances: $shouldReloadBalances)
+ .navigationTitle(balancesTitle)
+ .background(balanceActions)
+ }.navigationViewStyle(.stack)
+ let settingsStack = NavigationView {
+ SettingsView(stack: stack.push(),
+ navTitle: settingsTitle)
+ .background(settingsActions)
+ }.navigationViewStyle(.stack)
+ /// our custom tabBar with the Actions button in the middle
+ let tabBarView = TabBarView(selection: tabSelection(), userAction:
$userAction, hidden: $navModel.tabBarHidden) {
+ logger.log("onActionTab")
+ showActionSheet = true
+ } onActionDrag: {
+ logger.log("onActionDrag: showScanner = true")
+ showScanner = true
+ }
+ /// custom tabBar is rendered on top of the TabView, and overlaps its
tabBar
ZStack(alignment: .bottom) {
+ /// the tabItems (EMPTYSTRING .titleOnly) could indeed be omitted
and the app would work the same - but are needed for accessibilityLabel
TabView(selection: tabSelection()) {
- NavigationView {
- BalancesListView(stack: stack.push(balancesTitle),
- selectedBalance: $selectedBalance,
-// shouldReloadPending: $shouldReloadPending,
- shouldReloadBalances: $shouldReloadBalances)
- .navigationTitle(balancesTitle)
- .background(balanceActions)
- }.id(viewState.rootViewId) // any change to
rootViewId triggers popToRootView behaviour
- .navigationViewStyle(.stack)
+ balancesStack.id(viewState.rootViewId) // change
rootViewId to trigger popToRootView behaviour
.tag(Tab.balances)
.tabItem { a11yBalanceTab }
-
- Color.clear
+ Color.clear // can't use
EmptyView because then VoiceOver wouldn't have the Actions tab
.tag(Tab.actions)
.tabItem { a11yActionsTab }
-
- NavigationView {
- SettingsView(stack: stack.push(),
- navTitle: settingsTitle)
- .background(settingsActions)
- }.id(viewState2.rootViewId) // any change to
rootViewId triggers popToRootView behaviour
- .navigationViewStyle(.stack)
+ settingsStack.id(viewState2.rootViewId) // change
rootViewId to trigger popToRootView behaviour
.tag(Tab.settings)
.tabItem { a11ySettingsTab }
} // TabView
tabBarView
.ignoresSafeArea(.keyboard, edges: .bottom)
- .accessibilityHidden(true) // for a11y we use
the original tabBar, not our custom one
+ .accessibilityHidden(true) // for a11y we
use the original tabBar, not our custom one
} // ZStack
.frame(maxWidth: .infinity, maxHeight: .infinity)
.onNotification(.SendAction) { triggerAction(1) }
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 148/204: dismiss only if done, (continued)
- [taler-taler-ios] 148/204: dismiss only if done, gnunet, 2024/12/05
- [taler-taler-ios] 146/204: smaller tx icon in lists, gnunet, 2024/12/05
- [taler-taler-ios] 156/204: fix button position, gnunet, 2024/12/05
- [taler-taler-ios] 168/204: wording, gnunet, 2024/12/05
- [taler-taler-ios] 170/204: cleanup, gnunet, 2024/12/05
- [taler-taler-ios] 169/204: debug, gnunet, 2024/12/05
- [taler-taler-ios] 138/204: recvDisabled, gnunet, 2024/12/05
- [taler-taler-ios] 172/204: a11y for tabBar, gnunet, 2024/12/05
- [taler-taler-ios] 173/204: update after +, gnunet, 2024/12/05
- [taler-taler-ios] 174/204: only in debug mode, gnunet, 2024/12/05
- [taler-taler-ios] 176/204: cleanup, comments,
gnunet <=
- [taler-taler-ios] 179/204: Bump version to 0.13.8 (0.13.13), gnunet, 2024/12/05
- [taler-taler-ios] 180/204: Comparable, gnunet, 2024/12/05
- [taler-taler-ios] 181/204: don't update if same data, gnunet, 2024/12/05
- [taler-taler-ios] 188/204: regional exchange baseURL, gnunet, 2024/12/05
- [taler-taler-ios] 182/204: L10N helper, gnunet, 2024/12/05
- [taler-taler-ios] 184/204: don't add to knownBankAccounts, gnunet, 2024/12/05
- [taler-taler-ios] 190/204: timeToPay w.i.p., gnunet, 2024/12/05
- [taler-taler-ios] 191/204: layout, legal hint, gnunet, 2024/12/05
- [taler-taler-ios] 194/204: A11y, gnunet, 2024/12/05
- [taler-taler-ios] 136/204: Available for transfer, gnunet, 2024/12/05