react-native-morph-card 0.2.1 → 0.2.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.
@@ -442,22 +442,25 @@ static CGRect imageFrameForScaleMode(UIViewContentMode mode,
442
442
 
443
443
  UIView *content = wrapper.subviews.firstObject;
444
444
 
445
+ UICubicTimingParameters *timing = [[UICubicTimingParameters alloc]
446
+ initWithControlPoint1:CGPointMake(0.25, 1.0)
447
+ controlPoint2:CGPointMake(0.5, 1.0)];
445
448
  UIViewPropertyAnimator *animator = [[UIViewPropertyAnimator alloc]
446
449
  initWithDuration:dur
447
- dampingRatio:0.85
448
- animations:^{
449
- wrapper.frame = self->_cardFrame;
450
- wrapper.layer.cornerRadius = self->_cardCornerRadius;
451
- if (content) {
452
- content.frame = (CGRect){CGPointZero, content.frame.size};
453
- }
454
- }];
450
+ timingParameters:timing];
451
+ [animator addAnimations:^{
452
+ wrapper.frame = self->_cardFrame;
453
+ wrapper.layer.cornerRadius = self->_cardCornerRadius;
454
+ if (content) {
455
+ content.frame = (CGRect){CGPointZero, content.frame.size};
456
+ }
457
+ }];
455
458
 
456
- // Fade out target screen concurrently at 15% (mirrors expand's fade-in)
459
+ // Fade out target screen concurrently at 15%, over 65% of duration
457
460
  dispatch_after(
458
461
  dispatch_time(DISPATCH_TIME_NOW, (int64_t)(dur * 0.15 * NSEC_PER_SEC)),
459
462
  dispatch_get_main_queue(), ^{
460
- [UIView animateWithDuration:dur * 0.5
463
+ [UIView animateWithDuration:dur * 0.65
461
464
  animations:^{
462
465
  if (targetScreen) { targetScreen.alpha = 0; }
463
466
  }
@@ -521,20 +524,23 @@ static CGRect imageFrameForScaleMode(UIViewContentMode mode,
521
524
  sourceScreen.alpha = 1;
522
525
  }
523
526
 
527
+ UICubicTimingParameters *timing2 = [[UICubicTimingParameters alloc]
528
+ initWithControlPoint1:CGPointMake(0.25, 1.0)
529
+ controlPoint2:CGPointMake(0.5, 1.0)];
524
530
  UIViewPropertyAnimator *animator = [[UIViewPropertyAnimator alloc]
525
531
  initWithDuration:dur
526
- dampingRatio:0.85
527
- animations:^{
528
- container.frame = self->_cardFrame;
529
- container.layer.cornerRadius = self->_cardCornerRadius;
530
- snapshot.frame = (CGRect){CGPointZero, self->_cardFrame.size};
531
- }];
532
+ timingParameters:timing2];
533
+ [animator addAnimations:^{
534
+ container.frame = self->_cardFrame;
535
+ container.layer.cornerRadius = self->_cardCornerRadius;
536
+ snapshot.frame = (CGRect){CGPointZero, self->_cardFrame.size};
537
+ }];
532
538
 
533
- // Fade out target screen concurrently at 15% (mirrors expand's fade-in)
539
+ // Fade out target screen concurrently at 15%, over 65% of duration
534
540
  dispatch_after(
535
541
  dispatch_time(DISPATCH_TIME_NOW, (int64_t)(dur * 0.15 * NSEC_PER_SEC)),
536
542
  dispatch_get_main_queue(), ^{
537
- [UIView animateWithDuration:dur * 0.5
543
+ [UIView animateWithDuration:dur * 0.65
538
544
  animations:^{
539
545
  if (targetScreen) { targetScreen.alpha = 0; }
540
546
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-morph-card",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Native card-to-modal morph transition for React Native. iOS App Store-style expand animation.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",