commit f4f05a6c6b05276bbf1b60b3280dbc6c707fc1dd
parent 482bb12e3cc4bb0e1a92b5b719b03132967dbade
Author: Marc Stibane <marc@taler.net>
Date: Sun, 13 Apr 2025 14:43:59 +0200
shake
Diffstat:
3 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/TalerWallet1/Views/OIM/OIMView.swift b/TalerWallet1/Views/OIM/OIMView.swift
@@ -66,7 +66,6 @@ struct OIMView: View {
@State private var amountVal: UInt64 = 0
@State private var tappedVal: UInt64 = 0
@State private var flying: UInt64 = 0
- @State private var shake = false
var body: some View {
// let _ = Self._printChanges()
@@ -91,7 +90,6 @@ struct OIMView: View {
amountVal: $amountVal,
tappedVal: $tappedVal,
flying: $flying,
- shake: shake,
canEdit: false)
Spacer()
actions
@@ -116,7 +114,6 @@ struct OIMPayView: View {
@State private var amountVal: UInt64 = 0
@State private var tappedVal: UInt64 = 0
@State private var flying: UInt64 = 0
- @State private var shake = false
var body: some View {
// let _ = Self._printChanges()
@@ -129,7 +126,6 @@ struct OIMPayView: View {
amountVal: $amountVal,
tappedVal: $tappedVal,
flying: $flying,
- shake: shake,
canEdit: true)
Spacer()
}.border(.red)
@@ -159,7 +155,6 @@ struct OIMEditView: View {
@State private var tappedVal: UInt64 = 0
@State private var flying: UInt64 = 0
- @State private var shake = false
var isAvailable: UInt64 {
if useAvailable {
@@ -190,7 +185,6 @@ struct OIMEditView: View {
amountVal: $amountVal,
tappedVal: $tappedVal,
flying: $flying,
- shake: shake,
canEdit: true)
.zIndex(1) // make notes fly from topZ
.onChange(of: amountVal) { newVal in
@@ -203,8 +197,7 @@ struct OIMEditView: View {
availableVal: $availableVal,
amountVal: $amountVal,
tappedVal: $tappedVal,
- flying: $flying,
- shake: $shake)
+ flying: $flying)
.onChange(of: available) { newVal in
availableVal = intValue(newVal) - intValue(amount)
}
diff --git a/TalerWallet1/Views/OIM/OIMcurrencyScroller.swift b/TalerWallet1/Views/OIM/OIMcurrencyScroller.swift
@@ -15,7 +15,7 @@ struct OIMcurrencyScroller: View {
@Binding var amountVal: UInt64
@Binding var tappedVal: UInt64
@Binding var flying: UInt64
- @Binding var shake: Bool
+// @Binding var shake: Bool
@EnvironmentObject private var cash: OIMcash
@EnvironmentObject private var wrapper: NamespaceWrapper
@@ -34,12 +34,12 @@ struct OIMcurrencyScroller: View {
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(ms)) {
// print("shake start")
withAnimation(.shake1) {
- shake = true
+ cash.shake = value
}
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(ms)) {
// print("shake end")
withAnimation(.shake1) {
- shake = false
+ cash.shake = 0
}
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(ms)) {
withAnimation(.basic1) {
diff --git a/TalerWallet1/Views/OIM/OIMlineViews.swift b/TalerWallet1/Views/OIM/OIMlineViews.swift
@@ -54,7 +54,6 @@ struct OIMlineViews: View {
@Binding var amountVal: UInt64
@Binding var tappedVal: UInt64
@Binding var flying: UInt64
- let shake: Bool
let canEdit: Bool
@EnvironmentObject private var cash: OIMcash
@@ -79,7 +78,7 @@ struct OIMlineViews: View {
amountVal: $amountVal,
tappedVal: tappedVal,
flying: $flying,
- shake: shake,
+ shake: (cash.shake != 0),
canEdit: canEdit
).id("notes")
.matchedGeometryEffect(id: "notes", in: wrapper.namespace)
@@ -92,7 +91,7 @@ struct OIMlineViews: View {
amountVal: $amountVal,
tappedVal: tappedVal,
flying: $flying,
- shake: shake,
+ shake: (cash.shake != 0),
canEdit: canEdit
).id("coins")
.matchedGeometryEffect(id: "coins", in: wrapper.namespace)