about summary refs log tree commit diff
path: root/patches/expo-haptics+12.8.1.patch
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-04-11 15:20:26 -0700
committerGitHub <noreply@github.com>2024-04-11 15:20:26 -0700
commit740cd029d7162a936d16b427201eb8972e365b94 (patch)
treeff4cf80cc8cd88bd958abd68c3cb3aa46328240e /patches/expo-haptics+12.8.1.patch
parent9007810cdb5ffc8fbdf8e2a2af6c073b76b318f3 (diff)
downloadvoidsky-740cd029d7162a936d16b427201eb8972e365b94.tar.zst
Improve Android haptic, offer toggle for haptics in the app (#3482)
* improve android haptics, offer toggle for haptics

* update haptics.ts

* default to false

* simplify to `playHaptic`

* just leave them as `feedInfo`

* use a hook for `playHaptic`

* missed one of them
Diffstat (limited to 'patches/expo-haptics+12.8.1.patch')
-rw-r--r--patches/expo-haptics+12.8.1.patch13
1 files changed, 13 insertions, 0 deletions
diff --git a/patches/expo-haptics+12.8.1.patch b/patches/expo-haptics+12.8.1.patch
new file mode 100644
index 000000000..a95b56f3b
--- /dev/null
+++ b/patches/expo-haptics+12.8.1.patch
@@ -0,0 +1,13 @@
+diff --git a/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt b/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt
+index 26c52af..b949a4c 100644
+--- a/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt
++++ b/node_modules/expo-haptics/android/src/main/java/expo/modules/haptics/HapticsModule.kt
+@@ -42,7 +42,7 @@ class HapticsModule : Module() {
+
+   private fun vibrate(type: HapticsVibrationType) {
+     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+-      vibrator.vibrate(VibrationEffect.createWaveform(type.timings, type.amplitudes, -1))
++      vibrator.vibrate(VibrationEffect.createWaveform(type.oldSDKPattern, intArrayOf(0, 100), -1))
+     } else {
+       @Suppress("DEPRECATION")
+       vibrator.vibrate(type.oldSDKPattern, -1)