taler-ios

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

commit 6c2392fb0f15acd1a83c28e04a6fdbf6b273e318
parent b9b1d0f8e4e3a9098f89021b9873ca6405d1451c
Author: Marc Stibane <marc@taler.net>
Date:   Fri, 29 Aug 2025 10:14:04 +0200

flyDelay

Diffstat:
MTalerWallet1/Helper/Animations.swift | 12++++++++++++
MTalerWallet1/Views/OIM/OIMcash.swift | 16++--------------
MTalerWallet1/Views/OIM/OIMlayout.swift | 6+++---
3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/TalerWallet1/Helper/Animations.swift b/TalerWallet1/Helper/Animations.swift @@ -27,6 +27,18 @@ var fastAnimations = true var debugAnimations = false #endif +var flyDelay: Double { // time +#if DEBUG + if debugAnimations { return 5.0 } + // return fastAnimations ? 5 : 1.0 +#endif + return fastAnimations ? 0.4 : 0.8 +} + +var curveDelay: Double { + flyDelay * 2 / 3 +} + fileprivate let FAST: TimeInterval = 0.25 fileprivate diff --git a/TalerWallet1/Views/OIM/OIMcash.swift b/TalerWallet1/Views/OIM/OIMcash.swift @@ -138,18 +138,6 @@ final class OIMcash: ObservableObject, Sendable { return 0 } - var flyDelay: Double { // time -#if DEBUG - if debugAnimations { return 5.0 } -// return fastAnimations ? 5 : 1.0 -#endif - return fastAnimations ? 0.4 : 0.8 - } - - var curveDelay: Double { - flyDelay * 2 / 3 - } - func sortByValue() -> OIMfunds { /// sorts ASCENDING but keeps the order of the IDs for identical values funds.sorted(by: { @@ -261,7 +249,7 @@ final class OIMcash: ObservableObject, Sendable { self.symLog.log(">>flipped \(morphFund.id) \(morphFund.value) \(morphFund.state.rawValue)") /// Stage 4: move inValues to final position, delete outValues from funds array - DispatchQueue.main.asyncAfter(deadline: .now() + self.flyDelay) { + DispatchQueue.main.asyncAfter(deadline: .now() + flyDelay) { morphFund.state = .arriving morphFund.value = inValue // stack position morphFund.morphTicker = nil // release `semaphore´ @@ -284,7 +272,7 @@ final class OIMcash: ObservableObject, Sendable { } /// Stage 5: transmute morphFund - DispatchQueue.main.asyncAfter(deadline: .now() + self.flyDelay) { + DispatchQueue.main.asyncAfter(deadline: .now() + flyDelay) { morphFund.state = .mutating // morphFund.state = .idle morphFund.outValue = nil diff --git a/TalerWallet1/Views/OIM/OIMlayout.swift b/TalerWallet1/Views/OIM/OIMlayout.swift @@ -92,10 +92,10 @@ struct OIMlayoutView: View { fund.state = .curve cash.updateFund(fund) } - endFlying(index, after: cash.flyDelay / 3) + endFlying(index, after: flyDelay / 3) } } else { - endFlying(index, after: cash.flyDelay) + endFlying(index, after: flyDelay) } withAnimation(.move1) { fund.state = fromChest ? .reveal : .isFlying // switch off matching @@ -112,7 +112,7 @@ struct OIMlayoutView: View { fund.state = .removing cash.updateFund(fund) } - DispatchQueue.main.asyncAfter(deadline: .now() + cash.flyDelay) { + DispatchQueue.main.asyncAfter(deadline: .now() + flyDelay) { symLog.log("*** remove:\(fund.value) \(fundID)") withAnimation(.move1) { cash.removeCash(id: fundID, value: fund.value)