expo-simple-gallery 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,6 +14,7 @@ final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
|
|
|
14
14
|
let onSectionHeadersVisible = EventDispatcher()
|
|
15
15
|
let onPreviewMenuOptionSelected = EventDispatcher()
|
|
16
16
|
|
|
17
|
+
@MainActor
|
|
17
18
|
required init(appContext: AppContext? = nil) {
|
|
18
19
|
super.init(appContext: appContext)
|
|
19
20
|
galleryView = GalleryGridView(
|
|
@@ -29,18 +30,24 @@ final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
|
|
|
29
30
|
galleryView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
@MainActor
|
|
32
34
|
func callSuperMountChildComponentView(_ childComponentView: UIView, index: Int) {
|
|
33
35
|
super.mountChildComponentView(childComponentView, index: index)
|
|
34
36
|
}
|
|
35
37
|
|
|
38
|
+
@MainActor
|
|
36
39
|
func callSuperUnmountChildComponentView(_ childComponentView: UIView, index: Int) {
|
|
37
40
|
super.unmountChildComponentView(childComponentView, index: index)
|
|
38
41
|
}
|
|
39
42
|
|
|
43
|
+
@MainActor
|
|
40
44
|
override func mountChildComponentView(_ childComponentView: UIView, index: Int) {
|
|
41
45
|
// DispatchQueue.main.async { [weak self] in
|
|
42
46
|
// guard let self else { return }
|
|
43
|
-
|
|
47
|
+
if childComponentView.superview != nil {
|
|
48
|
+
callSuperMountChildComponentView(childComponentView, index: index)
|
|
49
|
+
return
|
|
50
|
+
}
|
|
44
51
|
guard let label = childComponentView.accessibilityLabel else {
|
|
45
52
|
self.callSuperMountChildComponentView(childComponentView, index: index)
|
|
46
53
|
return
|
|
@@ -75,6 +82,7 @@ final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
|
|
|
75
82
|
// }
|
|
76
83
|
}
|
|
77
84
|
|
|
85
|
+
@MainActor
|
|
78
86
|
override func unmountChildComponentView(_ childComponentView: UIView, index: Int) {
|
|
79
87
|
let component = ReactMountingComponent(view: childComponentView, index: index)
|
|
80
88
|
self.unmount(overlay: component)
|
|
@@ -92,6 +100,7 @@ final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
|
|
|
92
100
|
}
|
|
93
101
|
}
|
|
94
102
|
|
|
103
|
+
@MainActor
|
|
95
104
|
deinit {
|
|
96
105
|
// Clean up all visible containers
|
|
97
106
|
galleryView?.visibleCells().forEach { cell in
|
|
@@ -112,6 +121,7 @@ final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
|
|
|
112
121
|
}
|
|
113
122
|
}
|
|
114
123
|
|
|
124
|
+
@MainActor
|
|
115
125
|
extension ExpoSimpleGalleryView: GestureEventDelegate {
|
|
116
126
|
func galleryGrid(_ gallery: GalleryGridView, didPressCell cell: PressedCell) {
|
|
117
127
|
onThumbnailPress(cell.dict())
|
|
@@ -126,6 +136,7 @@ extension ExpoSimpleGalleryView: GestureEventDelegate {
|
|
|
126
136
|
}
|
|
127
137
|
}
|
|
128
138
|
|
|
139
|
+
@MainActor
|
|
129
140
|
extension ExpoSimpleGalleryView: OverlayPreloadingDelegate {
|
|
130
141
|
func galleryGrid(_ gallery: GalleryGridView, prefetchOverlaysFor range: (Int, Int)) {
|
|
131
142
|
onOverlayPreloadRequested(["range": [range.0, range.1]])
|
|
@@ -139,6 +150,7 @@ extension ExpoSimpleGalleryView: OverlayPreloadingDelegate {
|
|
|
139
150
|
}
|
|
140
151
|
|
|
141
152
|
// MARK: - Overlay Mounting Implementation
|
|
153
|
+
@MainActor
|
|
142
154
|
extension ExpoSimpleGalleryView: OverlayMountingDelegate {
|
|
143
155
|
func mount<T: OverlayContainer>(to container: T) {
|
|
144
156
|
guard let containerId = container.containerIdentifier else { return }
|