Depending on service logic needs, you can use parallelGesture or priorityGesture to resolve the conflict between custom gestures and system gestures.
To retain the default system gesture effects and also respond to custom long press and pan gestures, use parallelGesture for gesture binding.
Refer to the code snippet below.
@Entry
@Component
struct Index {
build() {
Column() {
Image($r('app.media.app_icon'))
.width('80%')
.parallelGesture(GestureGroup(GestureMode.Exclusive,
TapGesture({ count: 2, fingers: 1 })
// Double click
.onAction(() => {
console.log('TapGesture--double click');
}),
TapGesture({ count: 1, fingers: 1 })
// TapGesture single
.onAction(() => {
console.log('TapGesture--single click');
}),
LongPressGesture({ repeat: true })
// LongPressGesture Long
.onAction(() => {
console.log('LongPressGesture--Long press');
}),
PanGesture()
// PanGesture drag
.onActionStart((gestureEvent: GestureEvent | undefined) => {
console.info('PanGesture--drag');
})
))
}
.height('100%')
.width('100%')
}
} Reference