summaryrefslogtreecommitdiff
path: root/TalerWallet1/Views/HelperViews/Buttons.swift
diff options
context:
space:
mode:
Diffstat (limited to 'TalerWallet1/Views/HelperViews/Buttons.swift')
-rw-r--r--TalerWallet1/Views/HelperViews/Buttons.swift168
1 files changed, 5 insertions, 163 deletions
diff --git a/TalerWallet1/Views/HelperViews/Buttons.swift b/TalerWallet1/Views/HelperViews/Buttons.swift
index 945c86e..c40b542 100644
--- a/TalerWallet1/Views/HelperViews/Buttons.swift
+++ b/TalerWallet1/Views/HelperViews/Buttons.swift
@@ -189,170 +189,12 @@ struct TalerButtonStyle: ButtonStyle {
}
}
-
-struct Buttons_Previews: PreviewProvider {
+#if DEBUG
+fileprivate struct ContentView_Previews: PreviewProvider {
static var previews: some View {
- VStack {
- HStack {
- Button("1000") {
- Controller.shared.playSound(1000)
- }.padding()
- Button("1013") {
- Controller.shared.playSound(1013)
- }.padding()
- Button("1008") {
- Controller.shared.playSound(1008)
- }.padding()
- Button("1001") {
- Controller.shared.playSound(1001)
- }.padding()
- Button("1018") {
- Controller.shared.playSound(1018)
- }.padding()
- } // Single
- HStack {
- Button("1003") {
- Controller.shared.playSound(1003)
- }.padding()
- Button("1004") {
- Controller.shared.playSound(1004)
- }.padding()
- Button("1016") {
- Controller.shared.playSound(1016)
- }.padding()
- Button("1022") {
- Controller.shared.playSound(1022)
- }.padding()
- Button("1034") {
- Controller.shared.playSound(1034)
- }.padding()
- } // Double
- HStack {
- Button("1023") {
- Controller.shared.playSound(1023)
- }.padding()
- Button("1029") {
- Controller.shared.playSound(1029)
- }.padding()
- Button("1014") {
- Controller.shared.playSound(1014)
- }.padding()
- Button("1021") {
- Controller.shared.playSound(1021)
- }.padding()
- Button("1031") {
- Controller.shared.playSound(1031)
- }.padding()
- } // long single
- HStack {
- Button("1002") {
- Controller.shared.playSound(1002) // == 7,12,15
- }.padding()
- Button("1006") {
- Controller.shared.playSound(1006)
- }.padding()
- Button("1025") {
- Controller.shared.playSound(1025)
- }.padding()
- Button("1026") {
- Controller.shared.playSound(1026)
- }.padding()
- Button("1033") {
- Controller.shared.playSound(1033)
- }.padding()
- } // Triple
- HStack {
- Button("1005") {
- Controller.shared.playSound(1005) // 17
- }.padding()
- Button("1009") {
- Controller.shared.playSound(1009)
- }.padding()
- Button("1010") {
- Controller.shared.playSound(1010)
- }.padding()
- } // Double 2
- HStack {
- Button("1030") {
- Controller.shared.playSound(1030)
- }.padding()
- Button("1035") {
- Controller.shared.playSound(1035)
- }.padding()
- Button("1036") {
- Controller.shared.playSound(1036)
- }.padding()
- Button("1027") {
- Controller.shared.playSound(1027)
- }.padding()
- }
- HStack {
- Button("1020") {
- Controller.shared.playSound(1020)
- }.padding()
- Button("1024") {
- Controller.shared.playSound(1024)
- }.padding()
- Button("1032") {
- Controller.shared.playSound(1032)
- }.padding()
- Button("1028") {
- Controller.shared.playSound(1028)
- }.padding()
- }
- HStack {
- PlusButton() {
- }.padding()
- HamburgerButton() {
- }.padding()
- QRButton() {
- }.padding()
- ReloadButton(disabled: false) {
- }.padding()
- ReloadButton(disabled: true) {
- }.padding()
- }
- Button(String(localized: "Accept"), action: {
- Controller.shared.playSound(1028)
- })
- .buttonStyle(TalerButtonStyle(type: .prominent))
- .padding(.horizontal)
- }
+ let testButtonTitle = String("Placeholder")
+ Button(testButtonTitle) {}
+ .buttonStyle(TalerButtonStyle(type: .balance, aligned: .trailing))
}
}
-
-#if DEBUG
-//fileprivate struct ContentView: View {
-// @State var isOn = false
-// //The better route is to have a separate variable to control the animations
-// // This prevents unpleasant side-effects.
-// @State private var animate = false
-//
-// var body: some View {
-// VStack {
-// Text(verbatim: "I don't change.")
-// .padding()
-// Button("Press me, I do change") {
-// isOn.toggle()
-// animate = false
-// // Because .opacity is animated, we need to switch it
-// // back so the button shows.
-// DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
-// animate = true
-// }
-// }
-// // In this case I chose to animate .opacity
-// .opacity(animate ? 1 : 0)
-// .animation(.easeIn, value: animate)
-// .frame(width: 300, height: 400)
-// // If you want the button to animate when the view appears, you need to change the value
-// .onAppear { animate = true }
-// }
-// }
-//}
-//fileprivate struct ContentView_Previews: PreviewProvider {
-// static var previews: some View {
-// ContentView()
-// }
-//}
#endif