add files

This commit is contained in:
lianxiang
2018-09-14 18:04:02 +08:00
parent fada68d22d
commit 9bba78987b
59 changed files with 974 additions and 116 deletions
@@ -27,12 +27,18 @@
#import "GiGaFlingCommitVC.h"
#import "MaskTimeCircularProgressView.h"
//#import "UINavigationBar+Custom.h"
#import "UIButton+WebCache.h"
#import "GiGaUser.h"
#import "GiGaUserManager.h"
#import "GiGaBaseAPiRequest.h"
@interface GiGaMaskTaskViewController ()<MaskCirCularProGressViewDelegate>
{
AVAudioPlayer *_musicPalyer;
}
@property (nonatomic,strong) UIButton *rightNavUserBtn;
@property(nonatomic,strong)MaskViewBootomWaringView *waringView;
@property(nonatomic,strong) UIImageView *maskImageView;
@property(nonatomic,strong) UIImageView *faceView;
@@ -95,13 +101,14 @@
if (!_cicleProgressView) {
_cicleProgressView = [[MaskTimeCircularProgressView alloc] initWithFrame:CGRectMake(100, 251, 125, 125) backColor:GIGARGB(88, 0, 2, 1) progressColor:[UIColor blueColor] lineWidth:10 timeinterval:10];
_cicleProgressView = [[MaskTimeCircularProgressView alloc] initWithFrame:CGRectMake(100, 251 + PhoneX_TopMargin, 125, 125) backColor:GIGARGB(88, 0, 2, 1) progressColor:[UIColor blueColor] lineWidth:10 timeinterval:10];
_cicleProgressView.delegate = self;
_cicleProgressView.hidden = YES;
}
return _cicleProgressView;
}
//⬆️
- (UIImageView *)swipeGaurdimagView{
if (!_swipeGaurdimagView) {
@@ -149,7 +156,7 @@
#pragma mark 弹幕
-(void)createInputView{
GiGaFlingCommitVC* GiGaFlingVC = [[GiGaFlingCommitVC alloc] init];
GiGaFlingCommitVC* GiGaFlingVC = [[GiGaFlingCommitVC alloc] init];
if (ISIOS8) {
GiGaFlingVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
}else{
@@ -165,6 +172,7 @@
[super viewWillAppear:animated];
//取消导航对内容下移影响
[self.navigationController.navigationBar setTranslucent:YES];
}
@@ -191,16 +199,16 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
// [self.view addSubview:self.tableView];
// self.tableView.backgroundColor = GIGA_MAIN_BGCOLOR;
[self setUpNav];
[self initUI];
[self addNotify];
[self creatBackGroundMusic];
}
#pragma mark - 响应事件
#pragma mark 上滑动手势
-(void)maskupSwipeGesture{
[self animaMask];
@@ -234,6 +242,8 @@
[self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.attachPoint.y - 87);
}];
[self.maskImageView setImage:[UIImage imageNamed:@"masking_img_mask"]];
[self.view layoutIfNeeded];
@@ -295,7 +305,6 @@
make.top.mas_equalTo(254 + PhoneX_TopMargin);
}];
//[self.view layoutIfNeeded];
} completion:^(BOOL finished) {
@@ -350,7 +359,7 @@
make.top.mas_equalTo(self.view.mas_top).offset(251 + PhoneX_TopMargin);
make.size.mas_equalTo(CGSizeMake(125, 125));
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
//up
@@ -416,7 +425,7 @@
[self setBackGroundPlayingInfo];//锁屏音频信息
//总时间隔 s
NSTimeInterval timeInterVal = 30;
NSTimeInterval timeInterVal = [GiGaUserDefault getUserMaskeTime];
[self.cicleProgressView startWith:timeInterVal];
//底部弹窗
@@ -459,7 +468,6 @@
case UIEventSubtypeRemoteControlPause:
// [_musicPalyer pause];
break;
default:
NSLog(@"没有处理过这个事件------receivedEvent.subtype==%ld",(long)receivedEvent.subtype);
break;
@@ -475,21 +483,15 @@
AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate];
delegate.isMasking = NO;
[_musicPalyer stop];
//复原动画
[self endMaskAnimation];
}
#pragma mark 开始测试
-(void)testBtnAcion:(UIButton *)btn{
// BOOL isUserLogin = [GiGaUserDefault isUserLogin];
//
// if (isUserLogin) {
GiGaQuestionVC *questionVC = [[GiGaQuestionVC alloc] init];
[self.navigationController pushViewController:questionVC animated:YES];
GiGaQuestionVC *questionVC = [[GiGaQuestionVC alloc] init];
[self.navigationController pushViewController:questionVC animated:YES];
}
@@ -498,6 +500,8 @@
NC_ADD_TARGET_NAME_OBJECT(self, @selector(guardViewDissmiss), USER_GUARD_DISSMISS, nil) ;
NC_ADD_TARGET_NAME_OBJECT(self, @selector(appGauardViewDissmiss),APP_GUARD_DISSMISS, nil) ;
NC_ADD_TARGET_NAME_OBJECT(self, @selector(pushToAppAdDetailView),APP_PUSHTO_DETAILVIEW, nil) ;
NC_ADD_TARGET_NAME_OBJECT(self, @selector(userLoginNotify), kUserLoginSuccessNoti, nil);
NC_ADD_TARGET_NAME_OBJECT(self, @selector(userlogOutNotify), kUserLogOutNotify, nil);
}
#pragma mark 广告详情
@@ -523,11 +527,9 @@
}
-(void)dealloc{
NC_REMOVE_NAME(self, USER_GUARD_DISSMISS, nil);
NC_REMOVE_NAME(self, APP_GUARD_DISSMISS, nil);
NC_REMOVE_NAME(self, APP_PUSHTO_DETAILVIEW, nil);
}
#pragma mark 新手引导
@@ -550,7 +552,7 @@
[self presentViewController:gaurdVC animated:YES completion:nil];
}
#pragma mark - setUpNav
#pragma mark - 导航按钮
-(void)setUpNav{
//leftItem
// UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -563,10 +565,39 @@
//rightItem
UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
rightBtn.frame = CGRectMake(0, 0, 40, 40);
//rightBtn.backgroundColor = [UIColor blueColor];
rightBtn.layer.masksToBounds = YES;
rightBtn.layer.cornerRadius = 20;
[rightBtn setImage:[UIImage imageNamed:@"nav_circle_avatar"] forState:UIControlStateNormal];
self.rightNavUserBtn = rightBtn;
[rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
if ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 11.0) {
[self.rightNavUserBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(40, 40));
}];
}
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
if (isUserLogin) {
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
if (user) {
if (user.headImgUrl && ![user.headImgUrl isKindOfClass:[NSNull class]]) {
[self refreshUserIcon:user.headImgUrl];
}
}
}
}
#pragma mark 用户头像更新
-(void)refreshUserIcon:(NSString *)imageUrl{
NSURL *url = [NSURL URLWithString:imageUrl];
[self.rightNavUserBtn sd_setImageWithURL:url forState:UIControlStateNormal];
//[self.rightNavUserBtn sd_setBackgroundImageWithURL:url forState:UIControlStateNormal];
}
@@ -590,7 +621,6 @@
-(void)rightBtnAction{
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
if (isUserLogin) {
GiGaMeViewController *meVC= [[GiGaMeViewController alloc] init];
[self.navigationController pushViewController:meVC animated:YES];
@@ -599,7 +629,6 @@
GiGaBaseNavViewController *baseNav = [[GiGaBaseNavViewController alloc] initWithRootViewController:userlogInVC];
[self presentViewController:baseNav animated:YES completion:nil];
}
}
#pragma mark -bottomView
@@ -613,7 +642,6 @@
}
#pragma mark - MaskCirCularProGressViewDelegate
- (void)updateProgressViewWith:(NSTimeInterval)timeInterval{
}
@@ -628,5 +656,21 @@
// Dispose of any resources that can be recreated.
}
#pragma mark - 登录成功通知接收
-(void)userLoginNotify{
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
if (user.headImgUrl && ![user.headImgUrl isKindOfClass:[NSNull class]] ) {
[self refreshUserIcon:user.headImgUrl];
}
}
#pragma mark - 退出登录通知
-(void)userlogOutNotify{
[self.rightNavUserBtn setImage:[UIImage imageNamed:@"nav_circle_avatar"] forState:UIControlStateNormal];
}
@end
@@ -49,6 +49,7 @@
_page = 1;
[self loadRequestQuestions];
}
-(NSMutableArray *)questonArray{
@@ -69,6 +70,9 @@
-(void)initUI{
//没有tabview 界面 直接 上移动安全 导航高度 (设计稿 -64 或 -88)
CGFloat navH = SAFE_NAV_HEIGHT;
UIButton *numberBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[numberBtn setBackgroundImage:[UIImage imageNamed:@"ceshi_number"] forState:UIControlStateNormal];
NSAttributedString *numbertitle = [[NSAttributedString alloc] initWithString:@"1" attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
@@ -95,7 +99,7 @@
[numberBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(31, 31));
make.top.mas_equalTo(self.view.mas_top).offset(112 + PhoneX_TopMargin);
make.top.mas_equalTo(self.view.mas_top).offset(112 -navH);
make.left.mas_equalTo(self.view.mas_left).offset(46);
}];
@@ -130,7 +134,7 @@
[self.view addSubview:nextBtn];
[nextBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(529);
make.top.mas_equalTo(self.view.mas_top).offset(529 -navH);
make.size.mas_equalTo(CGSizeMake(126, 40));
make.left.mas_equalTo(self.view.mas_left).offset(self.view.frame.size.width /2 - 126 /2);
}];
@@ -151,7 +155,7 @@
[self.preBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view.mas_left).offset(69);
make.top.mas_equalTo(self.view.mas_top).offset(529);
make.top.mas_equalTo(self.view.mas_top).offset(529 - navH);
make.size.mas_equalTo(CGSizeMake(97, 40));
}];
@@ -199,7 +203,7 @@
}
[self.view layoutIfNeeded];
MaskQuestionView *questionView = [[MaskQuestionView alloc] initQuestionView:CGRectMake(0,248, self.view.frame.size.width,212) style:style titles:titles current:_currentModel];
MaskQuestionView *questionView = [[MaskQuestionView alloc] initQuestionView:CGRectMake(0,248 - SAFE_NAV_HEIGHT, self.view.frame.size.width,212) style:style titles:titles current:_currentModel];
NSLog(@"_currentModel--ID:%d",_currentModel.questionId);
questionView.delegate = self;
[self.view addSubview:questionView];
@@ -317,7 +321,7 @@
if (_page > 1) {
self.preBtn.hidden = NO;
[self.nextBtn mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(529);
make.top.mas_equalTo(self.view.mas_top).offset(529 -SAFE_NAV_HEIGHT);
make.size.mas_equalTo(CGSizeMake(126, 40));
make.left.mas_equalTo(self.view.mas_left).offset(self.view.frame.size.width /2 + 10);
@@ -326,7 +330,7 @@
}else{
[self.nextBtn mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(529);
make.top.mas_equalTo(self.view.mas_top).offset(529 -SAFE_NAV_HEIGHT);
make.size.mas_equalTo(CGSizeMake(126, 40));
make.left.mas_equalTo(self.view.mas_left).offset(self.view.frame.size.width /2 - 126 /2);
}];