From eb9b121961885fb8e787cc2884de27a48335ae1b Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Tue, 29 May 2018 20:20:58 +0300 Subject: [PATCH 1/2] no message --- LegacyComponents.xcodeproj/project.pbxproj | 8 + .../xcschemes/LegacyComponents.xcscheme | 80 ++++++++++ .../xcschemes/xcschememanagement.plist | 22 +++ LegacyComponents/LegacyComponents.h | 1 + LegacyComponents/TGCameraCapturedPhoto.m | 2 +- LegacyComponents/TGCameraController.h | 2 +- LegacyComponents/TGCameraController.m | 2 +- LegacyComponents/TGImageView.m | 1 + .../TGMediaPickerGalleryVideoItemView.m | 76 +++++---- LegacyComponents/TGPhotoVideoEditor.h | 7 + LegacyComponents/TGPhotoVideoEditor.m | 148 ++++++++++++++++++ 11 files changed, 312 insertions(+), 37 deletions(-) create mode 100644 LegacyComponents.xcodeproj/xcuserdata/ilya.xcuserdatad/xcschemes/LegacyComponents.xcscheme create mode 100644 LegacyComponents.xcodeproj/xcuserdata/ilya.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 LegacyComponents/TGPhotoVideoEditor.h create mode 100644 LegacyComponents/TGPhotoVideoEditor.m diff --git a/LegacyComponents.xcodeproj/project.pbxproj b/LegacyComponents.xcodeproj/project.pbxproj index 7292fad818..cf434889bd 100644 --- a/LegacyComponents.xcodeproj/project.pbxproj +++ b/LegacyComponents.xcodeproj/project.pbxproj @@ -48,6 +48,8 @@ 09AB58151F6C401B0087449F /* TGLocationWavesView.m in Sources */ = {isa = PBXBuildFile; fileRef = 09AB58131F6C401B0087449F /* TGLocationWavesView.m */; }; 09B51E001F6AF476000EE471 /* TGLocationMapViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 09B51DFE1F6AF476000EE471 /* TGLocationMapViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 09B51E011F6AF476000EE471 /* TGLocationMapViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 09B51DFF1F6AF476000EE471 /* TGLocationMapViewController.m */; }; + 09BD14EB20BD928100D95932 /* TGPhotoVideoEditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 09BD14E920BD928100D95932 /* TGPhotoVideoEditor.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 09BD14EC20BD928100D95932 /* TGPhotoVideoEditor.m in Sources */ = {isa = PBXBuildFile; fileRef = 09BD14EA20BD928100D95932 /* TGPhotoVideoEditor.m */; }; 09C0BEE02069FDD400380399 /* TGPassportAttachMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 09C0BEDE2069FDD300380399 /* TGPassportAttachMenu.h */; settings = {ATTRIBUTES = (Public, ); }; }; 09C0BEE12069FDD400380399 /* TGPassportAttachMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 09C0BEDF2069FDD300380399 /* TGPassportAttachMenu.m */; }; 09E97B571F97C11700526020 /* TGTooltipView.h in Headers */ = {isa = PBXBuildFile; fileRef = 09E97B551F97C11600526020 /* TGTooltipView.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1232,6 +1234,8 @@ 09AB58131F6C401B0087449F /* TGLocationWavesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TGLocationWavesView.m; sourceTree = ""; }; 09B51DFE1F6AF476000EE471 /* TGLocationMapViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TGLocationMapViewController.h; sourceTree = ""; }; 09B51DFF1F6AF476000EE471 /* TGLocationMapViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TGLocationMapViewController.m; sourceTree = ""; }; + 09BD14E920BD928100D95932 /* TGPhotoVideoEditor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TGPhotoVideoEditor.h; sourceTree = ""; }; + 09BD14EA20BD928100D95932 /* TGPhotoVideoEditor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TGPhotoVideoEditor.m; sourceTree = ""; }; 09C0BEDE2069FDD300380399 /* TGPassportAttachMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TGPassportAttachMenu.h; sourceTree = ""; }; 09C0BEDF2069FDD300380399 /* TGPassportAttachMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TGPassportAttachMenu.m; sourceTree = ""; }; 09E97B551F97C11600526020 /* TGTooltipView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TGTooltipView.h; sourceTree = ""; }; @@ -3217,6 +3221,8 @@ D07BC9B91F2A705D00ED97AA /* TGPhotoFilterCell.m */, D07BC9BC1F2A722400ED97AA /* TGHistogramView.h */, D07BC9BD1F2A722400ED97AA /* TGHistogramView.m */, + 09BD14E920BD928100D95932 /* TGPhotoVideoEditor.h */, + 09BD14EA20BD928100D95932 /* TGPhotoVideoEditor.m */, ); name = "Photo Editor"; sourceTree = ""; @@ -3952,6 +3958,7 @@ D01778191F1F961D0044446D /* TGMessageEntityHashtag.h in Headers */, D07BCA341F2A9B0400ED97AA /* TGModernGalleryEditableItemView.h in Headers */, D0177A911F221BB10044446D /* TGModernGalleryTransitionView.h in Headers */, + 09BD14EB20BD928100D95932 /* TGPhotoVideoEditor.h in Headers */, 0916FEAC20A1EBFA0084A755 /* TGPassportMRZ.h in Headers */, D01778E51F20CAE60044446D /* TGNavigationController.h in Headers */, D01777721F1F92420044446D /* TGPhoneUtils.h in Headers */, @@ -5014,6 +5021,7 @@ D07BC77B1F2A2B3700ED97AA /* TGPhotoEditorInterfaceAssets.m in Sources */, D07BC9B71F2A700900ED97AA /* TGPhotoMaskPosition.m in Sources */, D07BC91A1F2A380D00ED97AA /* TGPaintRadialBrush.m in Sources */, + 09BD14EC20BD928100D95932 /* TGPhotoVideoEditor.m in Sources */, D07BC7891F2A2B3700ED97AA /* TGPhotoEditorTintSwatchView.m in Sources */, D07BC8C01F2A37EC00ED97AA /* TGPhotoPaintActionsView.m in Sources */, D07BCB161F2B646A00ED97AA /* TGPasswordEntryView.m in Sources */, diff --git a/LegacyComponents.xcodeproj/xcuserdata/ilya.xcuserdatad/xcschemes/LegacyComponents.xcscheme b/LegacyComponents.xcodeproj/xcuserdata/ilya.xcuserdatad/xcschemes/LegacyComponents.xcscheme new file mode 100644 index 0000000000..dd9e36bcb0 --- /dev/null +++ b/LegacyComponents.xcodeproj/xcuserdata/ilya.xcuserdatad/xcschemes/LegacyComponents.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LegacyComponents.xcodeproj/xcuserdata/ilya.xcuserdatad/xcschemes/xcschememanagement.plist b/LegacyComponents.xcodeproj/xcuserdata/ilya.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000000..a7666f2142 --- /dev/null +++ b/LegacyComponents.xcodeproj/xcuserdata/ilya.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + LegacyComponents.xcscheme + + orderHint + 12 + + + SuppressBuildableAutocreation + + D01777261F1F8F100044446D + + primary + + + + + diff --git a/LegacyComponents/LegacyComponents.h b/LegacyComponents/LegacyComponents.h index 4b4d9175a4..3221de0911 100644 --- a/LegacyComponents/LegacyComponents.h +++ b/LegacyComponents/LegacyComponents.h @@ -270,6 +270,7 @@ FOUNDATION_EXPORT const unsigned char LegacyComponentsVersionString[]; #import #import #import +#import #import #import diff --git a/LegacyComponents/TGCameraCapturedPhoto.m b/LegacyComponents/TGCameraCapturedPhoto.m index 344ddf2992..07a827cd50 100644 --- a/LegacyComponents/TGCameraCapturedPhoto.m +++ b/LegacyComponents/TGCameraCapturedPhoto.m @@ -22,7 +22,7 @@ if (self != nil) { _identifier = [NSString stringWithFormat:@"%ld", lrand48()]; - _dimensions = image.size; + _dimensions = CGSizeMake(image.size.width * image.scale, image.size.height * image.scale); _metadata = metadata; _thumbnail = [[SVariable alloc] init]; diff --git a/LegacyComponents/TGCameraController.h b/LegacyComponents/TGCameraController.h index b5031fe85b..036e147e65 100644 --- a/LegacyComponents/TGCameraController.h +++ b/LegacyComponents/TGCameraController.h @@ -47,7 +47,7 @@ typedef enum { - (instancetype)initWithContext:(id)context saveEditedPhotos:(bool)saveEditedPhotos saveCapturedMedia:(bool)saveCapturedMedia intent:(TGCameraControllerIntent)intent; - (instancetype)initWithContext:(id)context saveEditedPhotos:(bool)saveEditedPhotos saveCapturedMedia:(bool)saveCapturedMedia camera:(PGCamera *)camera previewView:(TGCameraPreviewView *)previewView intent:(TGCameraControllerIntent)intent; -+ (NSArray *)resultSignalsForSelectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext currentItem:(id)currentItem storeAssets:(bool)storeAssets saveEditedPhotos:(bool)saveEditedPhotos descriptionGenerator:(id (^)(id, NSString *, NSArray *, NSString *))descriptionGenerator; ++ (NSArray *)resultSignalsForSelectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext currentItem:(id)currentItem storeAssets:(bool)storeAssets saveEditedPhotos:(bool)saveEditedPhotos descriptionGenerator:(id (^)(id, NSString *, NSArray *, NSString *))descriptionGenerator; - (void)beginTransitionInFromRect:(CGRect)rect; - (void)_dismissTransitionForResultController:(TGOverlayController *)resultController; diff --git a/LegacyComponents/TGCameraController.m b/LegacyComponents/TGCameraController.m index dc2d586a82..708ba11645 100644 --- a/LegacyComponents/TGCameraController.m +++ b/LegacyComponents/TGCameraController.m @@ -2190,7 +2190,7 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus + (NSArray *)resultSignalsForSelectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext currentItem:(id)currentItem storeAssets:(bool)storeAssets saveEditedPhotos:(bool)saveEditedPhotos descriptionGenerator:(id (^)(id, NSString *, NSArray *, NSString *))descriptionGenerator { NSMutableArray *signals = [[NSMutableArray alloc] init]; - NSMutableArray *selectedItems = [selectionContext.selectedItems mutableCopy]; + NSMutableArray *selectedItems = selectionContext.selectedItems != nil ? [selectionContext.selectedItems mutableCopy] : [[NSMutableArray alloc] init]; if (selectedItems.count == 0 && currentItem != nil) [selectedItems addObject:currentItem]; diff --git a/LegacyComponents/TGImageView.m b/LegacyComponents/TGImageView.m index ea31da5d0b..6a880f9726 100644 --- a/LegacyComponents/TGImageView.m +++ b/LegacyComponents/TGImageView.m @@ -235,6 +235,7 @@ NSString *TGImageViewOptionSynchronous = @"TGImageViewOptionSynchronous"; _transitionOverlayView = [[UIImageView alloc] init]; _transitionOverlayView.frame = _extendedInsetsImageView == nil ? self.bounds : _extendedInsetsImageView.frame; + _transitionOverlayView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self insertSubview:_transitionOverlayView atIndex:0]; _transitionOverlayView.image = _extendedInsetsImageView == nil ? self.image : _extendedInsetsImageView.image; diff --git a/LegacyComponents/TGMediaPickerGalleryVideoItemView.m b/LegacyComponents/TGMediaPickerGalleryVideoItemView.m index e1ec3ea731..0f0ef49945 100644 --- a/LegacyComponents/TGMediaPickerGalleryVideoItemView.m +++ b/LegacyComponents/TGMediaPickerGalleryVideoItemView.m @@ -492,42 +492,50 @@ return; __weak TGMediaPickerGalleryVideoItemView *weakSelf = self; - [_videoDurationDisposable setDisposable:[[_videoDurationVar.signal deliverOn:[SQueue mainQueue]] startWithNext:^(NSNumber *next) + void (^block)(void) = ^ { - __strong TGMediaPickerGalleryVideoItemView *strongSelf = weakSelf; - if (strongSelf == nil || next == nil) - return; - - TGMediaPickerGalleryVideoItem *item = strongSelf.item; - NSTimeInterval videoDuration = next.doubleValue; - strongSelf->_videoDuration = videoDuration; - - strongSelf->_scrubberView.allowsTrimming = (!item.asFile && ((item.asset != nil && ![strongSelf itemIsHighFramerateVideo])) && videoDuration >= TGVideoEditMinimumTrimmableDuration); - - TGVideoEditAdjustments *adjustments = (TGVideoEditAdjustments *)[item.editingContext adjustmentsForItem:item.editableMediaItem]; - if (adjustments != nil && fabs(adjustments.trimEndValue - adjustments.trimStartValue) > DBL_EPSILON) + [_videoDurationDisposable setDisposable:[[_videoDurationVar.signal deliverOn:[SQueue mainQueue]] startWithNext:^(NSNumber *next) { - strongSelf->_scrubberView.trimStartValue = adjustments.trimStartValue; - strongSelf->_scrubberView.trimEndValue = adjustments.trimEndValue; - strongSelf->_scrubberView.value = adjustments.trimStartValue; - [strongSelf->_scrubberView setTrimApplied:(adjustments.trimStartValue > 0 || adjustments.trimEndValue < videoDuration)]; - strongSelf->_shouldResetScrubber = false; - } - else - { - strongSelf->_scrubberView.trimStartValue = 0; - strongSelf->_scrubberView.trimEndValue = videoDuration; - [strongSelf->_scrubberView setTrimApplied:false]; - strongSelf->_shouldResetScrubber = true; - } - - [strongSelf->_scrubberView reloadData]; - if (!strongSelf->_appeared) - { - [strongSelf->_scrubberView resetToStart]; - strongSelf->_appeared = true; - } - }]]; + __strong TGMediaPickerGalleryVideoItemView *strongSelf = weakSelf; + if (strongSelf == nil || next == nil) + return; + + TGMediaPickerGalleryVideoItem *item = strongSelf.item; + NSTimeInterval videoDuration = next.doubleValue; + strongSelf->_videoDuration = videoDuration; + + strongSelf->_scrubberView.allowsTrimming = (!item.asFile && ((item.asset != nil && ![strongSelf itemIsHighFramerateVideo])) && videoDuration >= TGVideoEditMinimumTrimmableDuration); + + TGVideoEditAdjustments *adjustments = (TGVideoEditAdjustments *)[item.editingContext adjustmentsForItem:item.editableMediaItem]; + if (adjustments != nil && fabs(adjustments.trimEndValue - adjustments.trimStartValue) > DBL_EPSILON) + { + strongSelf->_scrubberView.trimStartValue = adjustments.trimStartValue; + strongSelf->_scrubberView.trimEndValue = adjustments.trimEndValue; + strongSelf->_scrubberView.value = adjustments.trimStartValue; + [strongSelf->_scrubberView setTrimApplied:(adjustments.trimStartValue > 0 || adjustments.trimEndValue < videoDuration)]; + strongSelf->_shouldResetScrubber = false; + } + else + { + strongSelf->_scrubberView.trimStartValue = 0; + strongSelf->_scrubberView.trimEndValue = videoDuration; + [strongSelf->_scrubberView setTrimApplied:false]; + strongSelf->_shouldResetScrubber = true; + } + + [strongSelf->_scrubberView reloadData]; + if (!strongSelf->_appeared) + { + [strongSelf->_scrubberView resetToStart]; + strongSelf->_appeared = true; + } + }]]; + }; + + if (_scrubberView.frame.size.width < FLT_EPSILON) + TGDispatchAfter(0.01, dispatch_get_main_queue(), block); + else + block(); } - (void)presentScrubbingPanelAfterReload:(bool)afterReload diff --git a/LegacyComponents/TGPhotoVideoEditor.h b/LegacyComponents/TGPhotoVideoEditor.h new file mode 100644 index 0000000000..f66cfa6248 --- /dev/null +++ b/LegacyComponents/TGPhotoVideoEditor.h @@ -0,0 +1,7 @@ +#import + +@interface TGPhotoVideoEditor : NSObject + ++ (void)presentWithContext:(id)context controller:(TGViewController *)controller withItem:(id)item recipientName:(NSString *)recipientName completion:(void (^)(id, TGMediaEditingContext *))completion; + +@end diff --git a/LegacyComponents/TGPhotoVideoEditor.m b/LegacyComponents/TGPhotoVideoEditor.m new file mode 100644 index 0000000000..a31a5ada6d --- /dev/null +++ b/LegacyComponents/TGPhotoVideoEditor.m @@ -0,0 +1,148 @@ +#import "TGPhotoVideoEditor.h" + +#import "TGMediaEditingContext.h"b + +#import "TGMediaPickerGalleryModel.h" +#import "TGMediaPickerGalleryPhotoItem.h" +#import "TGMediaPickerGalleryVideoItem.h" + +#import "TGMediaPickerGalleryVideoItemView.h" + +@implementation TGPhotoVideoEditor + ++ (void)presentWithContext:(id)context controller:(TGViewController *)controller withItem:(id)item recipientName:(NSString *)recipientName completion:(void (^)(id, TGMediaEditingContext *))completion +{ + id windowManager = [context makeOverlayWindowManager]; + id windowContext = [windowManager context]; + + TGMediaEditingContext *editingContext = [[TGMediaEditingContext alloc] init]; + + TGModernGalleryController *galleryController = [[TGModernGalleryController alloc] initWithContext:windowContext]; + galleryController.adjustsStatusBarVisibility = true; + //galleryController.hasFadeOutTransition = true; + + id galleryItem = nil; + if (item.isVideo) + galleryItem = [[TGMediaPickerGalleryVideoItem alloc] initWithAsset:item]; + else + galleryItem = [[TGMediaPickerGalleryPhotoItem alloc] initWithAsset:item]; + galleryItem.editingContext = editingContext; + + TGMediaPickerGalleryModel *model = [[TGMediaPickerGalleryModel alloc] initWithContext:windowContext items:@[galleryItem] focusItem:galleryItem selectionContext:nil editingContext:editingContext hasCaptions:false allowCaptionEntities:false hasTimer:false onlyCrop:false inhibitDocumentCaptions:false hasSelectionPanel:false hasCamera:false recipientName:recipientName]; + model.controller = galleryController; + //model.suggestionContext = self.suggestionContext; + + model.willFinishEditingItem = ^(id editableItem, id adjustments, id representation, bool hasChanges) + { + if (hasChanges) + { + [editingContext setAdjustments:adjustments forItem:editableItem]; + [editingContext setTemporaryRep:representation forItem:editableItem]; + } + }; + + model.didFinishEditingItem = ^(id editableItem, __unused id adjustments, UIImage *resultImage, UIImage *thumbnailImage) + { + [editingContext setImage:resultImage thumbnailImage:thumbnailImage forItem:editableItem synchronous:false]; + }; + + model.saveItemCaption = ^(id editableItem, NSString *caption, NSArray *entities) + { + [editingContext setCaption:caption entities:entities forItem:editableItem]; + }; + + model.interfaceView.hasSwipeGesture = false; + galleryController.model = model; + + __weak TGModernGalleryController *weakGalleryController = galleryController; + __weak TGMediaPickerGalleryModel *weakModel = model; + + [model.interfaceView updateSelectionInterface:1 counterVisible:false animated:false]; + model.interfaceView.thumbnailSignalForItem = ^SSignal *(id item) + { + return nil; + }; + model.interfaceView.donePressed = ^(TGMediaPickerGalleryItem *item) + { + __strong TGModernGalleryController *strongController = weakGalleryController; + if (strongController == nil) + return; + + if ([item isKindOfClass:[TGMediaPickerGalleryVideoItem class]]) + { + TGMediaPickerGalleryVideoItemView *itemView = (TGMediaPickerGalleryVideoItemView *)[strongController itemViewForItem:item]; + [itemView stop]; + [itemView setPlayButtonHidden:true animated:true]; + } + + if (completion != nil) + completion(item.asset, editingContext); + + [UIView animateWithDuration:0.3f delay:0.0f options:(7 << 16) animations:^ + { + strongController.view.frame = CGRectOffset(strongController.view.frame, 0, strongController.view.frame.size.height); + } completion:^(__unused BOOL finished) + { + [strongController dismiss]; + }]; + }; + +// CGSize snapshotSize = TGScaleToFill(CGSizeMake(480, 640), CGSizeMake(self.view.frame.size.width, self.view.frame.size.width)); +// UIView *snapshotView = [_previewView snapshotViewAfterScreenUpdates:false]; +// snapshotView.contentMode = UIViewContentModeScaleAspectFill; +// snapshotView.frame = CGRectMake(_previewView.center.x - snapshotSize.width / 2, _previewView.center.y - snapshotSize.height / 2, snapshotSize.width, snapshotSize.height); +// snapshotView.hidden = true; +// [_previewView.superview insertSubview:snapshotView aboveSubview:_previewView]; + + galleryController.beginTransitionIn = ^UIView *(__unused TGMediaPickerGalleryItem *item, __unused TGModernGalleryItemView *itemView) + { + TGModernGalleryController *strongGalleryController = weakGalleryController; + strongGalleryController.view.alpha = 0.0f; + [UIView animateWithDuration:0.3f animations:^ + { + strongGalleryController.view.alpha = 1.0f; + }]; + //return snapshotView; + return nil; + }; + + galleryController.beginTransitionOut = ^UIView *(__unused TGMediaPickerGalleryItem *item, __unused TGModernGalleryItemView *itemView) + { +// __strong TGCameraController *strongSelf = weakSelf; +// if (strongSelf != nil) +// { + TGMediaPickerGalleryModel *strongModel = weakModel; + if (strongModel == nil) + return nil; + +// [UIView animateWithDuration:0.3f delay:0.1f options:UIViewAnimationOptionCurveLinear animations:^ +// { +// strongSelf->_interfaceView.alpha = 1.0f; +// } completion:nil]; + +// return snapshotView; +// } + return nil; + }; + + galleryController.completedTransitionOut = ^ + { + //[snapshotView removeFromSuperview]; + + TGModernGalleryController *strongGalleryController = weakGalleryController; + if (strongGalleryController != nil && strongGalleryController.overlayWindow == nil) + { + TGNavigationController *navigationController = (TGNavigationController *)strongGalleryController.navigationController; + TGOverlayControllerWindow *window = (TGOverlayControllerWindow *)navigationController.view.window; + if ([window isKindOfClass:[TGOverlayControllerWindow class]]) + [window dismiss]; + } + }; + + TGOverlayControllerWindow *controllerWindow = [[TGOverlayControllerWindow alloc] initWithManager:windowManager parentController:controller contentController:galleryController]; + controllerWindow.hidden = false; + //controllerWindow.windowLevel = self.view.window.windowLevel + 0.0001f; + galleryController.view.clipsToBounds = true; +} + +@end From 9e2e55e46c28c945eafc4d4db7974c649ef0adf5 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Mon, 4 Jun 2018 19:46:40 +0300 Subject: [PATCH 2/2] no message --- LegacyComponents/TGMediaPickerToolbarView.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LegacyComponents/TGMediaPickerToolbarView.m b/LegacyComponents/TGMediaPickerToolbarView.m index 0f7a482169..2a855cccd6 100644 --- a/LegacyComponents/TGMediaPickerToolbarView.m +++ b/LegacyComponents/TGMediaPickerToolbarView.m @@ -133,6 +133,7 @@ const CGFloat TGMediaPickerToolbarHeight = 44.0f; { button.alpha = 0.0f; [button setTitle:title forState:UIControlStateNormal]; + [button sizeToFit]; [UIView animateWithDuration:0.15f animations:^ { @@ -153,6 +154,7 @@ const CGFloat TGMediaPickerToolbarHeight = 44.0f; else { [button setTitle:title forState:UIControlStateNormal]; + [button sizeToFit]; } }