修改toastView为新版

This commit is contained in:
wbzhan
2019-08-02 14:27:12 +08:00
parent 21e643a821
commit 374a0fed46
24 changed files with 1085 additions and 588 deletions
@@ -10,7 +10,7 @@
#import <QuartzCore/QuartzCore.h>
#import <AVFoundation/AVFoundation.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import "Toast+UIView.h"
#import "UIView+Toast.h"
#import "AppDelegate.h"
#import "UDManager.h"
#import "Utils.h"
@@ -141,11 +141,11 @@ Strong UIImage *screenShotImage;//截图
}
}
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveRemoteMessage:) name:RECEIVE_REMOTE_MESSAGE object:nil];
[self.bottomToolHView addObViserFromSelf];
self.navigationController.navigationBarHidden = NO;
_isCanAutoOrientation = YES;
//设置默认竖屏
[[AppDelegate sharedDefault] application:[UIApplication sharedApplication] supportedInterfaceOrientationsForWindow:[AppDelegate sharedDefault].window];
[self.view hideToast];
//先判断是否授权
if (!self.contact.isActive) {
@@ -176,23 +176,17 @@ Strong UIImage *screenShotImage;//截图
[self.view makeToast:@"当前网络环境:未知,请检查网络"];
break;
case AFNetworkReachabilityStatusNotReachable:
NSLog(@"无连接");
//self.netStateLabel.text = @"当前网络环境:无网络,请检查网络";
NSLog(@"无连接");
[self.view makeToast:@"当前网络环境:无网络,请检查网络"];
break;
case AFNetworkReachabilityStatusReachableViaWWAN:
//self.netStateLabel.text = @"当前网络环境:3/4G,建议切换到WiFi";
[self.view makeToast:@"当前网络环境:3/4G,建议切换到WiFi"];
NSLog(@"2/3G");
break;
case AFNetworkReachabilityStatusReachableViaWiFi:
NSLog(@"Wifi");
//self.netStateLabel.text = @"当前网络环境:WiFi,请放心观看";
[self.view makeToast:@"当前网络环境:WiFi,请放心观看"];
break;
@@ -639,7 +633,7 @@ Strong UIImage *screenShotImage;//截图
if ([weakSelf.player isPlaying]) {
[weakSelf.view makeToastActivity];
[weakSelf.view makeToastActivity:CSToastPositionCenter];
[[GWP2PClient sharedClient] checkDeviceUpdateWithDeviceID:weakSelf.contact.cameraId devicePassword:weakSelf.contact.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
//检查更新成功之后,处理回调事件
[weakSelf checkUpdateSuccessWithDictionary:dataDictionary];
@@ -648,14 +642,7 @@ Strong UIImage *screenShotImage;//截图
[weakSelf.view makeToast:@"设备已离线"];
}
}else if (tag == 3){
//解除绑定关系
[weakSelf jieBangBtnAction];
}
[weakSelf popAppear];//隐藏弹出框
};
}
@@ -676,17 +663,11 @@ Strong UIImage *screenShotImage;//截图
}
-(void)initPopOver{
[self.view addSubview:self.popView];
BOOL isBind=[self testCameraBindDeviceOrNot];
NSArray *titleImgs =nil;
NSArray *titles=nil;
if (isBind) {
titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"equipment_icon_equipmentupdate",@"ifish_jieBang_device"];
titles=@[@"修改名称",@"删除设备",@"设备升级",@"解除绑定"];
}else{
titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"equipment_icon_equipmentupdate"];
titles=@[@"修改名称",@"删除设备",@"设备升级"];
}
[self.popView loadInfoWithTitle:titles Icons:titleImgs];
titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"equipment_icon_equipmentupdate"];
titles=@[@"修改名称",@"删除设备",@"设备升级"];
[self.popView loadInfoWithTitle:titles Icons:titleImgs];
}
//判断摄像头是否有关系设备
@@ -1118,6 +1099,7 @@ Strong UIImage *screenShotImage;//截图
- (void)screenShot {
// WEAK_SELF;
//todo: 不停截图内存升高
[self.player p2pScreenshot:^(UIImage *screenshot, NSTimeInterval timeInterval) {
dispatch_async(dispatch_get_main_queue(), ^{
UIImage *tempImage = [[UIImage alloc] initWithCGImage:screenshot.CGImage];
@@ -1139,6 +1121,7 @@ Strong UIImage *screenShotImage;//截图
break;
case SWITCH_SCREEN_BUTTON_H_TAG://切换至横屏或者竖屏
{
[self.view hideToast];
if (![self.player isPlaying]) {
return;
}
@@ -1155,9 +1138,7 @@ Strong UIImage *screenShotImage;//截图
withObject:numb];
SEL selector = NSSelectorFromString(@"setOrientation:");
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation setTarget:[UIDevice currentDevice]];
@@ -1184,7 +1165,6 @@ Strong UIImage *screenShotImage;//截图
}
else
{
self.isFullScreen4B3 = !self.isFullScreen4B3;
//设置竖屏
[AppDelegate sharedDefault].canFullScreen = NO;
@@ -1577,10 +1557,8 @@ Strong UIImage *screenShotImage;//截图
}
}
break;
case RET_DO_DEVICE_UPDATE:
{
NSInteger result = [[parameter valueForKey:@"result"] intValue];
@@ -1595,31 +1573,6 @@ Strong UIImage *screenShotImage;//截图
}else if(result==65){
[self.progressMaskView setHidden:YES];
[self.view makeToast:@"升级成功"];
//固件下载成功,并在升级中,弹出一个框
// YMsgBox *yBox = [[YMsgBox alloc] init];
//yBox.yMsgTextField.secureTextEntry = YES;
// [yBox addTarget:self withAction:@selector(isUpdateFirmware:) forEvent:YMsgBoxMsgTypeButtonBeClick];
// yBox.yMsgTitle = [YFonc gtTextWithString:NSLocalizedString(@"firmware_is_being_upgraded", nil)
// withColor:[UIColor blackColor]
// withFont:[UIFont systemFontOfSize:15]
// withAlignment:NSTextAlignmentCenter];
// yBox.yMsgTextFieldBorderColor=RGBA(62,156,254,1.0);
// yBox.yMsgTextFieldBottomLineColor=[UIColor clearColor];
// yBox.yMsgButtonBorderColor=RGBA(211,211,212,1.0);
// UIButton *okBtn= [[UIButton alloc ]init];
// [okBtn setTitleColor:[UIColor colorWithRed:62.0/255.0 green:156.0/255.0 blue:254.0/255.0 alpha:1.0] forState:UIControlStateNormal];
// [okBtn setTitleColor:[UIColor colorWithRed:27.0/255.0 green:122.0/255.0 blue:222.0/255.0 alpha:1.0] forState:UIControlStateHighlighted];
// okBtn.titleLabel.font = [UIFont systemFontOfSize:15];
// [okBtn setTitle:NSLocalizedString(@"i_know",nil) forState:UIControlStateNormal];
// UIButton *cancelBtn= [[UIButton alloc ]init];
// cancelBtn.titleLabel.font = [UIFont systemFontOfSize:15];
// [cancelBtn setTitle:NSLocalizedString(@"no",nil) forState:UIControlStateNormal];
//[cancelBtn setTitleColor:UIColorFromRGB(0x3e9cfe) forState:UIControlStateNormal];
// yBox.yMsgButtons = @[okBtn];
// [yBox showMsgBoxInViewController:self];
}else{
[self.progressMaskView setHidden:YES];
@@ -1631,20 +1584,6 @@ Strong UIImage *screenShotImage;//截图
break;
}
}
#pragma mark - 弹框操作
-(void)isUpdateFirmware:(YMsgBox*)box{
if(box.yMsgButtonIndex == -1){
return;
}else if(box.yMsgButtonIndex == -2){ //隐藏键盘 系统键盘return按钮被点击
[box hideKeyBoard];
}else if(box.yMsgButtonIndex == 0){ //确认按钮被点击
// [self.navigationController popToRootViewControllerAnimated:YES];
[self.navigationController popViewControllerAnimated:YES];
[box hideMsgBox]; //隐藏输入框
}else{ //取消按钮被点击
[box hideMsgBox]; //隐藏输入框
}
}
- (void)ack_receiveRemoteMessage:(NSNotification *)notification{
NSDictionary *parameter = [notification userInfo];
@@ -2736,9 +2675,7 @@ Strong UIImage *screenShotImage;//截图
UIImage *tempImage = [[UIImage alloc] initWithCGImage:image.CGImage];
NSData *imgData = [NSData dataWithData:UIImagePNGRepresentation(tempImage)];
[Utils saveScreenshotFile:imgData];
//[self popLXAdViewWith:tempImage];
dispatch_async(dispatch_get_main_queue(), ^{
//[self.view makeToast:NSLocalizedString(@"screenshot_success", nil)];
[self.view makeToast:@"截图成功,请在图库中查看"];
});
}
@@ -3330,43 +3267,7 @@ GWP2PCallErrorNotSupport,
[self.pressView setHidden:YES];
// [[PAIOUnit sharedUnit] setSpeckState:YES];
}
// //竖屏对讲按钮
// UIButton *talkButtonH = (UIButton *)[self.bottomToolHView viewWithTag:TALK_BUTTON_H_TAG];
// if([AppDelegate sharedDefault].isDoorBellAlarm){//门铃推送
// talkButtonH.selected = YES;
// }else{
// talkButtonH.selected = NO;
// }
// //横屏对讲按钮
// TouchButton *controllerTalkBtn = (TouchButton *)[self.controllBar viewWithTag:CONTROLLER_BTN_TAG_PRESS_TALK];
// //非本地设备
// NSInteger deviceType1 = [AppDelegate sharedDefault].contact.contactType;
// //本地设备
// NSInteger deviceType2 = [[FListManager sharedFList] getType:[[P2PClient sharedClient] callId]];
// if (deviceType1 == CONTACT_TYPE_DOORBELL || deviceType2 == CONTACT_TYPE_DOORBELL) {//支持门铃,点按开关说话
// if([AppDelegate sharedDefault].isDoorBellAlarm){//门铃推送
//
// [controllerTalkBtn setBackgroundImage:[UIImage imageNamed:@"ic_ctl_new_send_audio_p.png"] forState:UIControlStateNormal];
// }
// if (controllerTalkBtn.delegate) {
// controllerTalkBtn.delegate = nil;
// }
// [controllerTalkBtn addTarget:self action:@selector(onControllerBtnPress:) forControlEvents:UIControlEventTouchUpInside];
// }else{
// //不是门铃,则按住说话
// [controllerTalkBtn setBackgroundImage:[UIImage imageNamed:@"ic_ctl_new_send_audio.png"] forState:UIControlStateNormal];
// [controllerTalkBtn removeTarget:self action:@selector(onControllerBtnPress:) forControlEvents:UIControlEventTouchUpInside];
// controllerTalkBtn.delegate = self;
// }
//放在渲染之后
//获取当前被监控帐号的灯状态
//若设备支持灯设备时,则显示开关按钮;若不支持,则隐藏
// NSString *contactId = [[P2PClient sharedClient] callId];
// NSString *contactPassword = [[P2PClient sharedClient] callPassword];
// [[P2PClient sharedClient] getLightStateWithDeviceId:contactId password:contactPassword];
NSString *callId = [[P2PClient sharedClient] callId];
NSString *callPassword = [[P2PClient sharedClient] callPassword];
@@ -4046,7 +3947,7 @@ GWP2PCallErrorNotSupport,
-(void)guanbiShuiBeng{
//manulswitchMSModel 和摄像头sdk 中的类重名报错
//[self.bottomFishHView makeToastActivity];
//[self.bottomFishHView makeToastActivity:CSToastPositionCenter];
XuToLightModel*manulModel=[[XuToLightModel alloc]init];
[[Socketsingleton sharedInstance] setXuToSoketLightDataWith:manulModel];
NSString*switchString=manulModel.description;