mirror of
https://github.com/neon443/NearFuture.git
synced 2026-03-11 06:49:12 +00:00
add success haptic and indentation
This commit is contained in:
@@ -14,7 +14,7 @@ struct ContentView: View {
|
|||||||
@State private var showAddEventView: Bool = false
|
@State private var showAddEventView: Bool = false
|
||||||
@State private var symbolSearchInput: String = ""
|
@State private var symbolSearchInput: String = ""
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationSplitView {
|
NavigationSplitView {
|
||||||
List {
|
List {
|
||||||
NavigationLink {
|
NavigationLink {
|
||||||
@@ -77,7 +77,7 @@ struct ContentView: View {
|
|||||||
Label("New", systemImage: "plus")
|
Label("New", systemImage: "plus")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ struct CompleteEventButton: View {
|
|||||||
if progress >= 1 {
|
if progress >= 1 {
|
||||||
withAnimation { completeInProgress = false }
|
withAnimation { completeInProgress = false }
|
||||||
viewModel.completeEvent(&event)
|
viewModel.completeEvent(&event)
|
||||||
|
#if canImport(UIKit)
|
||||||
|
UINotificationFeedbackGenerator().notificationOccurred(.success)
|
||||||
|
#endif
|
||||||
timer.invalidate()
|
timer.invalidate()
|
||||||
progress = 0
|
progress = 0
|
||||||
}
|
}
|
||||||
@@ -50,7 +53,7 @@ struct CompleteEventButton: View {
|
|||||||
RunLoop.main.add(timer!, forMode: .common)
|
RunLoop.main.add(timer!, forMode: .common)
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Group {
|
Group {
|
||||||
if completeInProgress {
|
if completeInProgress {
|
||||||
ZStack {
|
ZStack {
|
||||||
@@ -86,7 +89,7 @@ struct CompleteEventButton: View {
|
|||||||
.spring(response: 0.2, dampingFraction: 0.75, blendDuration: 2),
|
.spring(response: 0.2, dampingFraction: 0.75, blendDuration: 2),
|
||||||
value: largeTick
|
value: largeTick
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct CircularProgressView: View {
|
struct CircularProgressView: View {
|
||||||
@@ -103,10 +106,10 @@ struct CircularProgressView: View {
|
|||||||
.stroke(
|
.stroke(
|
||||||
.one,
|
.one,
|
||||||
lineWidth: 5
|
lineWidth: 5
|
||||||
// style: StrokeStyle(
|
// style: StrokeStyle(
|
||||||
// lineWidth: 5,
|
// lineWidth: 5,
|
||||||
// lineCap: .round
|
// lineCap: .round
|
||||||
// )
|
// )
|
||||||
)
|
)
|
||||||
.rotationEffect(.degrees(-90))
|
.rotationEffect(.degrees(-90))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user