mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Improve animations
This commit is contained in:
@@ -658,9 +658,10 @@ typedef enum
|
||||
return;
|
||||
|
||||
[_activityDisposable dispose];
|
||||
[self stopRecording:^{
|
||||
[self stopRecording:^() {
|
||||
TGDispatchOnMainThread(^{
|
||||
[self dismiss:false];
|
||||
//[self dismiss:false];
|
||||
[self description];
|
||||
});
|
||||
}];
|
||||
}
|
||||
@@ -955,7 +956,20 @@ typedef enum
|
||||
|
||||
- (void)stopRecording:(void (^)())completed
|
||||
{
|
||||
[_capturePipeline stopRecording:completed];
|
||||
__weak TGVideoMessageCaptureController *weakSelf = self;
|
||||
[_capturePipeline stopRecording:^(bool success) {
|
||||
TGDispatchOnMainThread(^{
|
||||
__strong TGVideoMessageCaptureController *strongSelf = weakSelf;
|
||||
if (strongSelf == nil) {
|
||||
return;
|
||||
}
|
||||
if (!success) {
|
||||
if (!strongSelf->_dismissed && strongSelf.finishedWithVideo != nil) {
|
||||
strongSelf.finishedWithVideo(nil, nil, 0, 0.0, CGSizeZero, nil, nil, false, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
}];
|
||||
[_buttonHandler ignoreEventsFor:1.0f andDisable:true];
|
||||
[_capturePipeline stopRunning];
|
||||
}
|
||||
@@ -1015,10 +1029,14 @@ typedef enum
|
||||
}
|
||||
}
|
||||
|
||||
if (!_dismissed && self.finishedWithVideo != nil)
|
||||
if (!_dismissed) {
|
||||
self.finishedWithVideo(url, image, fileSize, duration, dimensions, liveUploadData, adjustments, isSilent, scheduleTimestamp);
|
||||
else
|
||||
} else {
|
||||
[[NSFileManager defaultManager] removeItemAtURL:url error:NULL];
|
||||
if (self.finishedWithVideo != nil) {
|
||||
self.finishedWithVideo(nil, nil, 0, 0.0, CGSizeZero, nil, nil, false, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImageOrientation)orientationForThumbnailWithTransform:(CGAffineTransform)transform mirrored:(bool)mirrored
|
||||
@@ -1501,6 +1519,16 @@ static UIImage *startImage = nil;
|
||||
return CGSizeMake(240.0f, 240.0f);
|
||||
}
|
||||
|
||||
- (UIView *)extractVideoContent {
|
||||
UIView *result = [_circleView snapshotViewAfterScreenUpdates:false];
|
||||
result.frame = [_circleView convertRect:_circleView.bounds toView:nil];
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)hideVideoContent {
|
||||
_circleWrapperView.alpha = 0.02f;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user