From bc24c35f226951a21a84f3e97fbbd0b646c6e08a Mon Sep 17 00:00:00 2001 From: Marcin Czachursk Date: Sat, 4 Mar 2023 14:46:23 +0100 Subject: [PATCH] Check double tap functionality. --- Vernissage.xcodeproj/project.pbxproj | 4 ++-- Vernissage/Widgets/ImageRow.swift | 8 ++++---- Vernissage/Widgets/ImageRowAsync.swift | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Vernissage.xcodeproj/project.pbxproj b/Vernissage.xcodeproj/project.pbxproj index 96a594f..81e567f 100644 --- a/Vernissage.xcodeproj/project.pbxproj +++ b/Vernissage.xcodeproj/project.pbxproj @@ -1115,7 +1115,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 44; + CURRENT_PROJECT_VERSION = 45; DEVELOPMENT_ASSET_PATHS = "\"Vernissage/Preview Content\""; DEVELOPMENT_TEAM = B2U9FEKYP8; ENABLE_PREVIEWS = YES; @@ -1152,7 +1152,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 44; + CURRENT_PROJECT_VERSION = 45; DEVELOPMENT_ASSET_PATHS = "\"Vernissage/Preview Content\""; DEVELOPMENT_TEAM = B2U9FEKYP8; ENABLE_PREVIEWS = YES; diff --git a/Vernissage/Widgets/ImageRow.swift b/Vernissage/Widgets/ImageRow.swift index a6f220b..da37ee9 100644 --- a/Vernissage/Widgets/ImageRow.swift +++ b/Vernissage/Widgets/ImageRow.swift @@ -60,10 +60,7 @@ struct ImageRow: View { Image(uiImage: uiImage) .resizable() .aspectRatio(contentMode: .fit) - .onTapGesture{ - self.navigateToStatus() - } - .onLongPressGesture(minimumDuration: 0.2) { + .onTapGesture(count: 2) { Task { try? await self.client.statuses?.favourite(statusId: self.status.id) } @@ -71,6 +68,9 @@ struct ImageRow: View { self.showThumbImage = true HapticService.shared.fireHaptic(of: .buttonPress) } + .onTapGesture{ + self.navigateToStatus() + } if showThumbImage { FavouriteTouch { diff --git a/Vernissage/Widgets/ImageRowAsync.swift b/Vernissage/Widgets/ImageRowAsync.swift index 42de7ba..ec11278 100644 --- a/Vernissage/Widgets/ImageRowAsync.swift +++ b/Vernissage/Widgets/ImageRowAsync.swift @@ -119,6 +119,14 @@ struct ImageRowAsync: View { private func imageView(image: NukeUI.Image) -> some View { image + .onTapGesture(count: 2) { + Task { + try? await self.client.statuses?.favourite(statusId: self.statusViewModel.id) + } + + self.showThumbImage = true + HapticService.shared.fireHaptic(of: .buttonPress) + } .onTapGesture{ self.routerPath.navigate(to: .status( id: statusViewModel.id, @@ -128,14 +136,6 @@ struct ImageRowAsync: View { metaImageHeight: statusViewModel.getImageHeight() )) } - .onLongPressGesture(minimumDuration: 0.2) { - Task { - try? await self.client.statuses?.favourite(statusId: self.statusViewModel.id) - } - - self.showThumbImage = true - HapticService.shared.fireHaptic(of: .buttonPress) - } } private func recalculateSizeOfDownloadedImage(imageResponse: ImageResponse) {