Skip to content

Commit 5dbd3ca

Browse files
Added config for double tap message overlay
1 parent e8bec9b commit 5dbd3ca

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageContainerView.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ struct MessageContainerView<Factory: ViewFactory>: View {
9393
})
9494
}
9595
)
96-
.onTapGesture {}
96+
.onTapGesture(count: 2) {
97+
if messageListConfig.doubleTapOverlayEnabled {
98+
handleGestureForMessage(showsMessageActions: true)
99+
}
100+
}
97101
.onLongPressGesture(perform: {
98102
handleGestureForMessage(showsMessageActions: true)
99103
})

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageListConfig.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public struct MessageListConfig {
1515
messagePaddings: MessagePaddings = MessagePaddings(),
1616
dateIndicatorPlacement: DateIndicatorPlacement = .overlay,
1717
pageSize: Int = 50,
18-
messagePopoverEnabled: Bool = true
18+
messagePopoverEnabled: Bool = true,
19+
doubleTapOverlayEnabled: Bool = false
1920
) {
2021
self.messageListType = messageListType
2122
self.typingIndicatorPlacement = typingIndicatorPlacement
@@ -25,6 +26,7 @@ public struct MessageListConfig {
2526
self.dateIndicatorPlacement = dateIndicatorPlacement
2627
self.pageSize = pageSize
2728
self.messagePopoverEnabled = messagePopoverEnabled
29+
self.doubleTapOverlayEnabled = doubleTapOverlayEnabled
2830
}
2931

3032
let messageListType: MessageListType
@@ -35,6 +37,7 @@ public struct MessageListConfig {
3537
let dateIndicatorPlacement: DateIndicatorPlacement
3638
let pageSize: Int
3739
let messagePopoverEnabled: Bool
40+
let doubleTapOverlayEnabled: Bool
3841
}
3942

4043
/// Contains information about the message paddings.

0 commit comments

Comments
 (0)