add
This commit is contained in:
@@ -61,8 +61,6 @@
|
||||
-(void)updatePage{
|
||||
|
||||
self.pagControl.currentPage = self.scrollView.contentOffset.x / self.scrollView.bounds.size.width;
|
||||
|
||||
|
||||
self.pagControl.hidden = self.scrollView.contentOffset.x / self.scrollView.bounds.size.width == 2 ? YES : NO;
|
||||
GILog(@"%ld",self.pagControl.currentPage);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
@interface GiGaMaskTaskViewController ()<MaskCirCularProGressViewDelegate,MaskTimeTextViewDelegate>
|
||||
{
|
||||
AVAudioPlayer *_musicPalyer;
|
||||
AVAudioPlayer *_startMaskMusic;
|
||||
}
|
||||
|
||||
@property (nonatomic,strong) UIButton *rightNavUserBtn;
|
||||
@@ -123,7 +124,6 @@
|
||||
return _hairImageView;
|
||||
}
|
||||
|
||||
|
||||
//人脸
|
||||
- (UIImageView *)faceView{
|
||||
if (!_faceView) {
|
||||
@@ -206,27 +206,28 @@
|
||||
|
||||
#pragma mark 弹幕
|
||||
-(void)createInputView{
|
||||
|
||||
|
||||
|
||||
GiGaFlingCommitVC* GiGaFlingVC = [[GiGaFlingCommitVC alloc] init];
|
||||
if (ISIOS8) {
|
||||
GiGaFlingVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
|
||||
}else{
|
||||
GiGaFlingVC.modalPresentationStyle = UIModalPresentationCurrentContext;
|
||||
}
|
||||
GiGaFlingVC.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];
|
||||
GiGaFlingVC.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
|
||||
[self presentViewController:GiGaFlingVC animated:NO completion:nil];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 生命周期
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
|
||||
[super viewWillAppear:animated];
|
||||
//取消导航对内容下移影响
|
||||
[self.navigationController.navigationBar setTranslucent:YES];
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(void)viewDidAppear:(BOOL)animated{
|
||||
[super viewDidAppear:animated];
|
||||
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
|
||||
@@ -235,13 +236,12 @@
|
||||
|
||||
// app引导页
|
||||
|
||||
// BOOL showAppGaurd = [GiGaUserDefault isShowedAppGaurd];
|
||||
// if (showAppGaurd == NO) {
|
||||
// [self showAPPappGaurdView];
|
||||
// }
|
||||
|
||||
//[self showAPPappGaurdView];
|
||||
BOOL showAppGaurd = [GiGaUserDefault isShowedAppGaurd];
|
||||
if (showAppGaurd == NO) {
|
||||
[self showAPPappGaurdView];
|
||||
}
|
||||
|
||||
// [self showUserGaurdView];
|
||||
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
[self initUI];
|
||||
[self addNotify];
|
||||
[self creatBackGroundMusic];
|
||||
|
||||
[self creatMaskTimeSatrtMusic];
|
||||
}
|
||||
|
||||
#pragma mark - 响应事件
|
||||
@@ -315,7 +315,6 @@
|
||||
make.top.mas_equalTo(self.attachPoint.y - 87);
|
||||
}];
|
||||
|
||||
|
||||
[self.maskImageView setImage:[UIImage imageNamed:@"masking_img_mask"]];
|
||||
|
||||
[self.view layoutIfNeeded];
|
||||
@@ -474,12 +473,28 @@
|
||||
NSError *payerError;
|
||||
NSURL *musicUrl = [[NSURL alloc] initWithString:[[NSBundle mainBundle] pathForResource:@"pomodoSound" ofType:@"m4a"]] ;
|
||||
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:musicUrl error:&payerError];
|
||||
player.numberOfLoops = 1;//-1 无限
|
||||
player.numberOfLoops = -1;//-1 无限
|
||||
player.volume = 0;
|
||||
_musicPalyer = player;
|
||||
[[AVAudioSession sharedInstance] setActive:YES error:nil];
|
||||
//设置后台模式和锁屏模式下依然能够播放
|
||||
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 开始面膜时间提示音🎵
|
||||
-(void)creatMaskTimeSatrtMusic{
|
||||
|
||||
//初始化音频播放器
|
||||
NSError *payerError;
|
||||
NSURL *musicUrl = [[NSURL alloc] initWithString:[[NSBundle mainBundle] pathForResource:@"ogg_btn" ofType:@"mp3"]] ;
|
||||
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:musicUrl error:&payerError];
|
||||
player.numberOfLoops = 2;
|
||||
player.volume = 0.5;
|
||||
|
||||
_startMaskMusic = player;
|
||||
[[AVAudioSession sharedInstance] setActive:YES error:nil];
|
||||
//设置后台模式和锁屏模式下依然能够播放
|
||||
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];
|
||||
}
|
||||
|
||||
#pragma mark 开始面膜时间
|
||||
@@ -493,6 +508,7 @@
|
||||
return;
|
||||
}
|
||||
delegate.isMasking = YES;
|
||||
[_startMaskMusic play];
|
||||
[_musicPalyer play];
|
||||
// [self setBackGroundPlayingInfo];//锁屏音频信息
|
||||
|
||||
@@ -504,7 +520,7 @@
|
||||
//[self showWaringView];
|
||||
|
||||
//app 前台时收到本地通知showAlert 后台时通知提醒
|
||||
// [[GiGaLocalNotificationManager localNotifiationCenter] sendLocalNotification:@"本地推送" fireTimeInterval:timeInterVal alertAction:@"测试面膜时间" withIdentifier:kLOCALNotifiID_MASKETIMEEND];
|
||||
[[GiGaLocalNotificationManager localNotifiationCenter] sendLocalNotification:@"面膜时间闹钟" fireTimeInterval:timeInterVal alertAction:@"面膜时间" withIdentifier:kLOCALNotifiID_MASKETIMEEND];
|
||||
|
||||
}
|
||||
|
||||
@@ -566,6 +582,8 @@
|
||||
|
||||
#pragma mark 开始测试
|
||||
-(void)testBtnAcion:(UIButton *)btn{
|
||||
|
||||
|
||||
// NSDictionary *dic = @{
|
||||
// @"dryness":@"0.41",
|
||||
// @"drynessPercent":@"41%",
|
||||
@@ -630,7 +648,9 @@
|
||||
#pragma mark 新手引导蒙版消失
|
||||
-(void)guardViewDissmiss{
|
||||
|
||||
//[self showWaringView];
|
||||
self.swipeGaurdimagView.hidden = NO;
|
||||
self.startMaskButton.hidden = NO;
|
||||
[self showWaringView];
|
||||
|
||||
}
|
||||
|
||||
@@ -660,6 +680,8 @@
|
||||
#pragma mark 新手引导
|
||||
-(void)showUserGaurdView{
|
||||
|
||||
self.swipeGaurdimagView.hidden = YES;
|
||||
self.startMaskButton.hidden = YES;
|
||||
UserGuardViewController *userGuardVC = [[UserGuardViewController alloc] init];
|
||||
if (ISIOS8) {
|
||||
userGuardVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
|
||||
@@ -715,7 +737,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.navigationController.navigationBar.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
|
||||
@@ -809,7 +830,6 @@
|
||||
if (user.headImgUrl && ![user.headImgUrl isKindOfClass:[NSNull class]] ) {
|
||||
[self refreshUserIcon:user.headImgUrl];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 去分享
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
#import "SHineLabel.h"
|
||||
|
||||
@interface UserGuardViewController ()
|
||||
|
||||
@property(nonatomic,strong) UIImageView *handimage;
|
||||
@property(nonatomic,strong) UIImageView *upimage;
|
||||
|
||||
@end
|
||||
|
||||
@@ -29,24 +31,39 @@
|
||||
|
||||
-(void)creatUI{
|
||||
|
||||
// UIButton *dismisBtn= [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
// //face
|
||||
// UIImageView *faceimage = [[UIImageView alloc] init];
|
||||
// faceimage.image = [UIImage imageNamed:@"bg_img_face"];
|
||||
// faceimage.contentMode = UIViewContentModeScaleAspectFit;
|
||||
// [self.view addSubview:faceimage];
|
||||
// [faceimage mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
//
|
||||
// [dismisBtn setTitle:@"知道了" forState:UIControlStateNormal];
|
||||
// [dismisBtn setTintColor:[UIColor whiteColor]];
|
||||
// dismisBtn.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
|
||||
// [dismisBtn addTarget:self action:@selector(dismisBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
// [self.view addSubview:dismisBtn];
|
||||
//
|
||||
// [dismisBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.width.mas_equalTo(100);
|
||||
// make.height.mas_equalTo(60);
|
||||
// make.size.mas_equalTo(CGSizeMake(99, 124));
|
||||
// make.centerX.mas_equalTo(self.view.mas_centerX);
|
||||
// make.top.mas_equalTo(self.view.mas_top).offset(200);
|
||||
// make.top.mas_equalTo(self.view.mas_top).offset(91);
|
||||
//
|
||||
// }];
|
||||
//
|
||||
// //mask
|
||||
// UIImageView *maskimage = [[UIImageView alloc] init];
|
||||
// maskimage.image = [UIImage imageNamed:@"mask_img_mask"];
|
||||
// maskimage.contentMode = UIViewContentModeScaleAspectFit;
|
||||
// [self.view addSubview:maskimage];
|
||||
// [maskimage mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.size.mas_equalTo(CGSizeMake(72, 87));
|
||||
// make.centerX.mas_equalTo(self.view.mas_centerX);
|
||||
// make.top.mas_equalTo(self.view.mas_top).offset(254);
|
||||
//
|
||||
// }];
|
||||
|
||||
// UIView *holdbackView = [[UIView alloc] initWithFrame:self.view.bounds];
|
||||
// holdbackView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
|
||||
// [self.view addSubview:holdbackView];
|
||||
|
||||
//usergaurd_uphand
|
||||
UIImageView *upimage = [[UIImageView alloc] init];
|
||||
upimage.image = [UIImage imageNamed:@"userguard_up"];
|
||||
self.upimage = upimage;
|
||||
[self.view addSubview:upimage];
|
||||
[upimage mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.and.with.mas_equalTo(20);
|
||||
@@ -85,6 +102,7 @@
|
||||
}];
|
||||
|
||||
// [self creatnaima];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -100,12 +118,22 @@
|
||||
make.top.mas_equalTo(201);
|
||||
|
||||
}];
|
||||
|
||||
[self->_upimage mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(201);
|
||||
}];
|
||||
|
||||
[self.view layoutIfNeeded];
|
||||
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
[self->_handimage mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(301);
|
||||
|
||||
}];
|
||||
[self->_upimage mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(298);
|
||||
|
||||
}];
|
||||
[self.view layoutIfNeeded];
|
||||
}];
|
||||
|
||||
Reference in New Issue
Block a user