Initial commit
This commit is contained in:
BIN
Binary file not shown.
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// CameraViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/7/8.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface CameraViewCell : UICollectionViewCell
|
||||
@property(strong,nonatomic) UIImageView *imageView;
|
||||
//cell中的描述文本;
|
||||
@property(strong,nonatomic) UIButton *descbutton;
|
||||
//cell右上角的删除按钮;
|
||||
@property(nonatomic,strong)UIButton *deleteButton;
|
||||
|
||||
@property (nonatomic,strong) UIView *point;
|
||||
@end
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// CameraViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/7/8.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CameraViewCell.h"
|
||||
|
||||
@implementation CameraViewCell
|
||||
- (instancetype)initWithFrame:(CGRect)frame{
|
||||
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
//这里需要初始化ImageView;
|
||||
|
||||
self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0,self.frame.size.height - 30 , self.frame.size.height - 30 )];
|
||||
self.imageView.backgroundColor = [UIColor colorWithRed:64/255.0f green:64/255.0 blue:64/255.0f alpha:1.0];
|
||||
[self.imageView setUserInteractionEnabled:true];
|
||||
|
||||
self.descbutton = [[UIButton alloc] initWithFrame:CGRectMake(0, self.frame.size.height - 20 , self.frame.size.width - 26, 24)];
|
||||
[self.descbutton.titleLabel setTextColor:[UIColor whiteColor]];
|
||||
[self.descbutton.titleLabel setFont:[UIFont systemFontOfSize:12]];
|
||||
self.descbutton.titleLabel.numberOfLines = 0;
|
||||
[self.descbutton.titleLabel sizeToFit];
|
||||
self.descbutton.titleLabel.textAlignment = NSTextAlignmentLeft;
|
||||
|
||||
self.point = [[UIView alloc] initWithFrame:CGRectMake(-15, self.frame.size.height - 20 + 6 , 10, 10)];
|
||||
self.point.backgroundColor = [UIColor greenColor];
|
||||
[self.point.layer setBorderWidth:0.1];
|
||||
[self.point.layer setCornerRadius:5];
|
||||
[self.point setClipsToBounds:YES];
|
||||
//先设置不可见
|
||||
[self.point setHidden:YES];
|
||||
|
||||
self.deleteButton = [[UIButton alloc] initWithFrame:CGRectMake(self.frame.size.width - 50, 0, 30, 30)];
|
||||
[self.deleteButton setImage:[UIImage imageNamed:@"device_del"] forState:UIControlStateNormal];
|
||||
//先设置不可见;
|
||||
[self.deleteButton setHidden:YES];
|
||||
|
||||
|
||||
[self addSubview:self.descbutton];
|
||||
[self addSubview:self.imageView];
|
||||
[self addSubview:self.deleteButton];
|
||||
[self addSubview:self.point];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// CellModel.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/28.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface CellModel : NSObject
|
||||
|
||||
//定义cell中的图片;
|
||||
@property(nonatomic,copy) NSString *cellImage;
|
||||
//定义cell中的描述文字;
|
||||
@property(nonatomic,copy) NSString *cellDesc;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// CellModel.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/28.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CellModel.h"
|
||||
|
||||
@implementation CellModel
|
||||
|
||||
@end
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// CollectionReusableView.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/28.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface CollectionReusableView : UICollectionReusableView
|
||||
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
|
||||
@end
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// CollectionReusableView.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/28.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CollectionReusableView.h"
|
||||
|
||||
@implementation CollectionReusableView
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
|
||||
self = [super initWithFrame:frame];
|
||||
|
||||
if (self) {
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, kScreenSize.width, 40)];
|
||||
self.titleLabel.textColor = [UIColor whiteColor];
|
||||
self.titleLabel.textAlignment = NSTextAlignmentLeft;
|
||||
[self addSubview:self.titleLabel];
|
||||
|
||||
}
|
||||
return self;
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// CollectionheaderView.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/8/2.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface CollectionheaderView : UICollectionReusableView
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@end
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// CollectionheaderView.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/8/2.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CollectionheaderView.h"
|
||||
|
||||
@implementation CollectionheaderView
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
|
||||
self = [super initWithFrame:frame];
|
||||
|
||||
if (self) {
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, kScreenSize.width, 40)];
|
||||
self.titleLabel.textColor = [UIColor whiteColor];
|
||||
self.titleLabel.textAlignment = NSTextAlignmentLeft;
|
||||
[self addSubview:self.titleLabel];
|
||||
|
||||
}
|
||||
return self;
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// ConnectInfoCollectionModel.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/29.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface ConnectInfoCollectionModel : NSObject
|
||||
|
||||
@property (nonatomic,copy) NSString *IconImage;
|
||||
|
||||
@property (nonatomic,copy) NSString *title;
|
||||
|
||||
@property (nonatomic,copy) NSString *connect;
|
||||
|
||||
@end
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// ConnectInfoCollectionModel.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/29.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ConnectInfoCollectionModel.h"
|
||||
|
||||
@implementation ConnectInfoCollectionModel
|
||||
|
||||
@end
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// SetNameTextViewController.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/30.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseVIewContorller.h"
|
||||
#import "DeviceModel.h"
|
||||
#import "IfishCameraModel.h"
|
||||
typedef void (^NameFieldBlock)(NSString *);
|
||||
|
||||
@interface SetNameTextViewController : BaseVIewContorller
|
||||
|
||||
|
||||
@property (nonatomic,copy) NSString *name;
|
||||
|
||||
@property (nonatomic,copy) NameFieldBlock NameWithBlock ;
|
||||
|
||||
@property(nonatomic,strong) DeviceModel* device;
|
||||
@property(nonatomic,strong) IfishCameraModel* cameraModel;
|
||||
|
||||
@property (nonatomic) NSInteger deviceType;
|
||||
|
||||
|
||||
@end
|
||||
+297
@@ -0,0 +1,297 @@
|
||||
//
|
||||
// SetNameTextViewController.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/30.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SetNameTextViewController.h"
|
||||
#import "AFNetworking.h"
|
||||
#import "MyMD5.h"
|
||||
#import "Toast+UIView.h"
|
||||
|
||||
@interface SetNameTextViewController ()
|
||||
|
||||
@property (nonatomic,strong) UIButton *tureButton;
|
||||
@property (nonatomic,strong) UIBarButtonItem *backItem;
|
||||
@property (nonatomic,strong) UITextField *field;
|
||||
@property (nonatomic,copy) NSString *nameWithText;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation SetNameTextViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self creatNavRightButton];
|
||||
[self creatTextField];
|
||||
self.view.backgroundColor = COLOR_MIAN;
|
||||
if (self.deviceType ==0) {
|
||||
|
||||
self.title = @"修改水族箱名称";
|
||||
|
||||
}else if (self.deviceType ==1){
|
||||
|
||||
self.title = @"修改摄像头名称";
|
||||
}
|
||||
|
||||
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName :[UIColor whiteColor]};
|
||||
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textAlignment = NSTextAlignmentLeft;
|
||||
|
||||
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
-(void)creatNavRightButton{
|
||||
|
||||
_tureButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_tureButton.frame = CGRectMake(kScreenSize.width - 100, 10, 60, 60);
|
||||
|
||||
[_tureButton setTitle:@"确定" forState:UIControlStateNormal];
|
||||
|
||||
[_tureButton setBackgroundImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
|
||||
|
||||
if (self.deviceType ==0) {
|
||||
|
||||
[_tureButton addTarget: self action: @selector(goBackActionClick) forControlEvents: UIControlEventTouchUpInside];
|
||||
|
||||
}else if (self.deviceType ==1){
|
||||
|
||||
[_tureButton addTarget: self action: @selector(cameraSureAction) forControlEvents: UIControlEventTouchUpInside];
|
||||
}
|
||||
|
||||
|
||||
_backItem=[[UIBarButtonItem alloc]initWithCustomView:_tureButton];
|
||||
self.navigationItem.rightBarButtonItem=_backItem;
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)creatTextField{
|
||||
|
||||
self.field = [[UITextField alloc] initWithFrame:CGRectMake(20, 84, kScreenSize.width - 40, 60)];
|
||||
self.field.backgroundColor = [UIColor whiteColor];
|
||||
self.field.layer.cornerRadius = 10;
|
||||
self.field.text = self.name;
|
||||
self.field.textColor = [UIColor blackColor];
|
||||
self.field.placeholder = @"请修改名字";
|
||||
|
||||
//NSLog(@"--执行了TextField--%@",self.field.text);
|
||||
self.field.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
//[self.field becomeFirstResponder];
|
||||
|
||||
|
||||
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(25, 84 + 60 + 20, 200, 20)];
|
||||
label.text = @"给设备取个名字吧!" ;
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.textAlignment = NSTextAlignmentLeft;
|
||||
label.font = [UIFont systemFontOfSize:14];
|
||||
|
||||
[self.view addSubview:label];
|
||||
[self.view addSubview:self.field];
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)goBackActionClick{
|
||||
[_field resignFirstResponder];
|
||||
if (self.name!=0) {
|
||||
AFHTTPRequestOperationManager*mannager=[AFHTTPRequestOperationManager manager];
|
||||
mannager.responseSerializer=[AFHTTPResponseSerializer serializer];
|
||||
NSMutableDictionary * para = [NSMutableDictionary dictionary];
|
||||
NSArray*deviceArry=[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"];
|
||||
|
||||
|
||||
NSString *priId=self.device.deviceId;
|
||||
;
|
||||
NSString*userId=self.device.userId;
|
||||
|
||||
[para setValue:priId forKey:@"priId.deviceId"];
|
||||
[para setValue:userId forKey:@"priId.userId"];
|
||||
[para setValue: _field.text forKey:@"showName"];
|
||||
|
||||
if (_field.text.length <= 6) {
|
||||
[mannager POST:kUpdateDeviceUser parameters:para success:^(AFHTTPRequestOperation *operation, id responseObject) {
|
||||
if (responseObject) {
|
||||
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
|
||||
NSLog(@"result:%@",resultDic[@"result"]);
|
||||
if ([resultDic[@"result"] isEqualToString:@"100"]) {
|
||||
|
||||
[self.view makeToast:@"修改成功"];
|
||||
|
||||
NSString *strName =[NSString stringWithFormat:@"%@",self.field.text];
|
||||
|
||||
|
||||
NSMutableArray *newDeviceArr =[[NSMutableArray alloc] init];
|
||||
|
||||
if (self.NameWithBlock) {
|
||||
|
||||
self.NameWithBlock(strName);
|
||||
}
|
||||
[_field resignFirstResponder];
|
||||
//修改数据库中对应设备名称
|
||||
|
||||
for (DeviceModel *model in deviceArry) {
|
||||
|
||||
if ([model.deviceId isEqual:self.device.deviceId]) {
|
||||
|
||||
model.showName = strName;
|
||||
|
||||
}
|
||||
[newDeviceArr addObject:model];
|
||||
|
||||
}
|
||||
|
||||
[[DataCenter defaultDtacenter] setValue:newDeviceArr forKey:@"deviceInfo"];
|
||||
|
||||
|
||||
[self performSelector:@selector(popLastView) withObject:self afterDelay:1.6];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}else if ([resultDic[@"result"] isEqualToString:@"101"]){
|
||||
[self showTitle:@"" messsage:@"获取失败"];
|
||||
}else if ([resultDic[@"result"] isEqualToString:@"301"]){
|
||||
|
||||
[self showTitle:@"" messsage:@"请求验证失败,请重新登陆"];
|
||||
}else if ([resultDic[@"result"] isEqualToString:@"302"]){
|
||||
|
||||
[self showTitle:@"" messsage:@"请求被舍弃,未执行"];
|
||||
|
||||
}else if ([resultDic[@"result"] isEqualToString:@"207"]){
|
||||
|
||||
[self showTitle:@"" messsage:@"设备已解绑请推出后台重新登录"];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
|
||||
|
||||
[self showTitle:@"" messsage:@"请求异常"];
|
||||
}];
|
||||
|
||||
}else{
|
||||
[self showTitle:@"" messsage:@"名称不能大于6个字"];
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
[self showTitle:@"" messsage:@"设备名称不能为空"];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(void)cameraSureAction{
|
||||
//注意判断方法以及提示窗展示不同。
|
||||
[_field resignFirstResponder];
|
||||
|
||||
if (_field.text.length == 0) {
|
||||
|
||||
[self.view makeToast:@"设备名称不能为空"];
|
||||
return;
|
||||
|
||||
}
|
||||
if (_field.text.length > 6) {
|
||||
|
||||
[self.view makeToast:@"名称不能大于6个字"];
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
AFHTTPRequestOperationManager*mannager=[AFHTTPRequestOperationManager manager];
|
||||
mannager.responseSerializer=[AFHTTPResponseSerializer serializer];
|
||||
NSMutableDictionary * para = [NSMutableDictionary dictionary];
|
||||
NSArray*camerArr=[[DataCenter defaultDtacenter]valueForKey:@"cameraArr"];
|
||||
//IfishCameraModel*camdel=[camerArr objectAtIndex:self.changeDeviceNameIndex];
|
||||
UserModel*userModel=[[DataCenter defaultDtacenter]valueForKey:@"UserLogIn"];
|
||||
|
||||
[para setValue:self.cameraModel.cameraId forKey:@"cameraId"];
|
||||
[para setValue:userModel.userId forKey:@"userId"];
|
||||
[para setValue: _field.text forKey:@"showName"];
|
||||
|
||||
[mannager POST:IfishUpdateCameraUser parameters:para success:^(AFHTTPRequestOperation *operation, id responseObject) {
|
||||
if (responseObject) {
|
||||
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
|
||||
NSLog(@"result:%@",resultDic[@"result"]);
|
||||
if ([resultDic[@"result"] isEqualToString:@"100"]) {
|
||||
[self.view makeToast:@"修改成功"];
|
||||
NSString *strName =[NSString stringWithFormat:@"%@",self.field.text];
|
||||
|
||||
NSMutableArray *newcameraArr =[[NSMutableArray alloc] init];
|
||||
if (self.NameWithBlock) {
|
||||
|
||||
self.NameWithBlock(strName);
|
||||
}
|
||||
//归档的弊端 改值麻烦
|
||||
for (IfishCameraModel*camdel in camerArr) {
|
||||
|
||||
if ([camdel.cameraId isEqual:self.cameraModel.cameraId]) {
|
||||
|
||||
camdel.showName = strName;
|
||||
|
||||
}
|
||||
[newcameraArr addObject:camdel];
|
||||
|
||||
}
|
||||
|
||||
[[DataCenter defaultDtacenter] setValue:newcameraArr forKey:@"cameraArr"];
|
||||
[self performSelector:@selector(popLastView) withObject:self afterDelay:1.6];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}else if ([resultDic[@"result"] isEqualToString:@"101"]){
|
||||
|
||||
[self.view makeToast:@"获取失败"];
|
||||
|
||||
}else if ([resultDic[@"result"] isEqualToString:@"301"]){
|
||||
[self.view makeToast:@"请求验证失败,请重新登陆"];
|
||||
|
||||
}else if ([resultDic[@"result"] isEqualToString:@"302"]){
|
||||
|
||||
[self.view makeToast:@"请求被舍弃,未执行"];
|
||||
|
||||
|
||||
}else if ([resultDic[@"result"] isEqualToString:@"207"]){
|
||||
[self.view makeToast:@"设备已解绑请推出后台重新登录"];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
|
||||
|
||||
[self.view makeToast:@"请求异常"];
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
-(void)popLastView{
|
||||
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
@end
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
+18
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// emptyInfoCollectionViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/31.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface emptyInfoCollectionViewCell : UICollectionViewCell
|
||||
|
||||
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *emptyImage;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *emptyLabel;
|
||||
@end
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// emptyInfoCollectionViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/31.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "emptyInfoCollectionViewCell.h"
|
||||
|
||||
@implementation emptyInfoCollectionViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
@end
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
</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="emptyInfoCollectionViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="255" height="247"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
|
||||
<rect key="frame" x="0.0" y="0.0" width="255" height="247"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="暂时没有消息,快绑定自己的水族箱吧!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dbN-D6-lqq">
|
||||
<rect key="frame" x="100" y="150" width="55" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="VVr-mV-hJX"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="light_right_fragment.png" translatesAutoresizingMaskIntoConstraints="NO" id="oe2-1Z-LgR">
|
||||
<rect key="frame" x="102" y="100" width="50" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="50" id="RyN-0J-n3Y"/>
|
||||
<constraint firstAttribute="height" constant="50" id="bxB-Yf-nSX"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<constraints>
|
||||
<constraint firstItem="oe2-1Z-LgR" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="100" id="GHw-x7-Od2"/>
|
||||
<constraint firstAttribute="bottom" secondItem="oe2-1Z-LgR" secondAttribute="bottom" constant="100" id="KFb-uX-81w"/>
|
||||
<constraint firstItem="oe2-1Z-LgR" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="KMs-Ad-Wmq"/>
|
||||
<constraint firstItem="dbN-D6-lqq" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="100" id="Qrl-sq-IIK"/>
|
||||
<constraint firstAttribute="trailing" secondItem="oe2-1Z-LgR" secondAttribute="trailing" constant="100" id="Y4m-w6-Wk2"/>
|
||||
<constraint firstItem="oe2-1Z-LgR" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="100" id="qMh-Mu-JeG"/>
|
||||
<constraint firstItem="dbN-D6-lqq" firstAttribute="top" secondItem="oe2-1Z-LgR" secondAttribute="bottom" id="s1n-OH-RMg"/>
|
||||
<constraint firstItem="oe2-1Z-LgR" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="100" id="uxI-5z-BZH"/>
|
||||
<constraint firstAttribute="trailing" secondItem="dbN-D6-lqq" secondAttribute="trailing" constant="100" id="wqJ-rJ-KTw"/>
|
||||
</constraints>
|
||||
<size key="customSize" width="255" height="247"/>
|
||||
<variation key="default">
|
||||
<mask key="constraints">
|
||||
<exclude reference="GHw-x7-Od2"/>
|
||||
<exclude reference="KFb-uX-81w"/>
|
||||
<exclude reference="Y4m-w6-Wk2"/>
|
||||
<exclude reference="qMh-Mu-JeG"/>
|
||||
</mask>
|
||||
</variation>
|
||||
<connections>
|
||||
<outlet property="emptyImage" destination="oe2-1Z-LgR" id="PJD-gM-CRc"/>
|
||||
<outlet property="emptyLabel" destination="dbN-D6-lqq" id="gOI-2w-9aT"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="204.5" y="371.5"/>
|
||||
</collectionViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="light_right_fragment.png" width="82" height="82"/>
|
||||
</resources>
|
||||
</document>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// infoCollectionViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/29.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface infoCollectionViewCell : UICollectionViewCell
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *IconImage;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *TitleLabel;
|
||||
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *ContentLabel;
|
||||
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *line;
|
||||
|
||||
@end
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// infoCollectionViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/29.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "infoCollectionViewCell.h"
|
||||
|
||||
@implementation infoCollectionViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
// Initialization code
|
||||
self.line.backgroundColor=[UIColor colorWithRed:211/225.0f green:211/225.0f blue:211/225.0f alpha:1];
|
||||
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.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="infoCollectionViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="308" height="94"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
|
||||
<rect key="frame" x="0.0" y="0.0" width="308" height="94"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_jpush_offline.png" translatesAutoresizingMaskIntoConstraints="NO" id="aG7-jD-Ghi">
|
||||
<rect key="frame" x="10" y="12" width="10" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="10" id="MMo-f2-aro"/>
|
||||
<constraint firstAttribute="height" constant="16" id="RM8-WP-3ra"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="您的家庭鱼缸温度已经严重低于安全范围,请尽快设置给鱼儿们温暖!" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iQJ-qW-JnU">
|
||||
<rect key="frame" x="25" y="28" width="268" height="56"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="温度预警" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="40l-rx-cTK">
|
||||
<rect key="frame" x="25" y="10" width="100" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="OQH-56-GOz"/>
|
||||
<constraint firstAttribute="width" constant="100" id="w2m-F7-Lct"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="C1u-hD-PO5">
|
||||
<rect key="frame" x="18" y="92" width="270" height="1"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="a0g-FM-im8"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<constraints>
|
||||
<constraint firstItem="aG7-jD-Ghi" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="12" id="DFe-4p-igz"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="C1u-hD-PO5" secondAttribute="trailing" constant="12" id="FJS-yk-c4Z"/>
|
||||
<constraint firstItem="iQJ-qW-JnU" firstAttribute="top" secondItem="aG7-jD-Ghi" secondAttribute="bottom" id="Rcz-eJ-1B0"/>
|
||||
<constraint firstItem="iQJ-qW-JnU" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="25" id="afZ-Xc-mey"/>
|
||||
<constraint firstItem="aG7-jD-Ghi" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="10" id="cEt-6E-DRf"/>
|
||||
<constraint firstItem="40l-rx-cTK" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="10" id="cSw-je-jBY"/>
|
||||
<constraint firstItem="40l-rx-cTK" firstAttribute="leading" secondItem="aG7-jD-Ghi" secondAttribute="trailing" constant="5" id="d7B-Xz-Vq2"/>
|
||||
<constraint firstItem="C1u-hD-PO5" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leadingMargin" constant="10" id="j3B-vp-A6o"/>
|
||||
<constraint firstAttribute="trailing" secondItem="iQJ-qW-JnU" secondAttribute="trailing" constant="15" id="jok-nf-wYH"/>
|
||||
<constraint firstAttribute="bottomMargin" secondItem="C1u-hD-PO5" secondAttribute="bottom" constant="-7" id="qYk-ND-Fud"/>
|
||||
<constraint firstAttribute="bottom" secondItem="iQJ-qW-JnU" secondAttribute="bottom" constant="10" id="roc-kU-BsF"/>
|
||||
</constraints>
|
||||
<size key="customSize" width="308" height="94"/>
|
||||
<connections>
|
||||
<outlet property="ContentLabel" destination="iQJ-qW-JnU" id="WXY-4j-Zbb"/>
|
||||
<outlet property="IconImage" destination="aG7-jD-Ghi" id="w2M-M8-BZ2"/>
|
||||
<outlet property="TitleLabel" destination="40l-rx-cTK" id="5Qh-af-44x"/>
|
||||
<outlet property="line" destination="C1u-hD-PO5" id="Bep-I8-8Os"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-677" y="313"/>
|
||||
</collectionViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="ic_jpush_offline.png" width="30" height="48"/>
|
||||
</resources>
|
||||
</document>
|
||||
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
+16
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>offline_push</key>
|
||||
<string>ic_jpush_offline.png</string>
|
||||
<key>qu_reply</key>
|
||||
<string>ic_jpush_msg.png</string>
|
||||
<key>remove_device</key>
|
||||
<string>ic_jpush_offline.png</string>
|
||||
<key>wendu_warn</key>
|
||||
<string>ic_jpush_wendu.png</string>
|
||||
<key>remind_water</key>
|
||||
<string>ic_jpush_changewater.png</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// rightDeviceCollectionViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/28.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface rightDeviceCollectionViewCell : UICollectionViewCell
|
||||
|
||||
//cell中的图片;
|
||||
@property(strong,nonatomic) UIImageView *imageView;
|
||||
//cell中的描述文本;
|
||||
@property(strong,nonatomic) UIButton *descbutton;
|
||||
//cell右上角的删除按钮;
|
||||
@property(nonatomic,strong)UIButton *deleteButton;
|
||||
|
||||
@property (nonatomic,strong) UIView *point;
|
||||
|
||||
@end
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// rightDeviceCollectionViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by ifish7-ios on 16/3/28.
|
||||
// Copyright © 2016年 imac. All rights reserved.
|
||||
//
|
||||
|
||||
#import "rightDeviceCollectionViewCell.h"
|
||||
|
||||
@implementation rightDeviceCollectionViewCell
|
||||
|
||||
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame{
|
||||
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
//这里需要初始化ImageView;
|
||||
|
||||
self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 0,self.frame.size.height - 30 , self.frame.size.height - 30 )];
|
||||
self.imageView.backgroundColor = [UIColor colorWithRed:64/255.0f green:64/255.0 blue:64/255.0f alpha:1.0];
|
||||
[self.imageView setUserInteractionEnabled:true];
|
||||
|
||||
self.descbutton = [[UIButton alloc] initWithFrame:CGRectMake(13, self.frame.size.height - 20 , self.frame.size.width - 26, 24)];
|
||||
[self.descbutton.titleLabel setTextColor:[UIColor whiteColor]];
|
||||
[self.descbutton.titleLabel setFont:[UIFont systemFontOfSize:12]];
|
||||
self.descbutton.titleLabel.numberOfLines = 0;
|
||||
[self.descbutton.titleLabel sizeToFit];
|
||||
self.descbutton.titleLabel.textAlignment = NSTextAlignmentLeft;
|
||||
|
||||
self.point = [[UIView alloc] initWithFrame:CGRectMake(-15, self.frame.size.height - 20 + 6 , 10, 10)];
|
||||
self.point.backgroundColor = [UIColor greenColor];
|
||||
[self.point.layer setBorderWidth:0.1];
|
||||
[self.point.layer setCornerRadius:5];
|
||||
[self.point setClipsToBounds:YES];
|
||||
//先设置不可见
|
||||
[self.point setHidden:YES];
|
||||
|
||||
self.deleteButton = [[UIButton alloc] initWithFrame:CGRectMake(self.frame.size.width - 50, 0, 30, 30)];
|
||||
[self.deleteButton setImage:[UIImage imageNamed:@"device_del"] forState:UIControlStateNormal];
|
||||
//先设置不可见;
|
||||
[self.deleteButton setHidden:YES];
|
||||
|
||||
|
||||
[self addSubview:self.descbutton];
|
||||
[self addSubview:self.imageView];
|
||||
//[self addSubview:self.deleteButton];
|
||||
//[self addSubview:self.point];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user