taler-ios

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

commit 2ac2b1784e8b26ec38ec176d2571dca3059011a6
parent 485bda81468f14377d545ef599db131bfa403922
Author: Marc Stibane <marc@taler.net>
Date:   Mon, 21 Jul 2025 17:48:27 +0200

INVISIBLE

Diffstat:
MTalerWallet1/Controllers/PublicConstants.swift | 1+
MTalerWallet1/Views/HelperViews/BarGraph.swift | 4++--
MTalerWallet1/Views/HelperViews/GradientBorder.swift | 4++--
MTalerWallet1/Views/OIM/OIMEditView.swift | 2+-
MTalerWallet1/Views/OIM/OIMSubjectView.swift | 10+++++-----
MTalerWallet1/Views/OIM/OIMactionButtons.swift | 4++--
MTalerWallet1/Views/OIM/OIMbalances.swift | 17++++++++---------
MTalerWallet1/Views/OIM/OIMcurrencyButton.swift | 4++--
MTalerWallet1/Views/OIM/OIMp2pReceiveView.swift | 4++--
MTalerWallet1/Views/OIM/OIMviews.swift | 7++++---
MTalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift | 2+-
11 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/TalerWallet1/Controllers/PublicConstants.swift b/TalerWallet1/Controllers/PublicConstants.swift @@ -15,6 +15,7 @@ let TALER_LOGO = "taler-logo-2023-black" let TALER_LOGO = "taler-logo-2023-red" #endif +public let INVISIBLE = 0.001 public let MAXEXCHANGES = 1000 // per currency public let CHF_4217 = "CHF" // ISO-4217 Swiss Francs public let EUR_4217 = "EUR" // ISO-4217 Euro diff --git a/TalerWallet1/Views/HelperViews/BarGraph.swift b/TalerWallet1/Views/HelperViews/BarGraph.swift @@ -90,7 +90,7 @@ struct BarGraph: View { let botHeight = incoming ? barHeight : valueTransparent if topHeight > 0 { Rectangle() - .opacity(0.001) + .opacity(INVISIBLE) .frame(width: width, height: topHeight) } Rectangle() @@ -98,7 +98,7 @@ struct BarGraph: View { .frame(width: width, height: valueColored) if botHeight > 0 { Rectangle() - .opacity(0.001) + .opacity(INVISIBLE) .frame(width: width, height: botHeight) } } diff --git a/TalerWallet1/Views/HelperViews/GradientBorder.swift b/TalerWallet1/Views/HelperViews/GradientBorder.swift @@ -127,10 +127,10 @@ struct GradientBorder<Content: View>: View { .frame(width: size, height: size).foregroundStyle(background) .shadow(color: background.opacity(0.5), radius: 10, x: 0, y: 10) let gradient = Gradient(colors: [ - color.opacity(0.01), + color.opacity(INVISIBLE), color, color, - color.opacity(0.01)] + color.opacity(INVISIBLE)] ) let linearGradient = LinearGradient(gradient: gradient, startPoint: .top, endPoint: .bottom) let rotatingRect = Rectangle() diff --git a/TalerWallet1/Views/OIM/OIMEditView.swift b/TalerWallet1/Views/OIM/OIMEditView.swift @@ -132,7 +132,7 @@ struct OIMEditView: View { .clipped(antialiased: true) .padding(.horizontal, 5) .ignoresSafeArea(edges: .horizontal) - .opacity(sending ? 0.01 : 1.0) + .opacity(sending ? INVISIBLE : 1) } // .border(.red) } // ZStack diff --git a/TalerWallet1/Views/OIM/OIMSubjectView.swift b/TalerWallet1/Views/OIM/OIMSubjectView.swift @@ -100,18 +100,18 @@ struct OIMSubjectView: View { secondAmount: amountToTransfer) Spacer() GoalsHStack(goals: goals1, selectedGoal: $selectedGoal) - .opacity(appeared ? 1.0 : 0.01) - .scaleEffect(appeared ? 1.0 : 0.3) + .opacity(appeared ? 1 : INVISIBLE) + .scaleEffect(appeared ? 1 : 0.3) GoalsHStack(goals: goals2, selectedGoal: $selectedGoal) - .opacity(appeared ? 1.0 : 0.01) - .scaleEffect(appeared ? 1.0 : 0.3) + .opacity(appeared ? 1 : INVISIBLE) + .scaleEffect(appeared ? 1 : 0.3) Spacer() OIMlineView(stack: stack.push(), cash: cash, amountVal: $amountVal, tappedVal: $ignoreTapped, canEdit: false) - .scaleEffect(selectedGoal == nil ? 0.6 : 1.0) + .scaleEffect(selectedGoal == nil ? 0.6 : 1) .onTapGesture { var transaction = Transaction() transaction.disablesAnimations = true diff --git a/TalerWallet1/Views/OIM/OIMactionButtons.swift b/TalerWallet1/Views/OIM/OIMactionButtons.swift @@ -39,7 +39,7 @@ struct OIMactionButton: View { .foregroundStyle(WalletColors().talerColor) } .tagStyle(isFinal ? .bordered : .borderless) - .opacity(disabled ? 0.01 : 1.0) + .opacity(disabled ? INVISIBLE : 1) .disabled(disabled) } } @@ -58,7 +58,7 @@ struct OIMrequestButton: View { .foregroundStyle(WalletColors().talerColor) } .tagStyle(.bordered) - .opacity(enabled ? 1.0 : 0.01) + .opacity(enabled ? 1 : INVISIBLE) .disabled(!enabled) } } diff --git a/TalerWallet1/Views/OIM/OIMbalances.swift b/TalerWallet1/Views/OIM/OIMbalances.swift @@ -161,20 +161,20 @@ struct OIMbalances: View { QRButton(hideTitle: true) { qrButtonTapped = true } - .opacity(showQR ? 1.0 : 0.01) + .opacity(showQR ? 1 : INVISIBLE) .frame(width: OIMbuttonSize, height: OIMbuttonSize) .matchedGeometryEffect(id: OIMBACK, in: wrapper.namespace, isSource: true) } else { let showRequest = viewState == .chestIsOpen OIMactionButton(type: .requestP2P, isFinal: false, action: requestTapped) .frame(width: OIMbuttonSize, height: OIMbuttonSize) - .opacity(showRequest ? 1.0 : 0.01) + .opacity(showRequest ? 1 : INVISIBLE) } Spacer() let showSend = viewState == .chestIsOpen OIMactionButton(type: .sendP2P, isFinal: false, action: sendTapped) .frame(width: OIMbuttonSize, height: OIMbuttonSize) - .opacity(showSend ? 1.0 : 0.01) + .opacity(showSend ? 1 : INVISIBLE) } let maxAvailable = cash.max(available: available?.centValue ?? 0) @@ -206,8 +206,8 @@ struct OIMbalances: View { amountVal: $availableVal, tappedVal: $tappedVal, canEdit: false) - .opacity(isOpen ? 1.0 : 0.01) -// .scaleEffect(scaleMoney ? 0.6 : 1.0) + .opacity(isOpen ? 1 : INVISIBLE) +// .scaleEffect(scaleMoney ? 0.6 : 1) .onTapGesture { if viewState == .historyShown { closeHistory() @@ -244,11 +244,10 @@ struct OIMbalances: View { } .frame(width: size, height: size) .zIndex(itsMe ? 3 : 0) - .opacity((isClosed || itsMe) ? 1.0 : 0.01) + .opacity((isClosed || itsMe) ? 1 : INVISIBLE) .matchedGeometryEffect(id: itsMe ? OIMNUMBER : String(index), in: wrapper.namespace, isSource: false) - .frame(width: size, height: size) Color.clear .frame(width: 40, height: 40) .matchedGeometryEffect(id: OIMCHEST + String(index), in: wrapper.namespace, isSource: true) @@ -271,8 +270,8 @@ struct OIMbalances: View { .padding(.horizontal, 5) .ignoresSafeArea(edges: .horizontal) .scrollDisabled(true) - .opacity(showDrawer ? 1.0 : 0.01) - } // for matching positions of money in the drawer + .opacity(showDrawer ? 1 : INVISIBLE) + } // source for matching positions of money in the drawer } } .onAppear { diff --git a/TalerWallet1/Views/OIM/OIMcurrencyButton.swift b/TalerWallet1/Views/OIM/OIMcurrencyButton.swift @@ -98,9 +98,9 @@ struct OIMmod: AnimatableModifier { let shadow = (3 - 8) * pct + 8 return Button(action: action) { - animatedImage.opacity(invisible ? 0.001 + animatedImage.opacity(invisible ? INVISIBLE : unavailable ? 0.5 - : 1.0) + : 1) } .buttonStyle(OIMbuttonStyle()) .disabled(disabled) diff --git a/TalerWallet1/Views/OIM/OIMp2pReceiveView.swift b/TalerWallet1/Views/OIM/OIMp2pReceiveView.swift @@ -62,8 +62,8 @@ struct OIMp2pReceiveView: View { canEdit: false) Spacer() } - .opacity(appeared ? 1.0 : 0.01) - .scaleEffect(appeared ? 1.0 : 0.3) + .opacity(appeared ? 1 : INVISIBLE) + .scaleEffect(appeared ? 1 : 0.3) .task { amount = effective amountVal = effective.centValue diff --git a/TalerWallet1/Views/OIM/OIMviews.swift b/TalerWallet1/Views/OIM/OIMviews.swift @@ -74,11 +74,11 @@ struct OIMtitleView: View { var body: some View { let chest = cash.currency.chest HStack(alignment: .top) { - // invisible - only serves as point where the selected balance chest moves to + // invisible - source where the selected balance chest (target) moves to OIMbalanceButton(isOpen: true, chest: chest, isFinal: false) {} .frame(width: OIMbuttonSize, height: OIMbuttonSize) .disabled(true) - .opacity(0.01) + .opacity(INVISIBLE) .matchedGeometryEffect(id: OIMNUMBER, in: wrapper.namespace, isSource: true) .accessibilityHidden(true) @@ -92,10 +92,11 @@ struct OIMtitleView: View { OIMamountV(amount: secondAmount, currencyName: cash.currency.currency) } + // invisible - source for money (target) flying out of and back in the open chest OIMactionButton(type: .sendP2P, isFinal: false, action: nil) .frame(width: OIMactionSize, height: OIMbuttonSize) .disabled(true) - .opacity(0.01) + .opacity(INVISIBLE) .matchedGeometryEffect(id: OIMACTION, in: wrapper.namespace, isSource: true) .accessibilityHidden(true) } diff --git a/TalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift b/TalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift @@ -45,7 +45,7 @@ struct ExchangeRowView: View { .talerFont(.table) .foregroundColor(.secondary) }.background { // only needed for .onTapGesture - Color.gray.opacity(0.001) + Color.gray.opacity(INVISIBLE) } let showToS = WithdrawTOSView(stack: stack.push(), exchangeBaseUrl: baseURL,