diff options
Diffstat (limited to 'Sora/Views/Post/Grid')
| -rw-r--r-- | Sora/Views/Post/Grid/PostGridView.swift | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Sora/Views/Post/Grid/PostGridView.swift b/Sora/Views/Post/Grid/PostGridView.swift index be56286..192b40f 100644 --- a/Sora/Views/Post/Grid/PostGridView.swift +++ b/Sora/Views/Post/Grid/PostGridView.swift @@ -119,7 +119,7 @@ struct PostGridView: View { // swiftlint:disable:this type_body_length } } .id(queryID) - .animation(.easeInOut, value: manager.historyIndex) + .transition(.opacity) } .scrollPosition(id: scrollPosition) #if os(iOS) @@ -290,7 +290,9 @@ struct PostGridView: View { // swiftlint:disable:this type_body_length } label: { Label("Previous Search", systemImage: "chevron.left") } primaryAction: { - manager.goBackInHistory() + withAnimation { + manager.goBackInHistory() + } } .disabled(!manager.canGoBackInHistory) } @@ -310,7 +312,9 @@ struct PostGridView: View { // swiftlint:disable:this type_body_length } label: { Label("Next Search", systemImage: "chevron.right") } primaryAction: { - manager.goForwardInHistory() + withAnimation { + manager.goForwardInHistory() + } } .disabled(!manager.canGoForwardInHistory) } @@ -334,14 +338,20 @@ struct PostGridView: View { // swiftlint:disable:this type_body_length DragGesture() .onEnded { value in if value.startLocation.x < 50 && value.translation.width > 100 { - manager.goBackInHistory() + withAnimation { + manager.goBackInHistory() + } + debugPrint("ContentView: Swipe left, \(manager.searchHistory)") } if value.startLocation.x > (UIScreen.main.bounds.width - 50) && value.translation.width < -100 { - manager.goForwardInHistory() + withAnimation { + manager.goForwardInHistory() + } + debugPrint("ContentView: Swipe right, \(manager.searchHistory)") } } |