Initial commit

This commit is contained in:
ifish
2017-08-15 16:59:01 +08:00
commit bdc83e07ef
5766 changed files with 423223 additions and 0 deletions
@@ -0,0 +1,16 @@
//
// CameraBottomCollectionViewCell.h
// Ifish
//
// Created by imac on 16/11/30.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CameraBottomCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *kindImage;
@property (weak, nonatomic) IBOutlet UILabel *kindName;
@property (weak, nonatomic) IBOutlet UIImageView *hotImg;
@end
@@ -0,0 +1,26 @@
//
// CameraBottomCollectionViewCell.m
// Ifish
//
// Created by imac on 16/11/30.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import "CameraBottomCollectionViewCell.h"
@implementation CameraBottomCollectionViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
/* UIView *shuLine=[[UIView alloc] initWithFrame:CGRectMake(self.frame.size.width - 1,0, 1, self.frame.size.height)];
shuLine.backgroundColor = JWUIColorFromRGB(0xdddddd);
[self addSubview:shuLine];
UIView *hengLine=[[UIView alloc] initWithFrame:CGRectMake(0,self.frame.size.height -1,self.frame.size.width, 1)];
hengLine.backgroundColor = shuLine.backgroundColor = JWUIColorFromRGB(0xdddddd);
[self addSubview:hengLine];*/
}
@end
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="" id="gTV-IL-0wX" customClass="CameraBottomCollectionViewCell">
<rect key="frame" x="0.0" y="0.0" width="117" height="117"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="117" height="117"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1wG-cG-fhN">
<rect key="frame" x="91" y="0.0" width="26" height="27"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="L2T-y1-fgN">
<rect key="frame" x="36" y="26" width="45" height="45"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Y6d-3P-izR">
<rect key="frame" x="8" y="78" width="101" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9Xm-Kq-KPC">
<rect key="frame" x="0.0" y="116" width="117" height="1"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<color key="backgroundColor" red="0.8666666666666667" green="0.8666666666666667" blue="0.8666666666666667" alpha="1" colorSpace="calibratedRGB"/>
</view>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="TvP-nx-YH1">
<rect key="frame" x="116" y="0.0" width="1" height="117"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/>
</view>
</subviews>
</view>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<size key="customSize" width="117" height="129"/>
<connections>
<outlet property="hotImg" destination="1wG-cG-fhN" id="bcZ-uh-qvI"/>
<outlet property="kindImage" destination="L2T-y1-fgN" id="FtG-xz-gXF"/>
<outlet property="kindName" destination="Y6d-3P-izR" id="ihZ-S4-GcR"/>
</connections>
<point key="canvasLocation" x="-159.5" y="9.5"/>
</collectionViewCell>
</objects>
</document>
@@ -0,0 +1,26 @@
//
// CameraBottomHView.h
// Ifish
//
// Created by imac on 16/11/29.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "IfishCameraModel.h"
@protocol CameraBottomHViewDelegate <NSObject>
-(void)cameraBottomHViewdidSelectAt:(NSIndexPath*)indexPath;
@end
@interface CameraBottomHView : UIView
@property (nonatomic, assign) id<CameraBottomHViewDelegate>
cameraHViewDelegate;
@property (strong, nonatomic) MBProgressHUD *progressAlert;
@property (nonatomic,strong) IfishCameraModel *camera;
-(void)removeObViserFromSelf;
-(void)addObViserFromSelf;
@end
@@ -0,0 +1,290 @@
//
// CameraBottomHView.m
// Ifish
//
// Created by imac on 16/11/29.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import "CameraBottomHView.h"
#import "CameraBottomCollectionViewCell.h"
#import "IfishRecVideoViewCell.h"
static NSString *bootomCellIdentifier = @"CameraBottomCollectionViewCell";
static NSString *bootomRecCellIdentifier = @"IfishRecVideoViewCell";
#import "P2PClient.h"
@interface CameraBottomHView () <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>
@property (nonatomic,strong) UICollectionView *collectionView;
@property (nonatomic,strong) UICollectionViewFlowLayout *flowLayout;
@property(nonatomic,strong) NSArray *dataImgArray;
@property(nonatomic,strong) NSArray *dataNameArray;
@property(nonatomic) NSIndexPath *selectIndex;
@end
@implementation CameraBottomHView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
//[self addObViserFromSelf];
[self setCollectionFrame:frame];
}
return self;
}
-(void)dealloc{
//[[NSNotificationCenter defaultCenter] removeObserver:self name:ACK_RECEIVE_REMOTE_MESSAGE object:nil];
// [[NSNotificationCenter defaultCenter] removeObserver:self name:RECEIVE_REMOTE_MESSAGE object:nil];
if (_progressAlert) {
_progressAlert =nil;
}
}
-(void)removeObViserFromSelf{
////录制回放功能打开
// [[NSNotificationCenter defaultCenter] removeObserver:self name:ACK_RECEIVE_REMOTE_MESSAGE object:nil];
//[[NSNotificationCenter defaultCenter] removeObserver:self name:RECEIVE_REMOTE_MESSAGE object:nil];
}
-(void)addObViserFromSelf{
//[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ack_receiveRemoteMessage:) name:ACK_RECEIVE_REMOTE_MESSAGE object:nil];
//[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveRemoteMessage:) name:RECEIVE_REMOTE_MESSAGE object:nil];
}
-(void)setCollectionFrame:(CGRect)frame{
[self initDataArr];
self.flowLayout = [[UICollectionViewFlowLayout alloc] init];
self.flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0,0,self.frame.size.width, self.frame.size.height) collectionViewLayout:self.flowLayout];
self.collectionView.backgroundColor = [UIColor whiteColor];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.showsVerticalScrollIndicator = NO;
[self addSubview:self.collectionView];
UINib *cellNib=[UINib nibWithNibName:@"CameraBottomCollectionViewCell" bundle:nil];
[self.collectionView registerNib:cellNib forCellWithReuseIdentifier:bootomCellIdentifier];
UINib *Reccell=[UINib nibWithNibName:@"IfishRecVideoViewCell" bundle:nil];
[self.collectionView registerNib:Reccell forCellWithReuseIdentifier:bootomRecCellIdentifier];
}
-(void)initDataArr
{
////录制回放功能打开
//_dataImgArray = @[LXImageWithImageName(@"devicename_iocn_screenshots.png"),LXImageWithImageName(@"devicename_iocn_gallery.png"),LXImageWithImageName(@"devicename_iocn_rec.png"),LXImageWithImageName(@"devicename_iocn_playback.png"),LXImageWithImageName(@"devicename_iocn_care.png"),LXImageWithImageName(@"devicename_iocn_look.png"),LXImageWithImageName(@"devicename_iocn_Ilookat.png"),LXImageWithImageName(@"devicename_iocn_look.png"),LXImageWithImageName(@"devicename_iocn_look.png")];
//equipment_iocn_playback
_dataImgArray = @[LXImageWithImageName(@"equipment_iocn_printscreen"),LXImageWithImageName(@"equipment_iocn_gallery"),LXImageWithImageName(@"equipment_iocn_care"),LXImageWithImageName(@"equipment_iocn_look"),LXImageWithImageName(@"equipment_iocn_mylook"),LXImageWithImageName(@"equipment_iocn_share")];
//_dataNameArray = @[@"截图",@"图库",@"录制",@"回放",@"我的看护",@"爱鱼看看",@"我的看看",@"",@""];
_dataNameArray = @[@"截图",@"图库",@"我的看护",@"爱鱼看看",@"我的看看",@"分享爱鱼奇"];
}
#pragma mark - UICollectionViewDataSource
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
//return 9;
return 6;
}
#pragma mark 设置item内容
-(UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
CameraBottomCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:bootomCellIdentifier forIndexPath:indexPath];
if (!cell) {
cell = [[[NSBundle mainBundle] loadNibNamed:bootomCellIdentifier owner:self options:nil]lastObject];
}
//带回放录制
/* if (indexPath.row ==7||indexPath.row ==8)
{
cell.kindImage.hidden = YES;
}
cell.kindImage.image = _dataImgArray[indexPath.row];
cell.kindName.text = _dataNameArray[indexPath.row];
if (indexPath.row ==5) {
cell.hotImg.hidden = NO;
}
*/
cell.kindImage.image = _dataImgArray[indexPath.row];
cell.kindName.text = _dataNameArray[indexPath.row];
if (indexPath.row ==3) {
cell.hotImg.image= LXImageWithImageName(@"devicename_iocn_label");
//cell.hotImg.hidden = NO;
}else if (indexPath.row ==2){
//cell.hotImg.image= LXImageWithImageName(@"devicename_iocn_new");
}
return cell;
}
#pragma 设置item size
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
//留两个像素加line分割线
CGFloat itemW =(self.frame.size.width-2)/3;
return CGSizeMake(itemW,itemW);
}
//距离上下左右的间距
-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{
return UIEdgeInsetsMake(0, 0, 0, 0);
}
-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section
{
//设置最小的列间距
return 1.0f;
}
-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section
{
//设置最小的行间距
return 1.0f;
}
#pragma mark 点击item方法
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
/* if (indexPath.row==2) {
self.selectIndex = indexPath;
self.progressAlert = [[MBProgressHUD alloc] initWithView:self];
[self addSubview:self.progressAlert];
self.progressAlert.mode=MBProgressHUDModeCustomView;
self.progressAlert.customView = [[UIView alloc] init];
self.progressAlert.labelText = [NSString stringWithFormat:@"%@...",NSLocalizedString(@"validating", nil)];
[self.progressAlert show:YES];
[[P2PClient sharedClient]getNpcSettingsWithId:self.camera.cameraId password:self.camera.cameraPass];
}else{
if (self.cameraHViewDelegate) {
[self.cameraHViewDelegate cameraBottomHViewdidSelectAt:indexPath];
}
}
*/
if (self.cameraHViewDelegate) {
[self.cameraHViewDelegate cameraBottomHViewdidSelectAt:indexPath];
}
}
- (void)ack_receiveRemoteMessage:(NSNotification *)notification{
NSDictionary *parameter = [notification userInfo];
int key = [[parameter valueForKey:@"key"] intValue];
int result = [[parameter valueForKey:@"result"] intValue];
if (key != ACK_RET_GET_NPC_SETTINGS) {
return;
}
dispatch_async(dispatch_get_main_queue(), ^{
if (self.progressAlert) {
[self.progressAlert hide:YES];
}
if (result == 0)
{
//if (self.cameraHViewDelegate) {
// [self.cameraHViewDelegate cameraBottomHViewdidSelectAt:self.selectIndex];
// }
if (self.cameraHViewDelegate) {
[[P2PClient sharedClient] getSDCardInfoWithId:self.camera.cameraId password:self.camera.cameraPass];
}
//录像设置
}
else if(result==1)
{
[self makeToast:NSLocalizedString(@"device_password_error", nil)];
}
else if(result==2)
{
[self makeToast:NSLocalizedString(@"net_exception", nil)];
}
else if(result==4)
{
[self makeToast:NSLocalizedString(@"no_permission", nil)];
}
});
}
#pragma mark - receiveRemoteMessage
- (void)receiveRemoteMessage:(NSNotification *)notification
{
NSDictionary *parameter = [notification userInfo];
int key = [[parameter valueForKey:@"key"] intValue];
switch (key) {
case RET_GET_SDCARD_INFO:
{
NSInteger result = [[parameter valueForKey:@"result"] intValue];
dispatch_async(dispatch_get_main_queue(), ^{
if (result == 1) {
if (self.cameraHViewDelegate) {
[self.cameraHViewDelegate cameraBottomHViewdidSelectAt:self.selectIndex];
}
}else{
//sd卡不存在,
[self makeToast:NSLocalizedString(@"no_storage", nil)];
}
});
}
break;
default:
break;
}
}
@end
@@ -0,0 +1,15 @@
//
// CameraRecordViewController.h
// Ifish
//
// Created by imac on 16/12/9.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import "BaseVIewContorller.h"
#import "IfishCameraModel.h"
#import "MBProgressHUD.h"
@interface CameraRecordViewController : BaseVIewContorller
@property (nonatomic,strong) IfishCameraModel *camera;
@property (strong, nonatomic) MBProgressHUD *progressAlert;
@end
@@ -0,0 +1,673 @@
//
// CameraRecordViewController.m
// Ifish
//
// Created by imac on 16/12/9.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import "CameraRecordViewController.h"
#import "P2PClient.h"
#import "IfishCameraRecordfirstCell.h"
#import "IfishCameraRecordSecondCell.h"
#import "IfishCameraRecordThirdCell.h"
#define RECODIEECELL_TIME 911
#define RECODIEECELL_BTN 922
#define RECODIEECELL_SWiTCH 933
static const CGFloat ToastFade = 0.2;
#import "NSTimer+Convenience.h"
#import "IfishCameraRecordFourCell.h"
@interface CameraRecordViewController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong) UITableView *tab;
@property(nonatomic) NSInteger second;
@property(nonatomic) NSInteger minute;
@property(nonatomic,strong) NSTimer*timer;
@property(nonatomic,copy) NSString *timestr;
@property(nonatomic) BOOL isRecording;
@property(nonatomic) NSIndexPath *timerIndex;
@property(nonatomic) NSIndexPath *switchIndex;
@property(nonatomic) NSIndexPath *buttonIndex;
@property(assign) unsigned int remoteRecordState;
//本app 需求模式 非摄像头模式
@property(nonatomic) BOOL isManual;
@end
@implementation CameraRecordViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self addTitleViewWithTitle:@"手动录制"];
_timestr= @"00:00";
_isRecording = NO;
_isManual = NO;
[self creatUI];
self.view.backgroundColor = RGB(242, 242, 242);
}
-(void)goBackAction{
if (_isRecording) {
UIAlertController*ac=[UIAlertController alertControllerWithTitle:@"" message:@"是否结束手动录制" preferredStyle:UIAlertControllerStyleAlert];
[self presentViewController:ac animated:YES completion:nil];
[ac addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction*action){
}]];
[ac addAction:[UIAlertAction actionWithTitle:@"结束" style:UIAlertActionStyleDefault handler:^(UIAlertAction*action){
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF];
[self.navigationController popViewControllerAnimated:YES];
}]];
}else{
[self.navigationController popViewControllerAnimated:YES];
}
}
-(void)creatUI{
self.tab = [[UITableView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height) style:UITableViewStylePlain];
self.tab.delegate = self;
self.tab.dataSource = self;
self.tab.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tab.showsVerticalScrollIndicator = NO;
self.tab.scrollEnabled = NO;
self.tab.backgroundColor = RGB(242, 242, 242);
[self.view addSubview:self.tab];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveRemoteMessage:) name:RECEIVE_REMOTE_MESSAGE object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ack_receiveRemoteMessage:) name:ACK_RECEIVE_REMOTE_MESSAGE object:nil];
[[P2PClient sharedClient] getNpcSettingsWithId:self.camera.cameraId password:self.camera.cameraPass];
// [[P2PClient sharedClient] getSDCardInfoWithId:self.camera.cameraId password:self.camera.cameraPass];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self name:RECEIVE_REMOTE_MESSAGE object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:ACK_RECEIVE_REMOTE_MESSAGE object:nil];
}
#pragma mark - receiveRemoteMessage
- (void)receiveRemoteMessage:(NSNotification *)notification
{
NSDictionary *parameter = [notification userInfo];
int key = [[parameter valueForKey:@"key"] intValue];
switch (key) {
case RET_GET_SDCARD_INFO:
{
NSInteger result = [[parameter valueForKey:@"result"] intValue];
dispatch_async(dispatch_get_main_queue(), ^{
if (result == 1) {
//[self.view makeToast:@"sdk卡可使用"];
//获取状态信息
// [[P2PClient sharedClient] getNpcSettingsWithId:self.camera.cameraId password:self.camera.cameraPass];
if (_isManual) {
if (self.remoteRecordState ==1){
//[self.view makeToast:@"请先关闭自动录制"];
[self showLableAction:@"请先关闭自动录制"];
dispatch_async(dispatch_get_main_queue(), ^{
[self hiddenTostVIew];
});
[self resetTimerlabel];
return ;
}
NSArray *buttonindex =@[self.buttonIndex];
[self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone];
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_ON];
}else{
[self showLableAction:@"请先关闭自动录制"];
dispatch_async(dispatch_get_main_queue(), ^{
[self hiddenTostVIew];
});
[self resetTimerlabel];
}
}else{
//sd卡不存在,
//停止计时
dispatch_async(dispatch_get_main_queue(), ^{
[self hiddenTostVIew];
});
[self resetTimerlabel];
[self.view makeToast:NSLocalizedString(@"no_storage", nil)];
}
});
}
break;
case RET_GET_NPCSETTINGS_PRERECORD: //预录像开关 获取时
{
NSInteger state = [[parameter valueForKey:@"state"] intValue];
NSLog(@"预录像开关 获取时state%ld",(long)state);
}
break;
case RET_SET_NPCSETTINGS_PRERECORD: //预录像开关 设置时
{
NSInteger result = [[parameter valueForKey:@"result"] intValue];
if(result==0){
NSLog(@"预录像开关设置result%ld",(long)result);
}else{
NSLog(@"预录像开关设置result%ld",(long)result);
}
}
break;
case RET_SET_NPCSETTINGS_REMOTE_RECORD:
{
NSInteger result = [[parameter valueForKey:@"result"] integerValue];
if(result==0){
//设置成功主动获取一次状态 刷新
dispatch_async(dispatch_get_main_queue(), ^{
[self hiddenTostVIew];
});
[[P2PClient sharedClient] getNpcSettingsWithId:self.camera.cameraId password:self.camera.cameraPass];
}else{
NSLog(@"设置失败:%li",(long)result);
}
}
break;
case RET_GET_NPCSETTINGS_REMOTE_RECORD:
{
//
NSInteger state = [[parameter valueForKey:@"state"] intValue];
self.remoteRecordState = (unsigned int)state;
if (state ==0) {
dispatch_async(dispatch_get_main_queue(), ^{
[self resetTimerlabel];
});
}else{
}
if (_isManual) {
//手动模式开启不刷新switch按钮状态
return;
}
NSLog(@"获取 remote record state:%li",(long)state);
dispatch_async(dispatch_get_main_queue(), ^{
NSArray *index =@[self.switchIndex];
[self.tab reloadRowsAtIndexPaths:index withRowAnimation:UITableViewRowAnimationNone];
// NSArray *buttonindex =@[self.buttonIndex];
// [self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone];
});
}
case RET_GET_NPCSETTINGS_RECORD_TYPE:
{
NSInteger type = [[parameter valueForKey:@"type"] intValue];
//0手动模式 摄像头模式
NSLog(@"获取录像模式类型type%ld",(long)type);
}
break;
case RET_SET_NPCSETTINGS_RECORD_TYPE:
{
NSInteger result = [[parameter valueForKey:@"result"] intValue];
//0类型设置成功
if (result==0) {
//[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
// password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_ON];
}
NSLog(@"设置录像模式类型result%ld",(long)result);
}
break;
default:
break;
}
}
#pragma mark -ack_receiveRemoteMessage
- (void)ack_receiveRemoteMessage:(NSNotification *)notification{
NSDictionary *parameter = [notification userInfo];
int key = [[parameter valueForKey:@"key"] intValue];
int result = [[parameter valueForKey:@"result"] intValue];
switch (key) {
case ACK_RET_GET_SDCARD_INFO:
{
dispatch_async(dispatch_get_main_queue(), ^{
if(result==1){
[self.view makeToast:NSLocalizedString(@"device_password_error", nil)];
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// usleep(800000);
//
//
// });
}else if(result==2){
DLog(@"resend do device update");
}
});
DLog(@"ACK_RET_GET_SDCARD_INFO:%i",result);
}
break;
case ACK_RET_SET_SDCARD_INFO:
{
dispatch_async(dispatch_get_main_queue(), ^{
if(result==1){
[self.view makeToast:NSLocalizedString(@"device_password_error", nil)];
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// usleep(800000);
// dispatch_async(dispatch_get_main_queue(), ^{
// });
// });
}else if(result==2){
DLog(@"resend do device update");
}
});
}
break;
default:
break;
}
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (section ==2) {
return 2;
}
return 1;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 3;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section ==0 && indexPath.row ==0) {
IfishCameraRecordfirstCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordfirstCell"];
if (!cell) {
cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordfirstCell" owner:self options:nil]lastObject];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}else if (indexPath.section ==2 && indexPath.row ==0){
IfishCameraRecordSecondCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordSecondCell"];
if (!cell) {
cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordSecondCell" owner:self options:nil]lastObject];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.tag = RECODIEECELL_TIME;
self.timerIndex = indexPath;
cell.timeLabe.text = _timestr;
_isRecording ? [cell.timeLabe setTextColor:RGB(51, 51, 51)] : [cell.timeLabe setTextColor:RGB(153, 153, 153)];
[cell cellRecordBViewCorner];
return cell;
}else if (indexPath.section ==2 && indexPath.row ==1){
IfishCameraRecordThirdCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordThirdCell"];
if (!cell) {
cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordThirdCell" owner:self options:nil]lastObject];
}
cell.tag = RECODIEECELL_BTN;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
[cell.recordBtn addTarget:self action:@selector(recordBtnAction:) forControlEvents:UIControlEventTouchUpInside];
if (_isRecording) {
cell.recordBtn.selected = YES;
[cell.recordBtn setBackgroundColor:RGB(255,115,92)];
[cell.recordBtn setTitle:@"结束录制" forState:UIControlStateNormal];
}else{
cell.recordBtn.selected = NO;
[cell.recordBtn setBackgroundColor:RGB(0,184,239)];
[cell.recordBtn setTitle:@"开始录制" forState:UIControlStateNormal];
}
self.buttonIndex =indexPath;
[cell cellSetRecordBtnBackViewCorner];
return cell;
}else if (indexPath.section ==1 && indexPath.row ==0){
self.switchIndex = indexPath;
IfishCameraRecordFourCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishCameraRecordFourCell"];
if (!cell) {
cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishCameraRecordFourCell" owner:self options:nil]lastObject];
}
cell.tag = RECODIEECELL_SWiTCH;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
[cell.zidongSw addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventTouchUpInside];
if (self.remoteRecordState==1) {
[cell.zidongSw setOn:YES];
}else{
[cell.zidongSw setOn:NO];
}
return cell;
}
return nil;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section ==0 && indexPath.row ==0) {
return kScreenSize.width*0.516;
}else if (indexPath.section ==2 && indexPath.row ==0){
return kScreenSize.width*0.357;
}else if (indexPath.section ==1 && indexPath.row ==0){
return 46*KWidth_Scale;
}else if (indexPath.section ==2 && indexPath.row ==1){
return 76*KWidth_Scale;
}
return 0;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
if (section==0) {
return kScreenSize.width*0.213;
}
return 5;
}
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
if (section ==0) {
UIView *sectionV1=[[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width,kScreenSize.width*0.213)];
sectionV1.backgroundColor = RGB(242, 242, 242);
return sectionV1;
}
UIView *sectionV2=[[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width,5)];
sectionV2.backgroundColor = RGB(242, 242, 242);
return sectionV2;
}
#pragma mark - recordBtnAction
-(void)recordBtnAction:(UIButton*)btn{
if (btn.selected) {
[self resetTimerlabel];
_isManual = NO;
//停止录制
[self startTostVIew];
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF];
[self showLableAction:@"录制成功,请在回放中查看"];
}else{
[self startRunTimerlabel];
_isManual = YES;
//开始录制
//获取SDCard状态
[self startTostVIew];
[[P2PClient sharedClient] getSDCardInfoWithId:self.camera.cameraId password:self.camera.cameraPass];
}
}
-(void)startRunTimerlabel
{
//IfishCameraRecordThirdCell *cell=[self.view viewWithTag:RECODIEECELL_BTN];
//cell.recordBtn.selected =YES;
_isRecording=YES;
__weak typeof(self)weakSelf=self;
NSInteger count = 30*60;
//NSInteger count = -1;
//NSInteger count = 60;
weakSelf.timer = [NSTimer scheduledTimerWithTimeInterval:1 count:count callback:^{
weakSelf.second++;
if (weakSelf.second ==60) {
weakSelf.second = 0;
weakSelf.minute++;
}
if (weakSelf.minute ==30) {
weakSelf.minute =0;
weakSelf.second =0;
[self resetTimerlabel];
_isManual = NO;
//停止录制
[self startTostVIew];
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF];
[self showLableAction:@"录制成功,请在回放中查看"];
return ;
}
_timestr= [IfishHelperUtils formatCameraPalybackTime:weakSelf.minute second:weakSelf.second];
NSArray *index =@[self.timerIndex];
[self.tab reloadRowsAtIndexPaths:index withRowAnimation:UITableViewRowAnimationNone];
}];
[[NSRunLoop currentRunLoop] addTimer: weakSelf.timer forMode:NSRunLoopCommonModes];
// NSArray *buttonindex =@[self.buttonIndex];
// [self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone];
}
-(void)resetTimerlabel
{
_isRecording=NO;
if (_timer) {
[_timer unfireTimer];
}
self.minute =0;
self.second =0;
_timestr = @"00:00";
NSArray *index =@[self.timerIndex];
[self.tab reloadRowsAtIndexPaths:index withRowAnimation:UITableViewRowAnimationNone];
NSArray *buttonindex =@[self.buttonIndex];
[self.tab reloadRowsAtIndexPaths:buttonindex withRowAnimation:UITableViewRowAnimationNone];
}
#pragma mark -加载中
-(void)startTostVIew{
self.progressAlert = [[MBProgressHUD alloc] initWithView:self.view];
[self.view addSubview:self.progressAlert];
self.progressAlert.mode=MBProgressHUDModeIndeterminate;
self.progressAlert.customView = [[UIView alloc] init];
//self.progressAlert.labelText = [NSString stringWithFormat:@"%@...",NSLocalizedString(@"validating", nil)];
[self.progressAlert show:YES];
//设置5秒超时
[self.progressAlert hide:YES afterDelay:5];
}
-(void)hiddenTostVIew
{
[self.progressAlert hide:YES];
}
#pragma mark - switchAction:
-(void)switchAction:(UISwitch*)sender
{
IfishCameraRecordFourCell *cell =[self.view viewWithTag:RECODIEECELL_SWiTCH];
UISwitch* swt=(UISwitch*)sender;
cell.zidongSw = swt;
if (_isRecording) {
dispatch_async(dispatch_get_main_queue(), ^{
[cell.zidongSw setOn:NO];
});
//[self.view makeToast:@"请先结束手动录制"];
[self showLableAction:@"请先结束手动录制"];
return;
}
[self startTostVIew];
if (swt.isOn) {
_isManual = YES;
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF];
}else{
_isManual = NO;
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_ON];
}
}
- (void)showLableAction:(NSString *)str{
UILabel *laberAction =[[UILabel alloc]init];
CGFloat labW = 200;
laberAction.frame =CGRectMake(kScreenSize.width/2 - labW/2,kScreenSize.height*3/4 - 50 , labW, 40);
laberAction.clipsToBounds =YES;
laberAction.layer.cornerRadius =5;
laberAction.layer.backgroundColor = [UIColor blackColor].CGColor;
laberAction.alpha =1;
laberAction.text =str;
laberAction.textAlignment =NSTextAlignmentCenter;
//laberAction.backgroundColor =IndicatorBack_COLOR;
laberAction.font=[UIFont systemFontOfSize:14];
laberAction.textColor=[UIColor whiteColor];
[self.view addSubview:laberAction];
[UIView animateWithDuration:ToastFade
delay:0.0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
laberAction.alpha = 1.0;
} completion:^(BOOL finished) {
[UIView animateWithDuration:ToastFade
delay:1.5
options:UIViewAnimationOptionCurveEaseIn
animations:^{
laberAction.alpha = 0.0;
} completion:^(BOOL finished) {
[laberAction removeFromSuperview];
}];
}];
}
@end
@@ -0,0 +1,15 @@
//
// IfishCameraRecordFourCell.h
// Ifish
//
// Created by imac on 16/12/14.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface IfishCameraRecordFourCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UISwitch *zidongSw;
@property (weak, nonatomic) IBOutlet UIView *swbackView;
@end
@@ -0,0 +1,27 @@
//
// IfishCameraRecordFourCell.m
// Ifish
//
// Created by imac on 16/12/14.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import "IfishCameraRecordFourCell.h"
@implementation IfishCameraRecordFourCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.swbackView.layer.masksToBounds = YES;
self.swbackView.layer.cornerRadius= 5;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="IfishCameraRecordFourCell" id="KGk-i7-Jjw" customClass="IfishCameraRecordFourCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="x8V-HM-VhC">
<rect key="frame" x="8" y="0.0" width="304" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="自动录制" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6RC-z3-njS">
<rect key="frame" x="28" y="12" width="70" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ixw-uq-K1e">
<rect key="frame" x="239" y="7" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</switch>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
</tableViewCellContentView>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<outlet property="swbackView" destination="x8V-HM-VhC" id="Q5U-2q-45R"/>
<outlet property="zidongSw" destination="Ixw-uq-K1e" id="D06-ED-dNI"/>
</connections>
<point key="canvasLocation" x="-131" y="19"/>
</tableViewCell>
</objects>
</document>
@@ -0,0 +1,15 @@
//
// IfishCameraRecordSecondCell.h
// Ifish
//
// Created by imac on 16/12/9.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface IfishCameraRecordSecondCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *timeLabe;
@property (weak, nonatomic) IBOutlet UIView *recordBView;
-(void)cellRecordBViewCorner;
@end
@@ -0,0 +1,41 @@
//
// IfishCameraRecordSecondCell.m
// Ifish
//
// Created by imac on 16/12/9.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import "IfishCameraRecordSecondCell.h"
@implementation IfishCameraRecordSecondCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
-(void)layoutSubviews{
[self cellRecordBViewCorner];
}
-(void)cellRecordBViewCorner{
CGRect backRect= CGRectMake(self.recordBView.bounds.origin.x,self.recordBView.bounds.origin.x,kScreenSize.width-8*2,self.recordBView.bounds.size.height);
UIBezierPath *maskPath=[UIBezierPath bezierPathWithRoundedRect:backRect byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(5, 5)];
CAShapeLayer *maskLayer =[[CAShapeLayer alloc] init];
maskLayer.frame = backRect;
maskLayer.path = maskPath.CGPath;
self.recordBView.layer.mask = maskLayer;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="IfishCameraRecordSecondCell" id="KGk-i7-Jjw" customClass="IfishCameraRecordSecondCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="114"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="113"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="U9J-qJ-8Ei">
<rect key="frame" x="8" y="0.0" width="304" height="114"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="手动录制" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Hw8-4N-p6N">
<rect key="frame" x="28" y="8" width="73" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="00:00" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vNh-6S-BrL">
<rect key="frame" x="111" y="52" width="83" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qTh-8y-ZjD">
<rect key="frame" x="71" y="63" width="40" height="1"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.8666666666666667" green="0.8666666666666667" blue="0.8666666666666667" alpha="1" colorSpace="calibratedRGB"/>
</view>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cOO-iJ-iyi">
<rect key="frame" x="193" y="63" width="40" height="1"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="录制时长" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vb6-Zg-A1h">
<rect key="frame" x="71" y="84" width="165" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
</tableViewCellContentView>
<color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<outlet property="recordBView" destination="U9J-qJ-8Ei" id="bYB-DI-vVf"/>
<outlet property="timeLabe" destination="vNh-6S-BrL" id="PA7-iw-eSm"/>
</connections>
<point key="canvasLocation" x="-39" y="-8"/>
</tableViewCell>
</objects>
</document>
@@ -0,0 +1,16 @@
//
// IfishCameraRecordThirdCell.h
// Ifish
//
// Created by imac on 16/12/9.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface IfishCameraRecordThirdCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIButton *recordBtn;
@property (weak, nonatomic) IBOutlet UIView *recordBtnBackView;
-(void)cellSetRecordBtnBackViewCorner;
@end
@@ -0,0 +1,43 @@
//
// IfishCameraRecordThirdCell.m
// Ifish
//
// Created by imac on 16/12/9.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import "IfishCameraRecordThirdCell.h"
@implementation IfishCameraRecordThirdCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.recordBtn.layer.masksToBounds = YES;
self.recordBtn.layer.cornerRadius = 7.5;
}
-(void)layoutSubviews{
[self cellSetRecordBtnBackViewCorner];
}
-(void)cellSetRecordBtnBackViewCorner{
CGRect backRect= CGRectMake(self.recordBtnBackView.bounds.origin.x,self.recordBtnBackView.bounds.origin.x,kScreenSize.width-8*2,self.recordBtnBackView.bounds.size.height);
UIBezierPath *maskPath=[UIBezierPath bezierPathWithRoundedRect:backRect byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)];
CAShapeLayer *maskLayer =[[CAShapeLayer alloc] init];
maskLayer.frame = backRect;
maskLayer.path = maskPath.CGPath;
self.recordBtnBackView.layer.mask = maskLayer;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="IfishCameraRecordThirdCell" id="KGk-i7-Jjw" customClass="IfishCameraRecordThirdCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="76"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="75"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3U0-TC-W9Z">
<rect key="frame" x="8" y="0.0" width="304" height="61"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZOk-qY-ZY4">
<rect key="frame" x="42" y="8" width="220" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.0" green="0.72156862745098038" blue="0.93725490196078431" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<state key="normal" title="开启录制"/>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
</tableViewCellContentView>
<color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<outlet property="recordBtn" destination="ZOk-qY-ZY4" id="GDN-hG-Ho4"/>
<outlet property="recordBtnBackView" destination="3U0-TC-W9Z" id="C1A-Kv-XDH"/>
</connections>
<point key="canvasLocation" x="-58" y="50"/>
</tableViewCell>
</objects>
</document>
@@ -0,0 +1,14 @@
//
// IfishCameraRecordfirstCell.h
// Ifish
//
// Created by imac on 16/12/9.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface IfishCameraRecordfirstCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *PlayRecTipsImg;
@end
@@ -0,0 +1,26 @@
//
// IfishCameraRecordfirstCell.m
// Ifish
//
// Created by imac on 16/12/9.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import "IfishCameraRecordfirstCell.h"
@implementation IfishCameraRecordfirstCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.PlayRecTipsImg.image = LXImageWithImageName(@"transcribe_tips");
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
@end
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="IfishCameraRecordfirstCell" id="KGk-i7-Jjw" customClass="IfishCameraRecordfirstCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="165"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="164"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5j8-bf-57T">
<rect key="frame" x="8" y="8" width="304" height="156"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
</subviews>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
</tableViewCellContentView>
<connections>
<outlet property="PlayRecTipsImg" destination="5j8-bf-57T" id="92m-II-656"/>
</connections>
<point key="canvasLocation" x="-400" y="32.5"/>
</tableViewCell>
</objects>
</document>
@@ -0,0 +1,18 @@
//
// IfishRecVideoViewCell.h
// Ifish
//
// Created by imac on 16/12/6.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface IfishRecVideoViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *recViewImg;
@property (weak, nonatomic) IBOutlet UILabel *recordTimeLabel;
@property (weak, nonatomic) IBOutlet UILabel *recordName;
@end
@@ -0,0 +1,18 @@
//
// IfishRecVideoViewCell.m
// Ifish
//
// Created by imac on 16/12/6.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import "IfishRecVideoViewCell.h"
@implementation IfishRecVideoViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
@end
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="IfishRecVideoViewCell">
<rect key="frame" x="0.0" y="0.0" width="117" height="129"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="117" height="129"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NYz-nG-qrM">
<rect key="frame" x="33" y="33" width="50" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sUh-n0-Eyb">
<rect key="frame" x="8" y="89" width="101" height="16"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="38m-1E-9J7">
<rect key="frame" x="17" y="80" width="82" height="10"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</view>
<color key="backgroundColor" red="0.20784313725490194" green="0.20784313725490194" blue="0.20784313725490194" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<outlet property="recViewImg" destination="NYz-nG-qrM" id="mdM-Ob-6Jp"/>
<outlet property="recordName" destination="sUh-n0-Eyb" id="G0w-Xg-i9C"/>
<outlet property="recordTimeLabel" destination="38m-1E-9J7" id="5t4-aQ-MuA"/>
</connections>
<point key="canvasLocation" x="26.5" y="51.5"/>
</collectionViewCell>
</objects>
</document>