2020-05-18 07:35:22 +00:00
|
|
|
(ns quo.haptic
|
|
|
|
(:require [react-native-haptic-feedback :default react-native-haptic-feedback]))
|
2020-03-05 07:01:30 +00:00
|
|
|
|
|
|
|
(def haptic-methods
|
|
|
|
{:selection "selection"
|
|
|
|
:impacet-light "impactLight"
|
|
|
|
:impact-medium "impactMedium"
|
|
|
|
:impact-heavy "impactHeavy"
|
|
|
|
:notification-success "notificationSuccess"
|
|
|
|
:notification-warning "notificationWarning"
|
|
|
|
:notification-error "notificationError"
|
|
|
|
:clock-tick "clockTick" ; (Android only)
|
|
|
|
:context-click "contextClick" ; (Android only)
|
|
|
|
:keyboard-press "keyboardPress" ; (Android only)
|
|
|
|
:keyboard-release "keyboardRelease" ; (Android only)
|
|
|
|
:keyboard-tap "keyboardTap" ; (Android only)
|
|
|
|
:long-press "longPress" ; (Android only)
|
|
|
|
:text-handle-move "textHandleMove" ; (Android only)
|
|
|
|
:virtual-key "virtualKey" ; (Android only)
|
|
|
|
:virtual-key-release "virtualKeyRelease" ; (Android only)
|
2019-09-07 12:57:22 +00:00
|
|
|
})
|
2020-03-05 07:01:30 +00:00
|
|
|
|
|
|
|
(defn trigger [method]
|
2020-05-18 07:35:22 +00:00
|
|
|
(.trigger ^js react-native-haptic-feedback (get haptic-methods method)))
|