|
@@ -9,11 +9,13 @@
|
|
|
#import "fileSetTableViewCell.h"
|
|
|
#import "fileTransferPathCheckViewController.h"
|
|
|
#import "uploadFileManager.h"
|
|
|
+#import "backupsFileManager.h"
|
|
|
|
|
|
@interface fileTransfeSetViewController ()<UITableViewDelegate,UITableViewDataSource>
|
|
|
@property (nonatomic, strong) UITableView *tableView;
|
|
|
@property (nonatomic, strong) UIView *tailView;
|
|
|
@property (nonatomic, strong) UILabel *uploadFilePathLabel;
|
|
|
+@property (nonatomic, strong) UILabel *backupsFilePathLabel;
|
|
|
@end
|
|
|
|
|
|
@implementation fileTransfeSetViewController
|
|
@@ -25,7 +27,7 @@
|
|
|
[self.toolBar setHidden:YES];
|
|
|
[self.navigationBar setHidden:YES];
|
|
|
[self.navBarBGView setHidden:NO];
|
|
|
- [self.titleLabel setText:NSLocalizedString(@"set_upload_download_tip",nil)];
|
|
|
+ [self.titleLabel setText:NSLocalizedString(@"set_file_Transfer_WWAN_title",nil)];
|
|
|
[self.view setBackgroundColor:HWF5F7FAColor];
|
|
|
|
|
|
[self drawAnyView];
|
|
@@ -36,6 +38,7 @@
|
|
|
[super viewWillAppear:animated];
|
|
|
|
|
|
[self setUploadFilePathLabelTitleFun];
|
|
|
+ [self setBackupsFilePathLabelTitleFun];
|
|
|
}
|
|
|
|
|
|
- (void)drawAnyView{
|
|
@@ -81,20 +84,21 @@
|
|
|
#pragma mark - 懒加载
|
|
|
- (UIView *)tailView{
|
|
|
if (!_tailView) {
|
|
|
- _tailView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 110 +15)];
|
|
|
+ _tailView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 110 +15 + 110)];
|
|
|
|
|
|
UIView *tailBgView = [[UIView alloc] init];
|
|
|
tailBgView.backgroundColor = [UIColor whiteColor];
|
|
|
tailBgView.layer.cornerRadius = 8;
|
|
|
+ tailBgView.tag = 1;
|
|
|
[_tailView addSubview:tailBgView];
|
|
|
|
|
|
- UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickTailViewFun)];
|
|
|
+ UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickTailViewFun:)];
|
|
|
[tailBgView addGestureRecognizer:tap];
|
|
|
|
|
|
[tailBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.left.mas_equalTo(15);
|
|
|
make.right.mas_equalTo(-15);
|
|
|
- make.bottom.mas_equalTo(0);
|
|
|
+ make.height.mas_equalTo(90);
|
|
|
make.top.mas_equalTo(15);
|
|
|
}];
|
|
|
|
|
@@ -138,6 +142,64 @@
|
|
|
}];
|
|
|
|
|
|
[self setUploadFilePathLabelTitleFun];
|
|
|
+
|
|
|
+ //相册备份设置
|
|
|
+ UIView *tailBgView2 = [[UIView alloc] init];
|
|
|
+ tailBgView2.backgroundColor = [UIColor whiteColor];
|
|
|
+ tailBgView2.layer.cornerRadius = 8;
|
|
|
+ tailBgView2.tag = 2;
|
|
|
+ [_tailView addSubview:tailBgView2];
|
|
|
+
|
|
|
+ UITapGestureRecognizer *tap2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickTailViewFun:)];
|
|
|
+ [tailBgView2 addGestureRecognizer:tap2];
|
|
|
+
|
|
|
+ [tailBgView2 mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.height.mas_equalTo(90);
|
|
|
+ make.top.mas_equalTo(tailBgView.mas_bottom).offset(15.0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ UILabel *titleLab2 = [[UILabel alloc] init];
|
|
|
+ titleLab2.text = NSLocalizedString(@"File_backups_path_set",nil);
|
|
|
+ titleLab2.font = [UIFont boldSystemFontOfSize:14.0];
|
|
|
+ titleLab2.textColor = [UIColor hwColor:@"#0A132B" alpha:1.0];
|
|
|
+ [tailBgView2 addSubview:titleLab2];
|
|
|
+
|
|
|
+ [titleLab2 mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(10);
|
|
|
+ make.right.mas_equalTo(-50);
|
|
|
+ make.height.mas_equalTo(20);
|
|
|
+ make.top.mas_equalTo(20);
|
|
|
+ }];
|
|
|
+
|
|
|
+ /*右侧箭头*/
|
|
|
+ UIImageView *rightImage2 = [[UIImageView alloc] init];
|
|
|
+ [rightImage2 setBackgroundColor:[UIColor clearColor]];
|
|
|
+ [rightImage2 setImage:[UIImage imageNamed:@"cell_right_access"]];
|
|
|
+ [tailBgView2 addSubview:rightImage2];
|
|
|
+ [rightImage2 mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.width.mas_equalTo(28);
|
|
|
+ make.right.mas_equalTo(-15.f);
|
|
|
+ make.height.mas_equalTo(28);
|
|
|
+ make.centerY.equalTo(titleLab2.mas_centerY);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _backupsFilePathLabel=[[UILabel alloc] init];
|
|
|
+ //titleLab.text = NSLocalizedString(@"File_upload_path_set",nil);
|
|
|
+ _backupsFilePathLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
+ _backupsFilePathLabel.textColor = [UIColor hwColor:@"#6A6A6A" alpha:1.0];
|
|
|
+ _backupsFilePathLabel.numberOfLines = 0;
|
|
|
+ [tailBgView2 addSubview:_backupsFilePathLabel];
|
|
|
+
|
|
|
+ [_backupsFilePathLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.bottom.mas_equalTo(-10);
|
|
|
+ make.top.mas_equalTo(titleLab2.mas_bottom).offset(10.0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ [self setBackupsFilePathLabelTitleFun];
|
|
|
}
|
|
|
|
|
|
return _tailView;
|
|
@@ -181,8 +243,58 @@
|
|
|
_uploadFilePathLabel.attributedText = noteStr;
|
|
|
}
|
|
|
|
|
|
+- (void)setBackupsFilePathLabelTitleFun
|
|
|
+{
|
|
|
+ NSString * leftStr = NSLocalizedString(@"File_backups_path_way_tip2",nil);
|
|
|
+
|
|
|
+ NSString * backupsDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_backups_default_path)];
|
|
|
+
|
|
|
+ if(!backupsDefaultPath || backupsDefaultPath.length == 0){
|
|
|
+ backupsDefaultPath = Const_default_backups_path;
|
|
|
+ [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_backups_default_path) value:backupsDefaultPath];
|
|
|
+ }
|
|
|
+
|
|
|
+ if([backupsDefaultPath containsString:@"mnt/media_rw"]){
|
|
|
+ backupsDefaultPath = [backupsDefaultPath stringByReplacingOccurrencesOfString:@"mnt/media_rw" withString:NSLocalizedString(@"disk_Extra_default_tip",nil)];
|
|
|
+ }
|
|
|
+ else if([backupsDefaultPath containsString:@"storage/emulated/0"]){
|
|
|
+ backupsDefaultPath = [backupsDefaultPath stringByReplacingOccurrencesOfString:@"storage/emulated/0" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
|
|
|
+ }
|
|
|
+ else if([backupsDefaultPath containsString:@"sdcard"]){
|
|
|
+ backupsDefaultPath = [backupsDefaultPath stringByReplacingOccurrencesOfString:@"sdcard" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
|
|
|
+ }
|
|
|
+
|
|
|
+ NSString * rightStr = backupsDefaultPath;
|
|
|
+
|
|
|
+ NSString *totalStr = [[NSString alloc] initWithFormat:@"%@%@",leftStr,rightStr];
|
|
|
+
|
|
|
+ NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:totalStr];
|
|
|
+
|
|
|
+ NSRange redRange = NSMakeRange([totalStr rangeOfString:rightStr].location, [totalStr rangeOfString:rightStr].length);
|
|
|
+ [noteStr addAttribute:NSForegroundColorAttributeName value:[UIColor hwColor:@"#01B7EA" alpha:0.8] range:redRange];
|
|
|
+ [noteStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12.0] range:redRange];
|
|
|
+ // 设置行间距
|
|
|
+ NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
|
|
+ [paragraphStyle setLineSpacing:5]; //设置行间距
|
|
|
+
|
|
|
+ [noteStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [totalStr length])];
|
|
|
+
|
|
|
+ _backupsFilePathLabel.attributedText = noteStr;
|
|
|
+}
|
|
|
#pragma mark 尾部事件
|
|
|
-- (void)didClickTailViewFun
|
|
|
+- (void)didClickTailViewFun:(UITapGestureRecognizer*)tap
|
|
|
+{
|
|
|
+ UIView *curView = tap.view;
|
|
|
+
|
|
|
+ if(curView.tag == 1){
|
|
|
+ [self gotoSetUploadPathFun];
|
|
|
+ }
|
|
|
+ else if (curView.tag == 2){
|
|
|
+ [self gotoSetBackupsPathFun];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+-(void)gotoSetUploadPathFun
|
|
|
{
|
|
|
uploadFileDataModel* model = [uploadFileManager shareInstance].curUploadFileDataModel;
|
|
|
|
|
@@ -192,7 +304,7 @@
|
|
|
if(Arr && Arr.count== 3){
|
|
|
NSArray *uploadingArr = Arr.firstObject;
|
|
|
if(uploadingArr.count == 0){
|
|
|
- [self gotofileTransferPathCheckVCFun];
|
|
|
+ [self gotofileTransferPathCheckVCFunWithType:1];
|
|
|
}
|
|
|
else{
|
|
|
[[iToast makeText:NSLocalizedString(@"File_upload_set_default_path_tip",nil)] show];
|
|
@@ -232,7 +344,7 @@
|
|
|
}
|
|
|
|
|
|
if(isExtraFileType && !isExtraPathFind){
|
|
|
- [self gotofileTransferPathCheckVCFun];
|
|
|
+ [self gotofileTransferPathCheckVCFunWithType:1];
|
|
|
}
|
|
|
else{
|
|
|
[[iToast makeText:NSLocalizedString(@"File_upload_set_default_path_tip",nil)] show];
|
|
@@ -240,21 +352,96 @@
|
|
|
|
|
|
}
|
|
|
else{
|
|
|
- [self gotofileTransferPathCheckVCFun];
|
|
|
+ [self gotofileTransferPathCheckVCFunWithType:1];
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
-- (void)gotofileTransferPathCheckVCFun
|
|
|
+#pragma mark 设置备份路径相关
|
|
|
+- (void)gotoSetBackupsPathFun
|
|
|
+{
|
|
|
+
|
|
|
+ photosBackupsTaskModel* model = [backupsFileManager shareInstance].curPhotosBackupsTaskMod;
|
|
|
+
|
|
|
+ if(!model){
|
|
|
+ KWeakSelf
|
|
|
+ [photosBackupsTaskModel bg_findAsync:backups_photos_tableName limit:1 orderBy:nil desc:YES complete:^(NSArray * _Nullable array) {
|
|
|
+ mainBlock(^{
|
|
|
+ if(array && array.count > 0){
|
|
|
+ photosBackupsTaskModel *preModel = array.lastObject;
|
|
|
+ if(preModel.curBackupsState == backupsStateUploading
|
|
|
+ ||preModel.curBackupsState == backupsStateSuspend
|
|
|
+ ){
|
|
|
+ [[iToast makeText:NSLocalizedString(@"File_backups_set_default_path_tip",nil)] show];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [self gotofileTransferPathCheckVCFunWithType:2];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [self gotofileTransferPathCheckVCFunWithType:2];
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }];
|
|
|
+
|
|
|
+ }
|
|
|
+ else if(model.curBackupsState == backupsStateUploading
|
|
|
+ //|| model.curBackupsState == backupsStateSuspend
|
|
|
+ )
|
|
|
+ {
|
|
|
+
|
|
|
+ //判断尺寸路径是否存在
|
|
|
+
|
|
|
+ NSString * uploadDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_backups_default_path)];
|
|
|
+
|
|
|
+ BOOL isExtraFileType = NO;
|
|
|
+ BOOL isExtraPathFind = NO;
|
|
|
+ if(uploadDefaultPath){
|
|
|
+ if(![uploadDefaultPath containsString:@"sdcard/"]){
|
|
|
+ isExtraFileType = YES;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(uploadDefaultPath && ksharedAppDelegate.cloudPhoneExtraFileListMod){
|
|
|
+ NSArray*arr = ksharedAppDelegate.cloudPhoneExtraFileListMod.data;
|
|
|
+
|
|
|
+ for (cloudPhoneExtraFileModel*model in arr) {
|
|
|
+ if([uploadDefaultPath containsString:model.extraPath]){
|
|
|
+
|
|
|
+ isExtraPathFind = YES;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if(isExtraFileType && !isExtraPathFind){
|
|
|
+ [self gotofileTransferPathCheckVCFunWithType:2];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [[iToast makeText:NSLocalizedString(@"File_backups_set_default_path_tip",nil)] show];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [self gotofileTransferPathCheckVCFunWithType:2];
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//type 1 上传 2备份
|
|
|
+- (void)gotofileTransferPathCheckVCFunWithType:(NSInteger)type
|
|
|
{
|
|
|
fileTransferPathCheckViewController *vc = [fileTransferPathCheckViewController new];
|
|
|
- vc.curType = 1;
|
|
|
+ vc.curType = type;
|
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
|
}
|
|
|
|
|
|
#pragma mark - 列表委托
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
|
|
- return 1;
|
|
|
+ return 3;
|
|
|
}
|
|
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
@@ -264,7 +451,8 @@
|
|
|
|
|
|
- (fileSetTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
|
|
|
- __block NSInteger row = indexPath.row;
|
|
|
+ //__block NSInteger row = indexPath.row;
|
|
|
+ __block NSInteger section = indexPath.section;
|
|
|
static NSString *identifier = @"fileSetTableViewCell";
|
|
|
|
|
|
fileSetTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
|
|
@@ -283,11 +471,22 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+ UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
|
|
|
+ byRoundingCorners:UIRectCornerAllCorners
|
|
|
+ cornerRadii:CGSizeMake(8, 8)];
|
|
|
+ CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
|
|
|
+ maskLayer.frame = cell.cellBgView.bounds;
|
|
|
+ maskLayer.path = maskPath.CGPath;
|
|
|
+ cell.bgViewLayer = maskLayer;
|
|
|
+ cell.cellBgView.layer.mask = cell.bgViewLayer;
|
|
|
+
|
|
|
+ [cell.lineView setHidden:YES];
|
|
|
|
|
|
- if (row == 0){
|
|
|
- [cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_Cellular",nil)];
|
|
|
+
|
|
|
+ if (section == 0){
|
|
|
+ [cell.titleLabel setText:NSLocalizedString(@"file_Transfer_By_Cellular",nil)];
|
|
|
|
|
|
- BOOL haveOpenMask = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_canUse_Cellular)];
|
|
|
+ BOOL haveOpenMask = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_canUse_Cellular_all)];
|
|
|
[cell.maskSwitch setOn:haveOpenMask];
|
|
|
|
|
|
/*上圆角*/
|
|
@@ -295,39 +494,43 @@
|
|
|
// UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
|
|
|
// byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight
|
|
|
// cornerRadii:CGSizeMake(8, 8)];
|
|
|
- UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
|
|
|
- byRoundingCorners:UIRectCornerAllCorners
|
|
|
- cornerRadii:CGSizeMake(8, 8)];
|
|
|
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
|
|
|
- maskLayer.frame = cell.cellBgView.bounds;
|
|
|
- maskLayer.path = maskPath.CGPath;
|
|
|
- cell.bgViewLayer = maskLayer;
|
|
|
- cell.cellBgView.layer.mask = cell.bgViewLayer;
|
|
|
-
|
|
|
- [cell.lineView setHidden:YES];
|
|
|
-
|
|
|
- }else if (row == 1){
|
|
|
- [cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_battery_level",nil)];
|
|
|
-
|
|
|
- BOOL haveOpenMask = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_battery_level)];
|
|
|
+ }
|
|
|
+ else if (section == 1){
|
|
|
+ [cell.titleLabel setText:NSLocalizedString(@"File_Transfer_background_working",nil)];
|
|
|
+
|
|
|
+ BOOL haveOpenMask = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_working_background)];
|
|
|
+ [cell.maskSwitch setOn:haveOpenMask];
|
|
|
+ }
|
|
|
+ else if (section == 2){
|
|
|
+ [cell.titleLabel setText:NSLocalizedString(@"File_Transfer_full_speed",nil)];
|
|
|
+
|
|
|
+ BOOL haveOpenMask = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_full_speed)];
|
|
|
[cell.maskSwitch setOn:haveOpenMask];
|
|
|
-
|
|
|
- /*下圆角*/
|
|
|
- UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
|
|
|
- byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
|
|
|
- cornerRadii:CGSizeMake(8, 8)];
|
|
|
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
|
|
|
- maskLayer.frame = cell.cellBgView.bounds;
|
|
|
- maskLayer.path = maskPath.CGPath;
|
|
|
- cell.bgViewLayer = maskLayer;
|
|
|
- cell.cellBgView.layer.mask = cell.bgViewLayer;
|
|
|
-
|
|
|
- [cell.lineView setHidden:YES];
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+// else if (row == 1){
|
|
|
+// [cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_battery_level",nil)];
|
|
|
+//
|
|
|
+// BOOL haveOpenMask = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_battery_level)];
|
|
|
+// [cell.maskSwitch setOn:haveOpenMask];
|
|
|
+//
|
|
|
+// /*下圆角*/
|
|
|
+// UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
|
|
|
+// byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
|
|
|
+// cornerRadii:CGSizeMake(8, 8)];
|
|
|
+// CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
|
|
|
+// maskLayer.frame = cell.cellBgView.bounds;
|
|
|
+// maskLayer.path = maskPath.CGPath;
|
|
|
+// cell.bgViewLayer = maskLayer;
|
|
|
+// cell.cellBgView.layer.mask = cell.bgViewLayer;
|
|
|
+//
|
|
|
+// [cell.lineView setHidden:YES];
|
|
|
+// }
|
|
|
|
|
|
KWeakSelf
|
|
|
cell.didClickSwitch = ^(BOOL SwitchOn) {
|
|
|
- [weakSelf didClickSwitchBy:SwitchOn withRow:row];
|
|
|
+ [weakSelf didClickSwitchBy:SwitchOn withRow:section];
|
|
|
};
|
|
|
|
|
|
return cell;
|
|
@@ -337,14 +540,61 @@
|
|
|
return 60;
|
|
|
}
|
|
|
|
|
|
+- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
|
|
+ if(section==2){
|
|
|
+ return 5+10+30;
|
|
|
+ }
|
|
|
+ return 5+10+20;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
|
|
+
|
|
|
+ UIView *tailView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 5+10+20)];
|
|
|
+ if(section==2){
|
|
|
+ tailView.frame = CGRectMake(0, 0, SCREEN_W, 5+10+30);
|
|
|
+ }
|
|
|
+
|
|
|
+ UILabel *lab = [[UILabel alloc] init];
|
|
|
+ lab.font = [UIFont systemFontOfSize:12.0];
|
|
|
+ lab.textColor = [UIColor hwColor:@"666666" alpha:1.0];
|
|
|
+ lab.numberOfLines = 0;
|
|
|
+ //lab.backgroundColor = [UIColor redColor];
|
|
|
+ [tailView addSubview:lab];
|
|
|
+
|
|
|
+ [lab mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.bottom.mas_equalTo(-10);
|
|
|
+ make.top.mas_equalTo(5);
|
|
|
+ }];
|
|
|
+
|
|
|
+ if(section==0){
|
|
|
+ [lab setText:NSLocalizedString(@"File_Transfer_By_Cellular_tip2",nil)];
|
|
|
+ }
|
|
|
+ else if(section==1){
|
|
|
+ [lab setText:NSLocalizedString(@"File_Transfer_background_working_tip",nil)];
|
|
|
+ }
|
|
|
+ else if(section==2){
|
|
|
+ [lab setText:NSLocalizedString(@"File_Transfer_full_speed_tip",nil)];
|
|
|
+ }
|
|
|
+
|
|
|
+ return tailView;
|
|
|
+}
|
|
|
+
|
|
|
- (void)didClickSwitchBy:(BOOL)SwitchOn withRow:(NSInteger)row
|
|
|
{
|
|
|
if(row == 0){
|
|
|
- [HWDataManager setBoolWithKey:stringKeyAddSn(Const_file_Transfe_canUse_Cellular) value:SwitchOn];
|
|
|
+ [HWDataManager setBoolWithKey:stringKeyAddSn(Const_file_Transfe_canUse_Cellular_all) value:SwitchOn];
|
|
|
}
|
|
|
- else{
|
|
|
- [HWDataManager setBoolWithKey:stringKeyAddSn(Const_file_Transfe_battery_level) value:SwitchOn];
|
|
|
+ else if(row == 1){
|
|
|
+ [HWDataManager setBoolWithKey:stringKeyAddSn(Const_file_Transfe_working_background) value:SwitchOn];
|
|
|
+ }
|
|
|
+ else if(row == 2){
|
|
|
+ [HWDataManager setBoolWithKey:stringKeyAddSn(Const_file_Transfe_full_speed) value:SwitchOn];
|
|
|
}
|
|
|
+// else{
|
|
|
+// [HWDataManager setBoolWithKey:stringKeyAddSn(Const_file_Transfe_battery_level) value:SwitchOn];
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
@end
|