Skip to content

Commit c87a6ef

Browse files
committed
fix(android): events on new arch
1 parent dcbab44 commit c87a6ef

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

android/src/main/java/com/lodev09/truesheet/TrueSheetEvent.kt

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ class TrueSheetEvent(surfaceId: Int, viewId: Int, private val name: String, priv
1010
override fun getEventData(): WritableMap = data ?: Arguments.createMap()
1111

1212
companion object {
13-
const val MOUNT = "mount"
14-
const val PRESENT = "present"
15-
const val DISMISS = "dismiss"
16-
const val SIZE_CHANGE = "sizeChange"
17-
const val DRAG_BEGIN = "dragBegin"
18-
const val DRAG_CHANGE = "dragChange"
19-
const val DRAG_END = "dragEnd"
20-
const val CONTAINER_SIZE_CHANGE = "containerSizeChange"
13+
const val MOUNT = "topMount"
14+
const val PRESENT = "topPresent"
15+
const val DISMISS = "topDismiss"
16+
const val SIZE_CHANGE = "topSizeChange"
17+
const val DRAG_BEGIN = "topDragBegin"
18+
const val DRAG_CHANGE = "topDragChange"
19+
const val DRAG_END = "topDragEnd"
20+
const val CONTAINER_SIZE_CHANGE = "topContainerSizeChange"
2121
}
2222
}

android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ class TrueSheetViewManager : ViewGroupManager<TrueSheetView>() {
2222
view.onHostDestroy()
2323
}
2424

25-
override fun getExportedCustomDirectEventTypeConstants(): MutableMap<String, Any>? =
26-
MapBuilder.builder<String, Any>()
27-
.put(TrueSheetEvent.MOUNT, MapBuilder.of("registrationName", "onMount"))
28-
.put(TrueSheetEvent.PRESENT, MapBuilder.of("registrationName", "onPresent"))
29-
.put(TrueSheetEvent.DISMISS, MapBuilder.of("registrationName", "onDismiss"))
30-
.put(TrueSheetEvent.SIZE_CHANGE, MapBuilder.of("registrationName", "onSizeChange"))
31-
.put(TrueSheetEvent.DRAG_BEGIN, MapBuilder.of("registrationName", "onDragBegin"))
32-
.put(TrueSheetEvent.DRAG_CHANGE, MapBuilder.of("registrationName", "onDragChange"))
33-
.put(TrueSheetEvent.DRAG_END, MapBuilder.of("registrationName", "onDragEnd"))
34-
.put(TrueSheetEvent.CONTAINER_SIZE_CHANGE, MapBuilder.of("registrationName", "onContainerSizeChange"))
35-
.build()
25+
override fun getExportedCustomDirectEventTypeConstants(): MutableMap<String, Any> =
26+
mutableMapOf(
27+
TrueSheetEvent.MOUNT to MapBuilder.of("registrationName", "onMount"),
28+
TrueSheetEvent.PRESENT to MapBuilder.of("registrationName", "onPresent"),
29+
TrueSheetEvent.DISMISS to MapBuilder.of("registrationName", "onDismiss"),
30+
TrueSheetEvent.SIZE_CHANGE to MapBuilder.of("registrationName", "onSizeChange"),
31+
TrueSheetEvent.DRAG_BEGIN to MapBuilder.of("registrationName", "onDragBegin"),
32+
TrueSheetEvent.DRAG_CHANGE to MapBuilder.of("registrationName", "onDragChange"),
33+
TrueSheetEvent.DRAG_END to MapBuilder.of("registrationName", "onDragEnd"),
34+
TrueSheetEvent.CONTAINER_SIZE_CHANGE to MapBuilder.of("registrationName", "onContainerSizeChange")
35+
)
3636

3737
@ReactProp(name = "edgeToEdge")
3838
fun setEdgeToEdge(view: TrueSheetView, edgeToEdge: Boolean) {

example/android/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3232
# your application. You should enable this flag either if you want
3333
# to write custom TurboModules/Fabric components OR use libraries that
3434
# are providing them.
35-
newArchEnabled=false
35+
newArchEnabled=true
3636

3737
# Use this property to enable or disable the Hermes JS engine.
3838
# If set to false, you will be using JSC instead.

ios/TrueSheetView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
9999

100100
// Touch handler for Old Arch
101101
touchHandler.detach(from: subview)
102-
102+
103103
// Touch handler that works in New Arch
104104
surfaceTouchHandler.detach(from: subview)
105105

0 commit comments

Comments
 (0)