Skip to content

Commit 38e63e5

Browse files
committed
fix: android compilation and runtime issues
1 parent 16f222b commit 38e63e5

File tree

4 files changed

+45
-31
lines changed

4 files changed

+45
-31
lines changed

android/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ apply plugin: "com.android.library"
2424
apply plugin: "kotlin-android"
2525
apply from: '../nitrogen/generated/android/ahap+autolinking.gradle'
2626

27-
apply plugin: "com.facebook.react"
28-
2927
def getExtOrIntegerDefault(name) {
3028
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Ahap_" + name]).toInteger()
3129
}

android/src/main/java/com/margelo/nitro/ahap/Ahap.kt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class Ahap : HybridAhapSpec() {
77
override val memorySize: Long
88
get() = 0L
99

10+
private var hapticsEnabled: Boolean = true
11+
1012
override fun startHaptic(events: Array<HapticEvent>, curves: Array<HapticCurve>) {
1113
// TODO: Android haptics implementation not yet supported
1214
}
@@ -42,4 +44,28 @@ class Ahap : HybridAhapSpec() {
4244
override fun destroyContinuousPlayer(playerId: String) {
4345
// TODO: Android haptics implementation not yet supported
4446
}
47+
48+
// MARK: - Global Haptics Enable/Disable
49+
50+
override fun setHapticsEnabled(enabled: Boolean) {
51+
hapticsEnabled = enabled
52+
}
53+
54+
override fun getHapticsEnabled(): Boolean {
55+
return hapticsEnabled
56+
}
57+
58+
// MARK: - System Haptics (Predefined OS-level feedback)
59+
60+
override fun triggerImpact(style: HapticImpactStyle) {
61+
// TODO: Android haptics implementation not yet supported
62+
}
63+
64+
override fun triggerNotification(type: HapticNotificationType) {
65+
// TODO: Android haptics implementation not yet supported
66+
}
67+
68+
override fun triggerSelection() {
69+
// TODO: Android haptics implementation not yet supported
70+
}
4571
}

example/bun.lock

Lines changed: 18 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"preinstall": "cd .. && bun install && cd example"
1313
},
1414
"dependencies": {
15+
"semver": "^7.6.0",
1516
"@expo/vector-icons": "^15.0.3",
1617
"@react-native-community/slider": "^5.1.1",
1718
"@react-native-segmented-control/segmented-control": "^2.5.7",

0 commit comments

Comments
 (0)