|
@@ -16,6 +16,7 @@
|
|
|
@property (nonatomic, strong) UIView *tailView;
|
|
|
@property (nonatomic, strong) UILabel *uploadFilePathLabel;
|
|
|
@property (nonatomic, strong) UILabel *backupsFilePathLabel;
|
|
|
+@property (nonatomic, strong) UILabel *saveBoxFilePathLabel;
|
|
|
@end
|
|
|
|
|
|
@implementation fileTransfeSetViewController
|
|
@@ -84,7 +85,7 @@
|
|
|
#pragma mark - 懒加载
|
|
|
- (UIView *)tailView{
|
|
|
if (!_tailView) {
|
|
|
- _tailView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 110 +15 + 110)];
|
|
|
+ _tailView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 90 + 15 + 90 + 15 + 90 + 15)];
|
|
|
|
|
|
UIView *tailBgView = [[UIView alloc] init];
|
|
|
tailBgView.backgroundColor = [UIColor whiteColor];
|
|
@@ -200,6 +201,64 @@
|
|
|
}];
|
|
|
|
|
|
[self setBackupsFilePathLabelTitleFun];
|
|
|
+
|
|
|
+ ////相册备份设置
|
|
|
+ UIView *tailBgView3 = [[UIView alloc] init];
|
|
|
+ tailBgView3.backgroundColor = [UIColor whiteColor];
|
|
|
+ tailBgView3.layer.cornerRadius = 8;
|
|
|
+ tailBgView3.tag = 3;
|
|
|
+ [_tailView addSubview:tailBgView3];
|
|
|
+
|
|
|
+ UITapGestureRecognizer *tap3 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickTailViewFun:)];
|
|
|
+ [tailBgView3 addGestureRecognizer:tap3];
|
|
|
+
|
|
|
+ [tailBgView3 mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.height.mas_equalTo(90);
|
|
|
+ make.top.mas_equalTo(tailBgView2.mas_bottom).offset(15.0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ UILabel *titleLab3 = [[UILabel alloc] init];
|
|
|
+ titleLab3.text = NSLocalizedString(@"File_save_to_box_path_set",nil);
|
|
|
+ titleLab3.font = [UIFont boldSystemFontOfSize:14.0];
|
|
|
+ titleLab3.textColor = [UIColor hwColor:@"#0A132B" alpha:1.0];
|
|
|
+ [tailBgView3 addSubview:titleLab3];
|
|
|
+
|
|
|
+ [titleLab3 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 *rightImage3 = [[UIImageView alloc] init];
|
|
|
+ [rightImage3 setBackgroundColor:[UIColor clearColor]];
|
|
|
+ [rightImage3 setImage:[UIImage imageNamed:@"cell_right_access"]];
|
|
|
+ [tailBgView3 addSubview:rightImage3];
|
|
|
+ [rightImage3 mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.width.mas_equalTo(28);
|
|
|
+ make.right.mas_equalTo(-15.f);
|
|
|
+ make.height.mas_equalTo(28);
|
|
|
+ make.centerY.equalTo(titleLab3.mas_centerY);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _saveBoxFilePathLabel=[[UILabel alloc] init];
|
|
|
+ //titleLab.text = NSLocalizedString(@"File_upload_path_set",nil);
|
|
|
+ _saveBoxFilePathLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
+ _saveBoxFilePathLabel.textColor = [UIColor hwColor:@"#6A6A6A" alpha:1.0];
|
|
|
+ _saveBoxFilePathLabel.numberOfLines = 0;
|
|
|
+ [tailBgView3 addSubview:_saveBoxFilePathLabel];
|
|
|
+
|
|
|
+ [_saveBoxFilePathLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.bottom.mas_equalTo(-10);
|
|
|
+ make.top.mas_equalTo(titleLab3.mas_bottom).offset(10.0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ [self setSaveFileToBoxPathLabelTitleFun];
|
|
|
}
|
|
|
|
|
|
return _tailView;
|
|
@@ -281,6 +340,47 @@
|
|
|
|
|
|
_backupsFilePathLabel.attributedText = noteStr;
|
|
|
}
|
|
|
+
|
|
|
+#pragma mark 设置 盒子的接收路径
|
|
|
+- (void)setSaveFileToBoxPathLabelTitleFun
|
|
|
+{
|
|
|
+ NSString * leftStr = NSLocalizedString(@"File_upload_path_way",nil);
|
|
|
+
|
|
|
+ NSString * boxSaveDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_box_save_default_path)];
|
|
|
+
|
|
|
+ if(!boxSaveDefaultPath || boxSaveDefaultPath.length == 0){
|
|
|
+ boxSaveDefaultPath = Const_default_save_path;
|
|
|
+ [HWDataManager setStringWithKey:stringKeyAddSn(Const_box_save_default_path) value:boxSaveDefaultPath];
|
|
|
+ }
|
|
|
+
|
|
|
+ if([boxSaveDefaultPath containsString:@"mnt/media_rw"]){
|
|
|
+ boxSaveDefaultPath = [boxSaveDefaultPath stringByReplacingOccurrencesOfString:@"mnt/media_rw" withString:NSLocalizedString(@"disk_Extra_default_tip",nil)];
|
|
|
+ }
|
|
|
+ else if([boxSaveDefaultPath containsString:@"storage/emulated/0"]){
|
|
|
+ boxSaveDefaultPath = [boxSaveDefaultPath stringByReplacingOccurrencesOfString:@"storage/emulated/0" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
|
|
|
+ }
|
|
|
+ else if([boxSaveDefaultPath containsString:@"sdcard"]){
|
|
|
+ boxSaveDefaultPath = [boxSaveDefaultPath stringByReplacingOccurrencesOfString:@"sdcard" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
|
|
|
+ }
|
|
|
+
|
|
|
+ NSString * rightStr = boxSaveDefaultPath;
|
|
|
+
|
|
|
+ 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])];
|
|
|
+
|
|
|
+ _saveBoxFilePathLabel.attributedText = noteStr;
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark 尾部事件
|
|
|
- (void)didClickTailViewFun:(UITapGestureRecognizer*)tap
|
|
|
{
|
|
@@ -292,6 +392,9 @@
|
|
|
else if (curView.tag == 2){
|
|
|
[self gotoSetBackupsPathFun];
|
|
|
}
|
|
|
+ else if (curView.tag == 3){
|
|
|
+ [self gotofileTransferPathCheckVCFunWithType:3];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-(void)gotoSetUploadPathFun
|