mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 05:45:18 +00:00
Allow long-press reblur on images
This commit is contained in:
@@ -106,6 +106,7 @@ struct BlockRevealImageView: View {
|
||||
loadImage()
|
||||
}
|
||||
.gesture(gestureHandler)
|
||||
.simultaneousGesture(longPressGesture)
|
||||
}
|
||||
|
||||
private func loadImage() {
|
||||
@@ -140,6 +141,17 @@ struct BlockRevealImageView: View {
|
||||
}
|
||||
return doubleTap.exclusively(before: singleTap)
|
||||
}
|
||||
|
||||
private var longPressGesture: some Gesture {
|
||||
LongPressGesture(minimumDuration: 0.4).onEnded { _ in
|
||||
guard !isSending else { return }
|
||||
if !isBlurred {
|
||||
withAnimation(.easeInOut(duration: 0.2)) {
|
||||
isBlurred = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct BlockRevealMask: Shape {
|
||||
|
||||
Reference in New Issue
Block a user