Attachment menu improvements

This commit is contained in:
Ilya Laktyushin
2022-02-21 10:11:53 +03:00
parent 2efbb9170f
commit d811f5f160
80 changed files with 6104 additions and 1273 deletions

View File

@@ -1,4 +1,5 @@
#import "TGAttachmentCameraView.h"
#import "TGImageUtils.h"
#import "LegacyComponentsInternal.h"
@@ -14,6 +15,7 @@
#import <AVFoundation/AVFoundation.h>
@interface TGAttachmentCameraView ()
{
UIView *_wrapperView;
@@ -52,7 +54,7 @@
[_wrapperView addSubview:_previewView];
[camera attachPreviewView:_previewView];
_iconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Editor/Camera"]];
_iconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Chat/Attach Menu/Camera"]];
[self addSubview:_iconView];
[self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGesture:)]];
@@ -121,6 +123,10 @@
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
}
- (void)removeCorners {
[_cornersView removeFromSuperview];
}
- (void)setPallete:(TGMenuSheetPallete *)pallete
{
_pallete = pallete;
@@ -228,6 +234,7 @@
void(^block)(void) = ^
{
_wrapperView.transform = CGAffineTransformMakeRotation(-1 * TGRotationForInterfaceOrientation(orientation));
_wrapperView.frame = self.bounds;
};
if (animated)
@@ -240,11 +247,13 @@
{
[super layoutSubviews];
_wrapperView.frame = self.bounds;
TGCameraPreviewView *previewView = _previewView;
if (previewView.superview == _wrapperView)
previewView.frame = self.bounds;
_iconView.frame = CGRectMake((self.frame.size.width - _iconView.frame.size.width) / 2, (self.frame.size.height - _iconView.frame.size.height) / 2, _iconView.frame.size.width, _iconView.frame.size.height);
_iconView.frame = CGRectMake(self.frame.size.width - _iconView.frame.size.width - 3.0, 3.0 - TGScreenPixel, _iconView.frame.size.width, _iconView.frame.size.height);
}
- (void)saveStartImage:(void (^)(void))completion {