@swmansion/react-native-bottom-sheet 0.7.0-next.4 → 0.7.0-next.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.
- package/android/src/main/java/com/swmansion/reactnativebottomsheet/BottomSheetView.kt +11 -0
- package/ios/BottomSheetComponentView.mm +6 -0
- package/ios/BottomSheetContentView.h +1 -0
- package/ios/BottomSheetContentView.mm +5 -0
- package/ios/RNSBottomSheetHostingView.swift +16 -0
- package/package.json +1 -1
|
@@ -408,8 +408,19 @@ class BottomSheetView(context: Context) : ReactViewGroup(context) {
|
|
|
408
408
|
|
|
409
409
|
fun destroy() {
|
|
410
410
|
activeAnimation?.cancel()
|
|
411
|
+
activeAnimation = null
|
|
411
412
|
stopChoreographer()
|
|
412
413
|
velocityTracker?.recycle()
|
|
413
414
|
velocityTracker = null
|
|
415
|
+
detentSpecs = emptyList()
|
|
416
|
+
targetIndex = 0
|
|
417
|
+
pendingIndex = null
|
|
418
|
+
hasLaidOut = false
|
|
419
|
+
isPanning = false
|
|
420
|
+
initialTouchY = 0f
|
|
421
|
+
lastTouchY = 0f
|
|
422
|
+
activePointerId = MotionEvent.INVALID_POINTER_ID
|
|
423
|
+
sheetContainer.translationY = 0f
|
|
424
|
+
sheetContainer.removeAllViews()
|
|
414
425
|
}
|
|
415
426
|
}
|
|
@@ -60,6 +60,11 @@
|
|
|
60
60
|
[_impl unmountChildComponentView:childView];
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
- (void)resetSheetState
|
|
64
|
+
{
|
|
65
|
+
[_impl resetSheetState];
|
|
66
|
+
}
|
|
67
|
+
|
|
63
68
|
- (void)bottomSheetHostingView:(RNSBottomSheetHostingView *)view didChangeIndex:(NSInteger)index
|
|
64
69
|
{
|
|
65
70
|
[self.delegate bottomSheetView:self didChangeIndex:index];
|
|
@@ -132,6 +132,22 @@ public final class RNSBottomSheetHostingView: UIView {
|
|
|
132
132
|
childView.removeFromSuperview()
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
public func resetSheetState() {
|
|
136
|
+
activeAnimator?.stopAnimation(true)
|
|
137
|
+
activeAnimator = nil
|
|
138
|
+
stopDisplayLink()
|
|
139
|
+
detentSpecs = []
|
|
140
|
+
targetIndex = 0
|
|
141
|
+
pendingIndex = nil
|
|
142
|
+
hasLaidOut = false
|
|
143
|
+
isPanning = false
|
|
144
|
+
setContentInteractionEnabled(true)
|
|
145
|
+
sheetContainer.transform = .identity
|
|
146
|
+
for subview in sheetContainer.subviews {
|
|
147
|
+
subview.removeFromSuperview()
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
135
151
|
private func detent(at index: Int) -> DetentSpec {
|
|
136
152
|
guard detentSpecs.indices.contains(index) else {
|
|
137
153
|
return DetentSpec(height: 0, programmatic: false)
|
package/package.json
CHANGED