| | |
| | | #import "EZDeviceUpgradeViewController.h" |
| | | #import <EZOpenSDKFramework/EZStorageInfo.h> |
| | | #import "Toast+UIView.h" |
| | | #import "HDLEZDetectionTypeViewController.h" |
| | | |
| | | //#import "EzvizDeviceManager.h" |
| | | |
| | |
| | | @property (nonatomic, strong) NSMutableArray *settingList; |
| | | @property (nonatomic, weak) IBOutlet UISwitch *videoSwitch; |
| | | @property (nonatomic, weak) IBOutlet UISwitch *actionSwitch; |
| | | @property (nonatomic, strong) UIImageView *actionRightArrow; |
| | | @property (weak, nonatomic) IBOutlet UISwitch *hdSwitch; |
| | | @property (weak, nonatomic) IBOutlet UISwitch *privacyMaskSwitch; |
| | | @property (weak, nonatomic) IBOutlet UIImageView *rightArrowImg; |
| | |
| | | cell.textLabel.textAlignment = NSTextAlignmentLeft; |
| | | cell.accessoryType = UITableViewCellAccessoryNone; |
| | | cell.accessoryView = nil; |
| | | cell.selectionStyle = UITableViewCellSelectionStyleNone; |
| | | UIView *separatorLine = [[UIView alloc] init]; |
| | | separatorLine.hidden = YES; // 默认隐藏分割线 |
| | | [cell.contentView addSubview:separatorLine]; |
| | | separatorLine.backgroundColor = HDLEZHEXCOLOR(0xECEDEE, 1.); |
| | | [separatorLine mas_makeConstraints:^(MASConstraintMaker *make) { |
| | | make.left.mas_equalTo(cell.contentView.mas_left).offset(16.); |
| | | make.bottom.mas_equalTo(cell.contentView.mas_bottom); |
| | | make.right.mas_equalTo(cell.contentView.mas_right).offset(-16.); |
| | | make.height.mas_equalTo(0.5); |
| | | }]; |
| | | if (indexPath.section == 0) |
| | | { |
| | | [cell.contentView addSubview:self.nameLabel]; |
| | |
| | | [cell.contentView addSubview:self.serialLabel]; |
| | | [self.serialLabel mas_remakeConstraints:^(MASConstraintMaker *make) { |
| | | make.leading.mas_equalTo(@140); |
| | | make.trailing.mas_equalTo(cell.contentView.mas_trailing).offset(-34); |
| | | make.trailing.mas_equalTo(cell.contentView.mas_trailing).offset(-16); |
| | | make.centerY.mas_equalTo(cell.contentView.mas_centerY); |
| | | make.height.mas_equalTo(@20); |
| | | }]; |
| | | self.serialLabel.text = self.deviceInfo.deviceSerial; |
| | | separatorLine.hidden = NO; |
| | | } |
| | | else if (indexPath.section == 5) |
| | | { |
| | | [cell.contentView addSubview:self.hdSwitch]; |
| | | [self.hdSwitch mas_remakeConstraints:^(MASConstraintMaker *make) { |
| | | make.trailing.mas_equalTo(@(-17)); |
| | | make.trailing.mas_equalTo(@(-16)); |
| | | make.centerY.mas_equalTo(cell.contentView.mas_centerY); |
| | | make.width.mas_equalTo(@51); |
| | | make.height.mas_equalTo(@31); |
| | | }]; |
| | | BOOL hdStatus = [[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:@"EZVideoPlayHardDecodingStatus_%@", self.deviceInfo.deviceSerial]]; |
| | | self.hdSwitch.on = hdStatus; |
| | | separatorLine.hidden = NO; |
| | | } |
| | | else if (indexPath.section == 6) |
| | | { |
| | |
| | | } else { // 摄像头 |
| | | [cell.contentView addSubview:self.privacyMaskSwitch]; |
| | | [self.privacyMaskSwitch mas_remakeConstraints:^(MASConstraintMaker *make) { |
| | | make.trailing.mas_equalTo(@(-17)); |
| | | make.trailing.mas_equalTo(@(-16)); |
| | | make.centerY.mas_equalTo(cell.contentView.mas_centerY); |
| | | make.width.mas_equalTo(@51); |
| | | make.height.mas_equalTo(@31); |
| | |
| | | { |
| | | [cell.contentView addSubview:self.rightArrowImg]; |
| | | [self.rightArrowImg mas_remakeConstraints:^(MASConstraintMaker *make) { |
| | | make.trailing.mas_equalTo(@(-17)); |
| | | make.trailing.mas_equalTo(@(-16)); |
| | | make.centerY.mas_equalTo(cell.contentView.mas_centerY); |
| | | make.width.mas_equalTo(@16); |
| | | make.height.mas_equalTo(@16); |
| | |
| | | } |
| | | else if (indexPath.section == 3) |
| | | { |
| | | [cell.contentView addSubview:self.actionSwitch]; |
| | | [self.actionSwitch mas_remakeConstraints:^(MASConstraintMaker *make) { |
| | | make.trailing.mas_equalTo(@(-17)); |
| | | // [cell.contentView addSubview:self.actionSwitch]; |
| | | // [self.actionSwitch mas_remakeConstraints:^(MASConstraintMaker *make) { |
| | | // make.trailing.mas_equalTo(@(-16)); |
| | | // make.centerY.mas_equalTo(cell.contentView.mas_centerY); |
| | | // make.width.mas_equalTo(@51); |
| | | // make.height.mas_equalTo(@31); |
| | | // }]; |
| | | [cell.contentView addSubview:self.actionRightArrow]; |
| | | [self.actionRightArrow mas_remakeConstraints:^(MASConstraintMaker *make) { |
| | | make.trailing.mas_equalTo(@(-16)); |
| | | make.centerY.mas_equalTo(cell.contentView.mas_centerY); |
| | | make.width.mas_equalTo(@51); |
| | | make.height.mas_equalTo(@31); |
| | | make.width.mas_equalTo(@16); |
| | | make.height.mas_equalTo(@16); |
| | | }]; |
| | | separatorLine.hidden = NO; |
| | | } |
| | | else if (indexPath.section == 4) |
| | | { |
| | | [cell.contentView addSubview:self.videoSwitch]; |
| | | [self.videoSwitch mas_remakeConstraints:^(MASConstraintMaker *make) { |
| | | make.trailing.mas_equalTo(@(-17)); |
| | | make.trailing.mas_equalTo(@(-16)); |
| | | make.centerY.mas_equalTo(cell.contentView.mas_centerY); |
| | | make.width.mas_equalTo(@51); |
| | | make.height.mas_equalTo(@31); |
| | | }]; |
| | | separatorLine.hidden = NO; |
| | | } |
| | | else |
| | | { |
| | |
| | | [cell.contentView addSubview:self.currentVersionLabel]; |
| | | [self.currentVersionLabel mas_remakeConstraints:^(MASConstraintMaker *make) { |
| | | make.leading.mas_equalTo(@140); |
| | | make.trailing.mas_equalTo(cell.contentView.mas_trailing).offset(-34); |
| | | make.trailing.mas_equalTo(cell.contentView.mas_trailing).offset(-16); |
| | | make.centerY.mas_equalTo(cell.contentView.mas_centerY); |
| | | make.height.mas_equalTo(@20); |
| | | }]; |
| | | separatorLine.hidden = NO; |
| | | } |
| | | else |
| | | { |
| | | [cell.contentView addSubview:self.nVersionLabel]; |
| | | [self.nVersionLabel mas_remakeConstraints:^(MASConstraintMaker *make) { |
| | | make.leading.mas_equalTo(@140); |
| | | make.trailing.mas_equalTo(cell.contentView.mas_trailing).offset(-34); |
| | | make.trailing.mas_equalTo(cell.contentView.mas_trailing).offset(-16); |
| | | make.centerY.mas_equalTo(cell.contentView.mas_centerY); |
| | | make.height.mas_equalTo(@20); |
| | | }]; |
| | |
| | | else if (indexPath.section == 2 && indexPath.row == 1 && self.updateImageView.hidden == NO) |
| | | { |
| | | [self performSegueWithIdentifier:@"go2Upgrade" sender:nil]; |
| | | }else if (indexPath.section == 3) |
| | | { |
| | | HDLEZDetectionTypeViewController *detectionTypeVC = [[HDLEZDetectionTypeViewController alloc] init]; |
| | | detectionTypeVC.deviceInfo = self.deviceInfo; |
| | | |
| | | [self.navigationController pushViewController:detectionTypeVC animated:YES]; |
| | | } |
| | | else if (indexPath.section == 7) |
| | | { |
| | |
| | | return _privacyMaskButton; |
| | | } |
| | | |
| | | - (UIImageView *)actionRightArrow { |
| | | if (!_actionRightArrow) { |
| | | _actionRightArrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hdl_ez_list_next"]]; |
| | | _actionRightArrow.contentMode = UIViewContentModeScaleAspectFill; |
| | | _actionRightArrow.backgroundColor = UIColor.clearColor; |
| | | } |
| | | return _actionRightArrow; |
| | | } |
| | | |
| | | @end |