mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Video avatar fixes
This commit is contained in:
@@ -147,7 +147,8 @@ const CGFloat TGPhotoEditorToolbarSize = 49.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
_transitionView = [referenceView snapshotViewAfterScreenUpdates:false];
|
||||
if (![referenceView isKindOfClass:[TGPhotoEditorPreviewView class]])
|
||||
_transitionView = [referenceView snapshotViewAfterScreenUpdates:false];
|
||||
if (_transitionView == nil) {
|
||||
_transitionView = referenceView;
|
||||
}
|
||||
@@ -168,27 +169,45 @@ const CGFloat TGPhotoEditorToolbarSize = 49.0f;
|
||||
|
||||
_transitionInProgress = true;
|
||||
|
||||
POPSpringAnimation *animation = [TGPhotoEditorAnimation prepareTransitionAnimationForPropertyNamed:kPOPViewFrame];
|
||||
if (self.transitionSpeed > FLT_EPSILON)
|
||||
animation.springSpeed = self.transitionSpeed;
|
||||
animation.fromValue = [NSValue valueWithCGRect:_transitionView.frame];
|
||||
animation.toValue = [NSValue valueWithCGRect:_transitionTargetFrame];
|
||||
animation.completionBlock = ^(__unused POPAnimation *animation, __unused BOOL finished)
|
||||
[UIView animateWithDuration:0.3f delay:0.0f options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionLayoutSubviews animations:^
|
||||
{
|
||||
_transitionView.frame = _transitionTargetFrame;
|
||||
} completion:^(BOOL finished) {
|
||||
_transitionInProgress = false;
|
||||
|
||||
UIView *transitionView = _transitionView;
|
||||
_transitionView = nil;
|
||||
|
||||
if (self.finishedTransitionIn != nil)
|
||||
{
|
||||
self.finishedTransitionIn();
|
||||
self.finishedTransitionIn = nil;
|
||||
}
|
||||
|
||||
[self _finishedTransitionInWithView:transitionView];
|
||||
};
|
||||
[_transitionView pop_addAnimation:animation forKey:@"frame"];
|
||||
|
||||
UIView *transitionView = _transitionView;
|
||||
_transitionView = nil;
|
||||
|
||||
if (self.finishedTransitionIn != nil)
|
||||
{
|
||||
self.finishedTransitionIn();
|
||||
self.finishedTransitionIn = nil;
|
||||
}
|
||||
|
||||
[self _finishedTransitionInWithView:transitionView];
|
||||
}];
|
||||
|
||||
// POPSpringAnimation *animation = [TGPhotoEditorAnimation prepareTransitionAnimationForPropertyNamed:kPOPViewFrame];
|
||||
// if (self.transitionSpeed > FLT_EPSILON)
|
||||
// animation.springSpeed = self.transitionSpeed;
|
||||
// animation.fromValue = [NSValue valueWithCGRect:_transitionView.frame];
|
||||
// animation.toValue = [NSValue valueWithCGRect:_transitionTargetFrame];
|
||||
// animation.completionBlock = ^(__unused POPAnimation *animation, __unused BOOL finished)
|
||||
// {
|
||||
// _transitionInProgress = false;
|
||||
//
|
||||
// UIView *transitionView = _transitionView;
|
||||
// _transitionView = nil;
|
||||
//
|
||||
// if (self.finishedTransitionIn != nil)
|
||||
// {
|
||||
// self.finishedTransitionIn();
|
||||
// self.finishedTransitionIn = nil;
|
||||
// }
|
||||
//
|
||||
// [self _finishedTransitionInWithView:transitionView];
|
||||
// };
|
||||
// [_transitionView pop_addAnimation:animation forKey:@"frame"];
|
||||
}
|
||||
|
||||
- (void)prepareForCustomTransitionOut
|
||||
|
||||
Reference in New Issue
Block a user