Check double tap functionality.

This commit is contained in:
Marcin Czachursk 2023-03-04 14:46:23 +01:00
parent 12684bce26
commit bc24c35f22
3 changed files with 14 additions and 14 deletions

View File

@ -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;

View File

@ -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 {

View File

@ -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) {