@sdcx/bottom-sheet 0.13.0 → 0.14.0
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.
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -296,6 +296,11 @@
|
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
+
if (self.state == RNBottomSheetStateSettling) {
|
|
300
|
+
[self.layer removeAllAnimations];
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
|
|
299
304
|
if (CGRectEqualToRect(self.contentView.frame, CGRectZero)) {
|
|
300
305
|
[self setStateInternal:state];
|
|
301
306
|
return;
|
|
@@ -320,7 +325,7 @@
|
|
|
320
325
|
[self startWatchBottomSheetTransition];
|
|
321
326
|
[self.layer removeAllAnimations];
|
|
322
327
|
// CGFloat duration = fmin(fabs(self.contentView.frame.origin.y - top) / (self.maxY - self.minY) * 0.3, 0.3);
|
|
323
|
-
[UIView animateWithDuration:fling ? 0.5 : 0.25 delay:0 usingSpringWithDamping:1 initialSpringVelocity:1 options:
|
|
328
|
+
[UIView animateWithDuration:fling ? 0.5 : 0.25 delay:0 usingSpringWithDamping:1 initialSpringVelocity:1 options:UIViewAnimationOptionTransitionNone animations:^{
|
|
324
329
|
self.contentView.frame = CGRectOffset(self.contentView.frame, 0, top - self.contentView.frame.origin.y);
|
|
325
330
|
} completion:^(BOOL finished) {
|
|
326
331
|
self.target.pagingEnabled = NO;
|
|
@@ -335,6 +340,18 @@
|
|
|
335
340
|
}
|
|
336
341
|
_state = state;
|
|
337
342
|
|
|
343
|
+
if (state == RNBottomSheetStateExpanded) {
|
|
344
|
+
[self dispatchOnSlide:self.minY];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (state == RNBottomSheetStateHidden) {
|
|
348
|
+
[self dispatchOnSlide:self.frame.size.height];
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if (state == RNBottomSheetStateCollapsed) {
|
|
352
|
+
[self dispatchOnSlide:self.maxY];
|
|
353
|
+
}
|
|
354
|
+
|
|
338
355
|
if (state == RNBottomSheetStateCollapsed || state == RNBottomSheetStateExpanded || state == RNBottomSheetStateHidden) {
|
|
339
356
|
[self.eventDispatcher sendEvent:[[RNBottomSheetStateChangedEvent alloc] initWithViewTag:self.reactTag state:state]];
|
|
340
357
|
}
|
|
@@ -356,11 +373,6 @@
|
|
|
356
373
|
}
|
|
357
374
|
|
|
358
375
|
- (void)stopWatchBottomSheetTransition {
|
|
359
|
-
if (self.state == RNBottomSheetStateCollapsed) {
|
|
360
|
-
[self dispatchOnSlide:self.maxY];
|
|
361
|
-
} else if (self.state == RNBottomSheetStateExpanded) {
|
|
362
|
-
[self dispatchOnSlide:self.minY];
|
|
363
|
-
}
|
|
364
376
|
if(_displayLink){
|
|
365
377
|
[_displayLink invalidate];
|
|
366
378
|
_displayLink = nil;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdcx/bottom-sheet",
|
|
3
3
|
"description": "A react-native BottomSheet component.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.0",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
7
7
|
"react-native": "src/index",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"lib",
|
|
12
12
|
"android",
|
|
13
13
|
"ios",
|
|
14
|
+
"docs",
|
|
14
15
|
"RNBottomSheet.podspec",
|
|
15
16
|
"!android/build",
|
|
16
17
|
"!ios/build",
|