expo-simple-gallery 0.3.1 → 0.3.2
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.
|
@@ -4,10 +4,8 @@ import UIKit
|
|
|
4
4
|
|
|
5
5
|
final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
|
|
6
6
|
var galleryView: GalleryGridView?
|
|
7
|
-
private var
|
|
8
|
-
|
|
9
|
-
"sectionHeader": [:],
|
|
10
|
-
]
|
|
7
|
+
private var thumbnailOverlays: [Int: ReactMountingComponent] = [:]
|
|
8
|
+
private var sectionHeaderOverlays: [Int: ReactMountingComponent] = [:]
|
|
11
9
|
|
|
12
10
|
let onOverlayPreloadRequested = EventDispatcher()
|
|
13
11
|
let onThumbnailPress = EventDispatcher()
|
|
@@ -53,7 +51,7 @@ final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
|
|
|
53
51
|
return
|
|
54
52
|
}
|
|
55
53
|
let component = ReactMountingComponent(view: childComponentView, index: index)
|
|
56
|
-
self.
|
|
54
|
+
self.thumbnailOverlays[id] = component
|
|
57
55
|
|
|
58
56
|
if let cell = self.galleryView?.cell(withIndex: id) {
|
|
59
57
|
self.mount(to: cell, overlay: component)
|
|
@@ -62,7 +60,7 @@ final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
|
|
|
62
60
|
guard let sectionId = Int(label.replacingOccurrences(of: "SectionHeaderOverlay_", with: ""))
|
|
63
61
|
else { return }
|
|
64
62
|
let component = ReactMountingComponent(view: childComponentView, index: index)
|
|
65
|
-
self.
|
|
63
|
+
self.sectionHeaderOverlays[sectionId] = component
|
|
66
64
|
|
|
67
65
|
if let galleryView = self.galleryView, galleryView.isGroupedLayout {
|
|
68
66
|
let indexPath = IndexPath(item: 0, section: sectionId)
|
|
@@ -86,11 +84,11 @@ final class ExpoSimpleGalleryView: ExpoView, ContextMenuActionsDelegate {
|
|
|
86
84
|
guard let id = Int(label.replacingOccurrences(of: "GalleryViewOverlay_", with: "")) else {
|
|
87
85
|
return
|
|
88
86
|
}
|
|
89
|
-
|
|
87
|
+
thumbnailOverlays[id] = nil
|
|
90
88
|
} else if label.starts(with: "SectionHeaderOverlay_") {
|
|
91
89
|
guard let sectionId = Int(label.replacingOccurrences(of: "SectionHeaderOverlay_", with: ""))
|
|
92
90
|
else { return }
|
|
93
|
-
|
|
91
|
+
sectionHeaderOverlays[sectionId] = nil
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
94
|
|
|
@@ -146,9 +144,9 @@ extension ExpoSimpleGalleryView: OverlayMountingDelegate {
|
|
|
146
144
|
guard let containerId = container.containerIdentifier else { return }
|
|
147
145
|
var component: ReactMountingComponent?
|
|
148
146
|
if container is GalleryCell {
|
|
149
|
-
component =
|
|
147
|
+
component = thumbnailOverlays[containerId]
|
|
150
148
|
} else if container is GallerySectionHeaderView {
|
|
151
|
-
component =
|
|
149
|
+
component = sectionHeaderOverlays[containerId]
|
|
152
150
|
}
|
|
153
151
|
|
|
154
152
|
if let component = component {
|