|
@@ -24,7 +24,7 @@
|
|
|
/**
|
|
|
前后摄像头切换按钮
|
|
|
*/
|
|
|
-@property (nonatomic, strong) UIButton *cameraIdButton;
|
|
|
+@property (nonatomic, strong) UIButton *reverseButton;
|
|
|
|
|
|
/**
|
|
|
时间显示控件
|
|
@@ -46,9 +46,9 @@
|
|
|
*/
|
|
|
@property (nonatomic, strong) AlivcRecordUIConfig *uiConfig;
|
|
|
|
|
|
-@property (nonatomic, strong)AlivcRecordFocusView *focusView;
|
|
|
+@property (nonatomic, strong) AlivcRecordFocusView *focusView;
|
|
|
|
|
|
-@property (nonatomic, assign)CFTimeInterval cameraIdButtonClickTime;
|
|
|
+@property (nonatomic, assign) CFTimeInterval reverseButtonClickTime;
|
|
|
|
|
|
@property (nonatomic, strong) UIImageView *coverImageView;
|
|
|
|
|
@@ -80,7 +80,7 @@
|
|
|
*/
|
|
|
- (void)setupSubview
|
|
|
{
|
|
|
- _cameraIdButtonClickTime =CFAbsoluteTimeGetCurrent();
|
|
|
+ _reverseButtonClickTime =CFAbsoluteTimeGetCurrent();
|
|
|
if(!_uiConfig){
|
|
|
_uiConfig = [[AlivcRecordUIConfig alloc]init];
|
|
|
}
|
|
@@ -89,7 +89,7 @@
|
|
|
|
|
|
[self addSubview:self.backButton];
|
|
|
[self.topView addSubview:self.finishButton];
|
|
|
- [self addSubview:self.cameraIdButton];
|
|
|
+ [self addSubview:self.reverseButton];
|
|
|
[self addSubview:self.musicButton];
|
|
|
[self addSubview:self.filterButton];
|
|
|
[self insertSubview:self.previewView atIndex:0];
|
|
@@ -151,7 +151,7 @@
|
|
|
[self.filterButton setExclusiveTouch:YES];
|
|
|
[self.deleteButton setExclusiveTouch:YES];
|
|
|
[self.finishButton setExclusiveTouch:YES];
|
|
|
- [self.cameraIdButton setExclusiveTouch:YES];
|
|
|
+ [self.reverseButton setExclusiveTouch:YES];
|
|
|
}
|
|
|
|
|
|
- (void)recordButtonTouchUp {
|
|
@@ -249,9 +249,10 @@
|
|
|
self.deleteButton.hidden = hide;
|
|
|
self.topView.hidden = hide;
|
|
|
self.rateView.hidden = hide;
|
|
|
+
|
|
|
+ self.reverseButton.hidden = hide;
|
|
|
self.musicButton.hidden = hide;
|
|
|
self.filterButton.hidden = hide;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- (void)setBottomHide:(BOOL)hide{
|
|
@@ -284,6 +285,18 @@
|
|
|
}
|
|
|
|
|
|
#pragma mark - Getter -
|
|
|
+- (QUProgressView *)progressView {
|
|
|
+ if (!_progressView) {
|
|
|
+ _progressView = [[QUProgressView alloc] initWithFrame:CGRectMake(14, SafeTop + 20, CGRectGetWidth(self.bounds) - 28, 5)];
|
|
|
+ _progressView.showBlink = NO;
|
|
|
+ _progressView.showNoticePoint = YES;
|
|
|
+ _progressView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.01];
|
|
|
+ _progressView.layer.cornerRadius = 3;
|
|
|
+ _progressView.layer.masksToBounds = YES;
|
|
|
+ }
|
|
|
+ return _progressView;
|
|
|
+}
|
|
|
+
|
|
|
- (UIButton *)backButton
|
|
|
{
|
|
|
if (!_backButton) {
|
|
@@ -296,50 +309,29 @@
|
|
|
return _backButton;
|
|
|
}
|
|
|
|
|
|
-- (UIButton *)finishButton
|
|
|
-{
|
|
|
- if (!_finishButton) {
|
|
|
- _finishButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
- _finishButton.backgroundColor = [UIColor clearColor];
|
|
|
-
|
|
|
- _finishButton.frame = CGRectMake(finishBtnX, 16, 58, 27);
|
|
|
- _finishButton.hidden = NO;
|
|
|
- [_finishButton setTitle:@"下一步" forState:UIControlStateNormal];
|
|
|
- _finishButton.titleLabel.font = [UIFont systemFontOfSize:13];
|
|
|
- [_finishButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
|
|
- _finishButton.enabled = NO;
|
|
|
- UIColor *bgColor_disable = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.34];
|
|
|
- [_finishButton setBackgroundColor:bgColor_disable];
|
|
|
- [_finishButton addTarget:self action:@selector(finishButtonClicked) forControlEvents:UIControlEventTouchUpInside];
|
|
|
- _finishButton.layer.cornerRadius = 2;
|
|
|
-
|
|
|
- }
|
|
|
- return _finishButton;
|
|
|
-}
|
|
|
-
|
|
|
-- (UIButton *)cameraIdButton
|
|
|
+- (UIButton *)reverseButton
|
|
|
{
|
|
|
- if (!_cameraIdButton) {
|
|
|
- _cameraIdButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
- _cameraIdButton.backgroundColor = [UIColor clearColor];
|
|
|
- _cameraIdButton.frame = CGRectMake(CGRectGetWidth(self.bounds) - 44 - 10, SafeTop + 44, 44, 46);
|
|
|
- [_cameraIdButton setImage:_uiConfig.switchCameraImage forState:UIControlStateNormal];
|
|
|
- [_cameraIdButton addTarget:self action:@selector(cameraIdButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ if (!_reverseButton) {
|
|
|
+ _reverseButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ _reverseButton.backgroundColor = [UIColor clearColor];
|
|
|
+ _reverseButton.frame = CGRectMake(CGRectGetWidth(self.bounds) - 44 - 10, SafeTop + 44, 44, 46);
|
|
|
+ [_reverseButton setImage:_uiConfig.switchCameraImage forState:UIControlStateNormal];
|
|
|
+ [_reverseButton addTarget:self action:@selector(reverseButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
|
- [_cameraIdButton setTitle:@"翻转" forState:UIControlStateNormal];
|
|
|
- _cameraIdButton.titleLabel.font = [UIFont systemFontOfSize:12];
|
|
|
- CGFloat titleHeight = _cameraIdButton.titleLabel.intrinsicContentSize.height;
|
|
|
- CGFloat imageWidth = _cameraIdButton.imageView.frame.size.width;
|
|
|
- CGFloat imageHeight = _cameraIdButton.imageView.frame.size.height;
|
|
|
+ [_reverseButton setTitle:@"翻转" forState:UIControlStateNormal];
|
|
|
+ _reverseButton.titleLabel.font = [UIFont systemFontOfSize:12];
|
|
|
+ CGFloat titleHeight = _reverseButton.titleLabel.intrinsicContentSize.height;
|
|
|
+ CGFloat imageWidth = _reverseButton.imageView.frame.size.width;
|
|
|
+ CGFloat imageHeight = _reverseButton.imageView.frame.size.height;
|
|
|
|
|
|
- _cameraIdButton.imageEdgeInsets = UIEdgeInsetsMake(0, (44 - imageWidth) * 0.5, titleHeight + 4, 0);
|
|
|
- _cameraIdButton.titleEdgeInsets = UIEdgeInsetsMake(imageHeight + 4, -imageWidth, 0, 0);
|
|
|
+ _reverseButton.imageEdgeInsets = UIEdgeInsetsMake(0, (44 - imageWidth) * 0.5, titleHeight + 4, 0);
|
|
|
+ _reverseButton.titleEdgeInsets = UIEdgeInsetsMake(imageHeight + 4, -imageWidth, 0, 0);
|
|
|
|
|
|
- _cameraIdButton.layer.shadowColor = [UIColor grayColor].CGColor;
|
|
|
- _cameraIdButton.layer.shadowOpacity = 0.5;
|
|
|
- _cameraIdButton.layer.shadowOffset = CGSizeMake(1, 1);
|
|
|
+ _reverseButton.layer.shadowColor = [UIColor grayColor].CGColor;
|
|
|
+ _reverseButton.layer.shadowOpacity = 0.5;
|
|
|
+ _reverseButton.layer.shadowOffset = CGSizeMake(1, 1);
|
|
|
}
|
|
|
- return _cameraIdButton;
|
|
|
+ return _reverseButton;
|
|
|
}
|
|
|
|
|
|
- (UIButton *)musicButton{
|
|
@@ -352,7 +344,6 @@
|
|
|
[_musicButton setTitle:@"音乐" forState:UIControlStateNormal];
|
|
|
_musicButton.titleLabel.font = [UIFont systemFontOfSize:12];
|
|
|
CGFloat titleHeight = _musicButton.titleLabel.intrinsicContentSize.height;
|
|
|
- // CGFloat titleWidth = btn.titleLabel.intrinsicContentSize.width;
|
|
|
CGFloat imageWidth = _musicButton.imageView.frame.size.width;
|
|
|
CGFloat imageHeight = _musicButton.imageView.frame.size.height;
|
|
|
|
|
@@ -376,7 +367,6 @@
|
|
|
[_filterButton setTitle:@"滤镜" forState:UIControlStateNormal];
|
|
|
_filterButton.titleLabel.font = [UIFont systemFontOfSize:12];
|
|
|
CGFloat titleHeight = _filterButton.titleLabel.intrinsicContentSize.height;
|
|
|
- // CGFloat titleWidth = btn.titleLabel.intrinsicContentSize.width;
|
|
|
CGFloat imageWidth = _filterButton.imageView.frame.size.width;
|
|
|
CGFloat imageHeight = _filterButton.imageView.frame.size.height;
|
|
|
_filterButton.imageEdgeInsets = UIEdgeInsetsMake(0, (44 - imageWidth) * 0.5, titleHeight + 4, 0);
|
|
@@ -391,16 +381,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
-- (QUProgressView *)progressView {
|
|
|
- if (!_progressView) {
|
|
|
- _progressView = [[QUProgressView alloc] initWithFrame:CGRectMake(14, SafeTop + 20, CGRectGetWidth(self.bounds) - 28, 5)];
|
|
|
- _progressView.showBlink = NO;
|
|
|
- _progressView.showNoticePoint = YES;
|
|
|
- _progressView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.01];
|
|
|
- _progressView.layer.cornerRadius = 3;
|
|
|
- _progressView.layer.masksToBounds = YES;
|
|
|
+- (UIButton *)finishButton
|
|
|
+{
|
|
|
+ if (!_finishButton) {
|
|
|
+ _finishButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ _finishButton.backgroundColor = [UIColor clearColor];
|
|
|
+
|
|
|
+ _finishButton.frame = CGRectMake(finishBtnX, 16, 58, 27);
|
|
|
+ _finishButton.hidden = NO;
|
|
|
+ [_finishButton setTitle:@"下一步" forState:UIControlStateNormal];
|
|
|
+ _finishButton.titleLabel.font = [UIFont systemFontOfSize:13];
|
|
|
+ [_finishButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
|
|
+ _finishButton.enabled = NO;
|
|
|
+ UIColor *bgColor_disable = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.34];
|
|
|
+ [_finishButton setBackgroundColor:bgColor_disable];
|
|
|
+ [_finishButton addTarget:self action:@selector(finishButtonClicked) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ _finishButton.layer.cornerRadius = 2;
|
|
|
+
|
|
|
}
|
|
|
- return _progressView;
|
|
|
+ return _finishButton;
|
|
|
}
|
|
|
|
|
|
- (UIView *)previewView{
|
|
@@ -486,13 +485,12 @@
|
|
|
|
|
|
@param sender 前置、后置摄像头切换按钮
|
|
|
*/
|
|
|
-- (void)cameraIdButtonClicked:(id)sender
|
|
|
+- (void)reverseButtonClicked:(id)sender
|
|
|
{
|
|
|
- if (CFAbsoluteTimeGetCurrent()-_cameraIdButtonClickTime >1.2) {//限制连续点击时间间隔不能小于1s
|
|
|
-// NSLog(@"=============>切换摄像头");
|
|
|
- _cameraIdButtonClickTime =CFAbsoluteTimeGetCurrent();
|
|
|
- if (self.delegate && [self.delegate respondsToSelector:@selector(cameraIdButtonClicked)]) {
|
|
|
- [self.delegate cameraIdButtonClicked];
|
|
|
+ if (CFAbsoluteTimeGetCurrent()-_reverseButtonClickTime >1.2) {//限制连续点击时间间隔不能小于1s
|
|
|
+ _reverseButtonClickTime =CFAbsoluteTimeGetCurrent();
|
|
|
+ if (self.delegate && [self.delegate respondsToSelector:@selector(reverseButtonClicked)]) {
|
|
|
+ [self.delegate reverseButtonClicked];
|
|
|
}
|
|
|
}
|
|
|
}
|