Browse Source

1.备份相关逻辑补充

huangxiaodong 1 year ago
parent
commit
3e18ad0837

+ 8 - 0
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -163,6 +163,8 @@
 		6B0582862B0457C400D37290 /* uploadFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0582842B0457C400D37290 /* uploadFileManager.m */; };
 		6B0582892B045E0B00D37290 /* uploadFileDataModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B0582872B045E0B00D37290 /* uploadFileDataModel.h */; };
 		6B05828A2B045E0B00D37290 /* uploadFileDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0582882B045E0B00D37290 /* uploadFileDataModel.m */; };
+		6B1FBD222B43DAD200926382 /* backupsSetViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B1FBD202B43DAD200926382 /* backupsSetViewController.h */; };
+		6B1FBD232B43DAD200926382 /* backupsSetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B1FBD212B43DAD200926382 /* backupsSetViewController.m */; };
 		6B2170882B1444CC00656670 /* allVersionView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B2170862B1444CC00656670 /* allVersionView.h */; };
 		6B2170892B1444CC00656670 /* allVersionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B2170872B1444CC00656670 /* allVersionView.m */; };
 		6B21708C2B14BDAA00656670 /* couldphoneSysInfoModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B21708A2B14BDAA00656670 /* couldphoneSysInfoModel.h */; };
@@ -558,6 +560,8 @@
 		6B0582842B0457C400D37290 /* uploadFileManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileManager.m; sourceTree = "<group>"; };
 		6B0582872B045E0B00D37290 /* uploadFileDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileDataModel.h; sourceTree = "<group>"; };
 		6B0582882B045E0B00D37290 /* uploadFileDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileDataModel.m; sourceTree = "<group>"; };
+		6B1FBD202B43DAD200926382 /* backupsSetViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = backupsSetViewController.h; sourceTree = "<group>"; };
+		6B1FBD212B43DAD200926382 /* backupsSetViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = backupsSetViewController.m; sourceTree = "<group>"; };
 		6B2170862B1444CC00656670 /* allVersionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = allVersionView.h; sourceTree = "<group>"; };
 		6B2170872B1444CC00656670 /* allVersionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = allVersionView.m; sourceTree = "<group>"; };
 		6B21708A2B14BDAA00656670 /* couldphoneSysInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = couldphoneSysInfoModel.h; sourceTree = "<group>"; };
@@ -1325,6 +1329,8 @@
 				6B5B60642B3D5FD8009A2AE2 /* fileTransfeSetViewController.m */,
 				6B5B606C2B3D7E3B009A2AE2 /* fileTransferPathCheckViewController.h */,
 				6B5B606D2B3D7E3B009A2AE2 /* fileTransferPathCheckViewController.m */,
+				6B1FBD202B43DAD200926382 /* backupsSetViewController.h */,
+				6B1FBD212B43DAD200926382 /* backupsSetViewController.m */,
 			);
 			path = fileTransfeSet;
 			sourceTree = "<group>";
@@ -1821,6 +1827,7 @@
 				6B7B65582AD9227700BE8CB3 /* PlayerViewController+otherDelegate.h in Headers */,
 				6B7272572B0DAF7600C03F87 /* couldPhoneBaseInfoModel.h in Headers */,
 				186820212AB98600005702A6 /* QRCodeScanViewController.h in Headers */,
+				6B1FBD222B43DAD200926382 /* backupsSetViewController.h in Headers */,
 				6B8FF6B92B04E19600800981 /* uploadFileRecordheadView.h in Headers */,
 				18FCE5482AD15E750020F623 /* PlayerViewController+AppDelegate.h in Headers */,
 				6B72724B2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.h in Headers */,
@@ -2144,6 +2151,7 @@
 				18F9CAFB2ABD35C4003FF71A /* ModifyPWDFirstViewController.m in Sources */,
 				183AE6542A8A2CF000B11CB0 /* AFURLResponseSerialization.m in Sources */,
 				A0295B1227ED938B009C5D8B /* HWHistoryViewController.m in Sources */,
+				6B1FBD232B43DAD200926382 /* backupsSetViewController.m in Sources */,
 				A003F6D127D8425C00715CBF /* iTools.m in Sources */,
 				18EC79DD2ABC109F0084836A /* SetPWDSecondViewController.m in Sources */,
 				183AE6012A89CE3C00B11CB0 /* NSArray+JSONModel.m in Sources */,

+ 2 - 1
创维盒子/双子星云手机/AppDelegate/Config/Const.h

@@ -91,7 +91,8 @@ UIKIT_EXTERN NSString *const Const_file_Transfe_canUse_Cellular;
 
 /*标记是否低电量上传下载*/
 UIKIT_EXTERN NSString *const Const_file_Transfe_battery_level;
-
+/*相册备份是否开启*/
+UIKIT_EXTERN NSString *const Const_photo_backups_state;
 @end
 
 NS_ASSUME_NONNULL_END

+ 3 - 0
创维盒子/双子星云手机/AppDelegate/Config/Const.m

@@ -88,4 +88,7 @@ NSString *const Const_file_Transfe_canUse_Cellular  = @"file_Transfe_canUse_Cell
 /*标记是否低电量上传下载*/
 NSString *const Const_file_Transfe_battery_level  = @"file_Transfe_battery_level";
 
+/*相册备份是否开启*/
+NSString *const Const_photo_backups_state = @"photo_backups_state";
+
 @end

+ 35 - 3
创维盒子/双子星云手机/Class/Set/MySetViewController.m

@@ -29,6 +29,7 @@
 #import "inputPWDViewController.h"
 #import "fileTransferPopView.h"
 #import "fileTransfeSetViewController.h"
+#import "backupsSetViewController.h"
 
 @interface MySetViewController ()<HelpDownScrollViewDelegate,UITableViewDelegate,UITableViewDataSource,ComontAlretViewControllerDelegate>
 {
@@ -124,7 +125,7 @@
 - (void)didClickUploadFileByTag:(NSInteger)tag
 {
     HLog(@"hhh %ld",tag);
-    
+    KWeakSelf
     switch (tag) {
         case 1:{
                 fileTransfeSetViewController *nextVC = [fileTransfeSetViewController new];
@@ -143,7 +144,7 @@
             }
             [self.view.window addSubview:fileTransferPopV];
             
-            KWeakSelf
+            
             fileTransferPopV.didClickBut = ^(NSInteger tag) {
                 [weakSelf gotoFileTransferFunBy:tag];
             };
@@ -156,18 +157,44 @@
                 nextVC.isCheckPwdType = YES;
                 [self.navigationController pushViewController:nextVC animated:YES];
                 
-                KWeakSelf
+                
                 nextVC.didInputRightPwdFun = ^{
                     [weakSelf gotoPrivacyModeVCFun];
                 };
             }
             break;
+        case 5:
+        {
+            backupsSetViewController *nextVC = [backupsSetViewController new];
+            [self.navigationController pushViewController:nextVC animated:YES];
+            
+        }
+            break;
         case 10:
             {
                 TipsQRCodeForChangeDeviceViewController *vc = [[TipsQRCodeForChangeDeviceViewController alloc] init];
                 [self.navigationController pushViewController:vc animated:YES];
             }
             break;
+        case 7:
+            {
+                /*弹窗提示关闭备份*/
+                ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"File_backups_set_close_title",nil)
+                                                                                                 msg:NSLocalizedString(@"File_backups_set_close_tip",nil)
+                                                                                            imageStr:nil
+                                                                                         cancelTitle:NSLocalizedString(@"other_cancel",nil)
+                                                                                             okTitle:NSLocalizedString(@"other_comment_ok",nil) isOkBtnHighlight:YES
+                                                                                          didClickOk:^{
+                    [weakSelf gotoClosePhotosBackupsFun];
+                } didClickCancel:^{
+                   
+                }];
+                nextVC.modalPresentationStyle = UIModalPresentationCustom;
+                [self presentViewController:nextVC animated:YES completion:^{
+                    nextVC.view.superview.backgroundColor = [UIColor clearColor];
+                }];
+            }
+            break;
         case 11:
             {
                 /*弹窗提示重启*/
@@ -220,6 +247,11 @@
 
 }
 
+- (void)gotoClosePhotosBackupsFun
+{
+    [[self customTableHeadView] closeImageBackupsFun];
+}
+
 #pragma mark 点击图片或者视频
 - (void)gotoFileTransferFunBy:(NSInteger)tag
 {

+ 16 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/backupsSetViewController.h

@@ -0,0 +1,16 @@
+//
+//  backupsSetViewController.h
+//  隐私保护
+//
+//  Created by xd h on 2024/1/2.
+//
+
+#import "BaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface backupsSetViewController : BaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 256 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/backupsSetViewController.m

@@ -0,0 +1,256 @@
+//
+//  backupsSetViewController.m
+//  隐私保护
+//
+//  Created by xd h on 2024/1/2.
+//
+
+#import "backupsSetViewController.h"
+
+#import "fileSetTableViewCell.h"
+#import "fileTransferPathCheckViewController.h"
+
+@interface backupsSetViewController ()<UITableViewDelegate,UITableViewDataSource>
+@property (nonatomic, strong) UITableView *tableView;
+@property (nonatomic, strong) UIView *tailView;
+@property (nonatomic, strong) UILabel *uploadFilePathLabel;
+@end
+
+@implementation backupsSetViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    [self.toolBar setHidden:YES];
+    [self.navigationBar setHidden:YES];
+    [self.navBarBGView setHidden:NO];
+    [self.titleLabel setText:NSLocalizedString(@"File_backups_path_set",nil)];
+    [self.view setBackgroundColor:HWF5F7FAColor];
+    
+    [self drawAnyView];
+}
+
+- (void)drawAnyView{
+    
+    [self.view addSubview:self.tableView];
+    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+    }];
+    
+    self.tableView.tableFooterView = [self tailView];
+}
+
+#pragma mark - 懒加载
+- (UITableView *)tableView{
+    if (!_tableView) {
+        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
+        _tableView.delegate = self;
+        _tableView.dataSource = self;
+        _tableView.showsVerticalScrollIndicator = NO;
+        _tableView.showsHorizontalScrollIndicator = NO;
+//        _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
+        [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
+        [_tableView setSeparatorColor:[UIColor clearColor]];
+        [_tableView setBackgroundColor:[UIColor clearColor]];
+        [_tableView setTableFooterView:[UIView new]];
+        [_tableView setBounces:YES];
+        
+        _tableView.scrollEnabled = NO;
+        
+        if (@available(iOS 15.0, *)) {
+            _tableView.sectionHeaderTopPadding = 0;
+        }
+        
+    }
+    
+    return _tableView;
+}
+
+
+#pragma mark - 懒加载
+- (UIView *)tailView{
+    if (!_tailView) {
+        _tailView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 140 +15)];
+        
+        UIView *tailBgView = [[UIView alloc] init];
+        tailBgView.backgroundColor = [UIColor whiteColor];
+        tailBgView.layer.cornerRadius = 8;
+        [_tailView addSubview:tailBgView];
+        
+        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.height.mas_equalTo(60);
+            make.top.mas_equalTo(15);
+        }];
+        
+        UILabel *titleLab = [[UILabel alloc] init];
+        titleLab.text = NSLocalizedString(@"File_backups_path_set",nil);
+        titleLab.font = [UIFont boldSystemFontOfSize:14.0];
+        titleLab.textColor = [UIColor hwColor:@"#0A132B" alpha:1.0];
+        [tailBgView addSubview:titleLab];
+        
+        [titleLab 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 *rightImage = [[UIImageView alloc] init];
+        [rightImage setBackgroundColor:[UIColor clearColor]];
+        [rightImage setImage:[UIImage imageNamed:@"cell_right_access"]];
+        [tailBgView addSubview:rightImage];
+        [rightImage mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.width.mas_equalTo(28);
+            make.right.mas_equalTo(-15.f);
+            make.height.mas_equalTo(28);
+            make.centerY.equalTo(titleLab.mas_centerY);
+        }];
+        
+        _uploadFilePathLabel=[[UILabel alloc] init];
+        //titleLab.text = NSLocalizedString(@"File_upload_path_set",nil);
+        _uploadFilePathLabel.font = [UIFont systemFontOfSize:12.0];
+        _uploadFilePathLabel.textColor = [UIColor hwColor:@"#6A6A6A" alpha:1.0];
+        _uploadFilePathLabel.numberOfLines = 0;
+        [_tailView addSubview:_uploadFilePathLabel];
+        
+        [_uploadFilePathLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(15);
+            make.right.mas_equalTo(-15);
+            make.bottom.mas_equalTo(-10);
+            make.top.mas_equalTo(tailBgView.mas_bottom).offset(10.0);
+        }];
+        
+        [self setUploadFilePathLabelTitleFun];
+    }
+    
+    return _tailView;
+}
+
+- (void)setUploadFilePathLabelTitleFun
+{
+    NSString * leftStr = NSLocalizedString(@"File_backups_path_way_tip",nil);
+    NSString * rightStr = @"我的空间/来自【手机设备名称】的相册备份";
+    
+    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])];
+    
+    _uploadFilePathLabel.attributedText = noteStr;
+}
+
+#pragma mark 尾部事件
+- (void)didClickTailViewFun
+{
+    fileTransferPathCheckViewController *vc = [fileTransferPathCheckViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+}
+
+#pragma mark - 列表委托
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
+    return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return 2;
+}
+
+- (fileSetTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
+    
+    __block NSInteger row = indexPath.row;
+    static NSString *identifier = @"fileSetTableViewCell";
+    
+    fileSetTableViewCell * cell =  [tableView dequeueReusableCellWithIdentifier:identifier];
+    cell.selectionStyle = UITableViewCellSelectionStyleNone;
+    if (!cell){
+        cell = [[fileSetTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
+        [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
+        [cell setBackgroundColor:[UIColor clearColor]];
+        [cell setAccessoryType:(UITableViewCellAccessoryNone)];
+        
+        [cell.bgViewLayer removeFromSuperlayer];
+        [cell.titleLabel2 setHidden:YES];
+        [cell.rightImage setHidden:YES];
+        [cell.lineView setHidden:NO];
+        [cell.maskSwitch setHidden:NO];
+        
+    }
+    
+    
+    if (row == 0){
+        [cell.titleLabel setText:NSLocalizedString(@"File_backups_set_Cellular",nil)];
+        
+        BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_file_Transfe_canUse_Cellular];
+        [cell.maskSwitch setOn:haveOpenMask];
+        
+        /*上圆角*/
+        //设置部分圆角  贝塞尔曲线
+        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
+                                                       byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight
+                                                             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;
+    }else if (row == 1){
+        [cell.titleLabel setText:NSLocalizedString(@"File_backups_set_battery_level",nil)];
+ 
+        BOOL haveOpenMask = [HWDataManager getBoolWithKey: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];
+    };
+    
+    return cell;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
+    return 60;
+}
+
+- (void)didClickSwitchBy:(BOOL)SwitchOn withRow:(NSInteger)row
+{
+    if(row == 0){
+        [HWDataManager setBoolWithKey:Const_file_Transfe_canUse_Cellular value:SwitchOn];
+    }
+    else{
+        [HWDataManager setBoolWithKey:Const_file_Transfe_battery_level value:SwitchOn];
+    }
+}
+
+@end
+

+ 3 - 0
创维盒子/双子星云手机/Class/Set/view/mySetHeadView.h

@@ -10,7 +10,10 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface mySetHeadView : UIView
+@property (nonatomic,strong)UILabel *imageBackupsLabel;
+@property (nonatomic,strong)UIButton *imageBackupsButton;
 
+- (void)closeImageBackupsFun;
 //
 @property (nonatomic,copy) void (^didClickBut)(NSInteger tag);
 @end

+ 51 - 21
创维盒子/双子星云手机/Class/Set/view/mySetHeadView.m

@@ -11,7 +11,6 @@
 {
     UIView *imageBackupsBgView;
     UILabel *imageBackupsLabel;
-    UIButton *imageBackupsButton;
 }
 @end
 
@@ -21,7 +20,7 @@
     self = [super initWithFrame:frame];
     
     [self drawAnyView];
-    
+    [self setBackupsStateFun];
     return self;
 }
 
@@ -340,32 +339,32 @@
         make.height.mas_equalTo(20);
     }];
     
-    UILabel *imageBackupsLabel = [[UILabel alloc] init];
-    imageBackupsLabel.text = NSLocalizedString(@"set_Privacy_title_image_open",nil) ;
-    imageBackupsLabel.font = [UIFont systemFontOfSize:12.0];
-    imageBackupsLabel.textColor = [UIColor hwColor:@"#6A6A6A" alpha:1.0];
-    [imageBackupsBgView addSubview:imageBackupsLabel];
+    _imageBackupsLabel = [[UILabel alloc] init];
+    //_imageBackupsLabel.text = NSLocalizedString(@"set_Privacy_title_image_open",nil) ;
+    _imageBackupsLabel.font = [UIFont systemFontOfSize:12.0];
+    _imageBackupsLabel.textColor = [UIColor hwColor:@"#6A6A6A" alpha:1.0];
+    [imageBackupsBgView addSubview:_imageBackupsLabel];
 
-    [imageBackupsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+    [_imageBackupsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.centerY.mas_equalTo(10);
         make.left.mas_equalTo(backupsImageV.mas_right).offset(10);
         make.width.mas_equalTo(100);
         make.height.mas_equalTo(20);
     }];
     
-    UIButton *imageBackupsButton = [[UIButton alloc] init];
-    imageBackupsButton.backgroundColor = [UIColor hwColor:@"#DCF4FB" alpha:1.0];
-    imageBackupsButton.tag = 7;
-    [imageBackupsButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
-    imageBackupsButton.layer.cornerRadius = 12.0;
-    imageBackupsButton.layer.masksToBounds = YES;
-    [imageBackupsButton setTitle:NSLocalizedString(@"common_open",nil) forState:UIControlStateNormal];
-    [imageBackupsButton setTitle:NSLocalizedString(@"common_close",nil) forState:UIControlStateSelected];
-    [imageBackupsButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
-    imageBackupsButton.titleLabel.font = [UIFont systemFontOfSize:12.0];
-    [imageBackupsBgView addSubview:imageBackupsButton];
-
-    [imageBackupsButton mas_makeConstraints:^(MASConstraintMaker *make) {
+    _imageBackupsButton = [[UIButton alloc] init];
+    _imageBackupsButton.backgroundColor = [UIColor hwColor:@"#DCF4FB" alpha:1.0];
+    _imageBackupsButton.tag = 7;
+    [_imageBackupsButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
+    _imageBackupsButton.layer.cornerRadius = 12.0;
+    _imageBackupsButton.layer.masksToBounds = YES;
+    [_imageBackupsButton setTitle:NSLocalizedString(@"common_open",nil) forState:UIControlStateNormal];
+    [_imageBackupsButton setTitle:NSLocalizedString(@"common_close",nil) forState:UIControlStateSelected];
+    [_imageBackupsButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
+    _imageBackupsButton.titleLabel.font = [UIFont systemFontOfSize:12.0];
+    [imageBackupsBgView addSubview:_imageBackupsButton];
+
+    [_imageBackupsButton mas_makeConstraints:^(MASConstraintMaker *make) {
         make.right.mas_equalTo(-10);
         make.centerY.mas_equalTo(0);
         make.width.mas_equalTo(60);
@@ -461,6 +460,25 @@
     }
 }
 
+- (void)closeImageBackupsFun
+{
+    [HWDataManager setBoolWithKey:Const_photo_backups_state value:NO];
+    [self setBackupsStateFun];
+}
+- (void)setBackupsStateFun
+{
+    BOOL haveOpenBackups = [HWDataManager getBoolWithKey:Const_photo_backups_state];
+    
+    _imageBackupsButton.selected = haveOpenBackups;
+    
+    if(haveOpenBackups){
+        _imageBackupsLabel.text = NSLocalizedString(@"set_Privacy_title_image_open",nil) ;
+    }
+    else
+    {
+        _imageBackupsLabel.text = NSLocalizedString(@"set_Privacy_title_image_close",nil) ;
+    }
+}
 
 #pragma mark  按钮点击事件
 - (void)didClickButFun:(UIButton*)but
@@ -469,6 +487,18 @@
     
     //HLog(@"xxxx:%ld",tag)
     
+    if(tag == 7){
+        BOOL haveOpenBackups = [HWDataManager getBoolWithKey:Const_photo_backups_state];
+        
+        if(!haveOpenBackups){
+            [HWDataManager setBoolWithKey:Const_photo_backups_state value:YES];
+            [self setBackupsStateFun];
+            [[iToast makeText:NSLocalizedString(@"set_Privacy_title_image_open",nil)] show];
+            return;
+        }
+        
+    }
+    
     if(_didClickBut){
         _didClickBut(tag);
     }

+ 7 - 1
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -336,4 +336,10 @@
 "File_upload_path_new_check_tip"   = "选择备份路径:";
 "File_upload_path_new_name_tip"   = "新建文件夹名称:";
 "File_upload_path_new_input_tip"   = "请输入文件夹名称";
-
+"File_backups_path_set"   = "备份设置";
+"File_backups_set_Cellular"   = "手机流量备份(开启状态wifi与流量均备份)";
+"File_backups_set_battery_level"   = "手机电量低于15%时暂停备份";
+"File_backups_path_set"   = "相册文件备份设置";
+"File_backups_path_way_tip"   = "每次开启app时自动备份新文件,默认备份至系统盘,可手动切换至外接盘。相册文件默认备份至:";
+"File_backups_set_close_title"   = "关闭相册备份";
+"File_backups_set_close_tip"   = "关闭备份会取消正在备份的任务,请谨慎操作";