react-native-navigation 8.6.2-snapshot.2152 → 8.6.2-snapshot.2156
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/ios/ScreenAnimationController.mm +37 -13
- package/package.json +1 -1
|
@@ -75,14 +75,29 @@
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
- (void)prepareTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
UIViewController *fromViewController =
|
|
79
|
+
[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
|
|
80
|
+
UIViewController *toViewController =
|
|
81
|
+
[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
|
|
82
|
+
|
|
83
|
+
UIView *fromView = [transitionContext viewForKey:UITransitionContextFromViewKey];
|
|
84
|
+
UIView *toView = [transitionContext viewForKey:UITransitionContextToViewKey];
|
|
85
|
+
|
|
86
|
+
BOOL isDismiss = (toView == nil);
|
|
87
|
+
|
|
88
|
+
if (isDismiss) {
|
|
89
|
+
if (fromView) {
|
|
90
|
+
[transitionContext.containerView addSubview:fromView];
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
toViewController.view.alpha = 0;
|
|
94
|
+
if (fromView) {
|
|
95
|
+
[transitionContext.containerView addSubview:fromView];
|
|
96
|
+
}
|
|
97
|
+
[transitionContext.containerView addSubview:toViewController.view];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
[toViewController prepareForTransition];
|
|
86
101
|
}
|
|
87
102
|
|
|
88
103
|
- (NSArray *)createTransitionsFromVC:(UIViewController *)fromVC
|
|
@@ -121,13 +136,18 @@
|
|
|
121
136
|
|
|
122
137
|
- (void)animateTransitions:(NSArray<id<DisplayLinkAnimatorDelegate>> *)animators
|
|
123
138
|
andTransitioningContext:(id<UIViewControllerContextTransitioning>)transitionContext {
|
|
139
|
+
UIView *toView = [transitionContext viewForKey:UITransitionContextToViewKey];
|
|
140
|
+
BOOL isDismiss = (toView == nil);
|
|
141
|
+
|
|
124
142
|
DisplayLinkAnimator *displayLinkAnimator = [[DisplayLinkAnimator alloc]
|
|
125
143
|
initWithDisplayLinkAnimators:animators
|
|
126
144
|
duration:[self transitionDuration:transitionContext]];
|
|
127
145
|
|
|
128
146
|
[displayLinkAnimator setOnStart:^{
|
|
129
|
-
[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]
|
|
130
|
-
|
|
147
|
+
UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
|
|
148
|
+
if (!isDismiss) {
|
|
149
|
+
toVC.view.alpha = 1.f;
|
|
150
|
+
}
|
|
131
151
|
}];
|
|
132
152
|
|
|
133
153
|
[displayLinkAnimator setCompletion:^{
|
|
@@ -170,9 +190,13 @@
|
|
|
170
190
|
UIView *toView = [_transitionContext viewForKey:UITransitionContextToViewKey];
|
|
171
191
|
UIView *fromView = [_transitionContext viewForKey:UITransitionContextFromViewKey];
|
|
172
192
|
[_sharedElementAnimator animationEnded];
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
193
|
+
if (toView) {
|
|
194
|
+
toView.layer.transform = CATransform3DIdentity;
|
|
195
|
+
toView.alpha = 1.f;
|
|
196
|
+
}
|
|
197
|
+
if (fromView) {
|
|
198
|
+
fromView.layer.transform = CATransform3DIdentity;
|
|
199
|
+
}
|
|
176
200
|
_transitionContext = nil;
|
|
177
201
|
_sharedElementAnimator = nil;
|
|
178
202
|
}
|
package/package.json
CHANGED