mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-08-15 07:06:11 +00:00
Allow long-press reblur on images
This commit is contained in:
parent
9e0542df73
commit
567e1dbbbf
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user