taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit 32672f97dc777ab606557f7f094d959ace6498c4
parent 0ba7f1e6a04ba74ec5bad38383b01ca07946668a
Author: Marc Stibane <marc@taler.net>
Date:   Sun, 13 Apr 2025 08:39:12 +0200

CallStack

Diffstat:
MTalerWallet1/Views/OIM/OIMView.swift | 9++++++---
MTalerWallet1/Views/OIM/OIMcurrencyViews2.swift | 2++
MTalerWallet1/Views/OIM/OIMlineViews.swift | 39+++++++++++++++++++++++----------------
3 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/TalerWallet1/Views/OIM/OIMView.swift b/TalerWallet1/Views/OIM/OIMView.swift @@ -87,7 +87,8 @@ struct OIMView: View { OIMbackground(amount: amount, currencyName: currency.noteBase) { VStack { Spacer() - OIMlineView(currency: currency, + OIMlineView(stack: stack.push(), + currency: currency, amountVal: $amountVal, tappedVal: tappedVal, flying: $flying, @@ -123,7 +124,8 @@ struct OIMPayView: View { OIMbackground(amount: amount, currencyName: currency.noteBase) { VStack { Spacer() - OIMlineView(currency: currency, + OIMlineView(stack: stack.push(), + currency: currency, amountVal: $amountVal, tappedVal: tappedVal, flying: $flying, @@ -169,7 +171,8 @@ struct OIMEditView: View { ZStack { // without this, money would fly below the scroller VStack { // even though this is the only item in the ZStack Spacer() - OIMlineView(currency: currency, + OIMlineView(stack: stack.push(), + currency: currency, amountVal: $amountVal, tappedVal: tappedVal, flying: $flying, diff --git a/TalerWallet1/Views/OIM/OIMcurrencyViews2.swift b/TalerWallet1/Views/OIM/OIMcurrencyViews2.swift @@ -12,6 +12,7 @@ import taler_swift // MARK: - // renders a stack of (identical) banknotes with offset 10,20 struct OIMnoteStackV: View { + let stack: CallStack let value: Int let count: Int let currency: OIMcurrency @@ -64,6 +65,7 @@ struct OIMnoteStackV: View { // renders a stack of (identical) coins with offset size/16 struct OIMcoinStackV: View { + let stack: CallStack let value: Int let count: Int let currency: OIMcurrency diff --git a/TalerWallet1/Views/OIM/OIMlineViews.swift b/TalerWallet1/Views/OIM/OIMlineViews.swift @@ -10,6 +10,7 @@ import taler_swift // renders a spread of banknote-stacks in 1 row struct OIMnotesView1: View { + let stack: CallStack let spread: OIMdenominations let currency: OIMcurrency @Binding var amountVal: Int @@ -27,7 +28,8 @@ struct OIMnotesView1: View { let shouldFly = tappedVal == value let count = spread[index] + (shouldFly ? 1 : 0) if count > 0 { - OIMnoteStackV(value: value, + OIMnoteStackV(stack: stack.push(), + value: value, count: count, currency: currency, tappedVal: tappedVal, @@ -46,6 +48,7 @@ struct OIMnotesView1: View { // MARK: - // renders a spread of coin-stacks in 1 row struct OIMcoinsView1: View { + let stack: CallStack let spread: OIMdenominations let currency: OIMcurrency @Binding var amountVal: Int @@ -62,7 +65,8 @@ struct OIMcoinsView1: View { let shouldFly = tappedVal == value let count = spread[index] + (shouldFly ? 1 : 0) if count > 0 { - OIMcoinStackV(value: value, + OIMcoinStackV(stack: stack.push(), + value: value, count: count, currency: currency, tappedVal: tappedVal, @@ -83,6 +87,7 @@ fileprivate let horzSpacing: CGFloat = 20 fileprivate let vertSpacing: CGFloat = 10 struct OIMlineView: View { + let stack: CallStack let currency: OIMcurrency @Binding var amountVal: Int let tappedVal: Int @@ -104,25 +109,27 @@ struct OIMlineView: View { #endif let result = currency.notesCoins(amountVal) // Text("notes: \(result.0), coins: \(result.1)") - let notes = OIMnotesView1(spread: result.0, - currency: currency, - amountVal: $amountVal, - tappedVal: tappedVal, - flying: $flying, - shake: shake, - canEdit: canEdit + let notes = OIMnotesView1(stack: stack.push(), + spread: result.0, + currency: currency, + amountVal: $amountVal, + tappedVal: tappedVal, + flying: $flying, + shake: shake, + canEdit: canEdit ).id("notes") .matchedGeometryEffect(id: "notes", in: wrapper.namespace) #if DEBUG .border(blue) #endif - let coins = OIMcoinsView1(spread: result.1, - currency: currency, - amountVal: $amountVal, - tappedVal: tappedVal, - flying: $flying, - shake: shake, - canEdit: canEdit + let coins = OIMcoinsView1(stack: stack.push(), + spread: result.1, + currency: currency, + amountVal: $amountVal, + tappedVal: tappedVal, + flying: $flying, + shake: shake, + canEdit: canEdit ).id("coins") .matchedGeometryEffect(id: "coins", in: wrapper.namespace) #if DEBUG