Browse Source

1.上传/下载设置页面

huangxiaodong 1 year ago
parent
commit
cf87ca08a7

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

@@ -182,6 +182,10 @@
 		6B4D23B22B33DDBC005B718A /* imageVersionRenewTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B4D23B02B33DDBB005B718A /* imageVersionRenewTipView.m */; };
 		6B5B60602B3BC8DE009A2AE2 /* fileTransferPopView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5B605E2B3BC8DE009A2AE2 /* fileTransferPopView.h */; };
 		6B5B60612B3BC8DE009A2AE2 /* fileTransferPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5B605F2B3BC8DE009A2AE2 /* fileTransferPopView.m */; };
+		6B5B60652B3D5FD8009A2AE2 /* fileTransfeSetViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5B60632B3D5FD8009A2AE2 /* fileTransfeSetViewController.h */; };
+		6B5B60662B3D5FD8009A2AE2 /* fileTransfeSetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5B60642B3D5FD8009A2AE2 /* fileTransfeSetViewController.m */; };
+		6B5B606A2B3D67B2009A2AE2 /* fileSetTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5B60682B3D67B2009A2AE2 /* fileSetTableViewCell.h */; };
+		6B5B606B2B3D67B2009A2AE2 /* fileSetTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5B60692B3D67B2009A2AE2 /* fileSetTableViewCell.m */; };
 		6B72724B2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B7272492B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.h */; };
 		6B72724C2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B72724A2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m */; };
 		6B72724F2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B72724D2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h */; };
@@ -565,6 +569,10 @@
 		6B4D23B02B33DDBB005B718A /* imageVersionRenewTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = imageVersionRenewTipView.m; sourceTree = "<group>"; };
 		6B5B605E2B3BC8DE009A2AE2 /* fileTransferPopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fileTransferPopView.h; sourceTree = "<group>"; };
 		6B5B605F2B3BC8DE009A2AE2 /* fileTransferPopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = fileTransferPopView.m; sourceTree = "<group>"; };
+		6B5B60632B3D5FD8009A2AE2 /* fileTransfeSetViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fileTransfeSetViewController.h; sourceTree = "<group>"; };
+		6B5B60642B3D5FD8009A2AE2 /* fileTransfeSetViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = fileTransfeSetViewController.m; sourceTree = "<group>"; };
+		6B5B60682B3D67B2009A2AE2 /* fileSetTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fileSetTableViewCell.h; sourceTree = "<group>"; };
+		6B5B60692B3D67B2009A2AE2 /* fileSetTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = fileSetTableViewCell.m; sourceTree = "<group>"; };
 		6B7272492B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileRecordTableViewHeadView.h; sourceTree = "<group>"; };
 		6B72724A2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileRecordTableViewHeadView.m; sourceTree = "<group>"; };
 		6B72724D2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileRecordEditBottomView.h; sourceTree = "<group>"; };
@@ -1201,6 +1209,7 @@
 		6B05815D2AFCD0A900D37290 /* uploadFile */ = {
 			isa = PBXGroup;
 			children = (
+				6B5B60622B3D5F72009A2AE2 /* fileTransfeSet */,
 				6B0582822B0457A000D37290 /* uploadFileManager */,
 				6B0582712AFF79E100D37290 /* model */,
 				6B0581622AFCDB4300D37290 /* photoView */,
@@ -1292,6 +1301,25 @@
 			path = netWork;
 			sourceTree = "<group>";
 		};
+		6B5B60622B3D5F72009A2AE2 /* fileTransfeSet */ = {
+			isa = PBXGroup;
+			children = (
+				6B5B60672B3D6795009A2AE2 /* view */,
+				6B5B60632B3D5FD8009A2AE2 /* fileTransfeSetViewController.h */,
+				6B5B60642B3D5FD8009A2AE2 /* fileTransfeSetViewController.m */,
+			);
+			path = fileTransfeSet;
+			sourceTree = "<group>";
+		};
+		6B5B60672B3D6795009A2AE2 /* view */ = {
+			isa = PBXGroup;
+			children = (
+				6B5B60682B3D67B2009A2AE2 /* fileSetTableViewCell.h */,
+				6B5B60692B3D67B2009A2AE2 /* fileSetTableViewCell.m */,
+			);
+			path = view;
+			sourceTree = "<group>";
+		};
 		6BBB35D42AE7645200E4A59B /* BackgroundKeepAlive */ = {
 			isa = PBXGroup;
 			children = (
@@ -1748,11 +1776,13 @@
 				18FCE5442AD136FF0020F623 /* ShortcutManager.h in Headers */,
 				6B2170A02B15D39900656670 /* privacyModeTipViewController.h in Headers */,
 				181E84FB2A8F57A500292B96 /* ChangeLogoViewController.h in Headers */,
+				6B5B606A2B3D67B2009A2AE2 /* fileSetTableViewCell.h in Headers */,
 				18C4754F2A8E0DB5006129C0 /* MySetViewController.h in Headers */,
 				18FCE53F2AD136670020F623 /* PlayerViewController+TouchPointXD.h in Headers */,
 				18FCE53E2AD136670020F623 /* PlayerViewController+AdjustBtnFrame.h in Headers */,
 				6B05815B2AFC851E00D37290 /* mySetHeadView.h in Headers */,
 				6BF52CAD2AD82EA500A617DB /* PlayerControlButTipView.h in Headers */,
+				6B5B60652B3D5FD8009A2AE2 /* fileTransfeSetViewController.h in Headers */,
 				6B4D23B12B33DDBC005B718A /* imageVersionRenewTipView.h in Headers */,
 				6B8FF6BD2B04EB7100800981 /* uploadFileRecordBodyView.h in Headers */,
 				6B0582892B045E0B00D37290 /* uploadFileDataModel.h in Headers */,
@@ -2098,6 +2128,7 @@
 				18E557292A3C60ED005CC84B /* PwdInPutView.m in Sources */,
 				18BB18422AC417CB00A36F63 /* RYShearDeviceUDPManager.m in Sources */,
 				18F9CB062ABD7835003FF71A /* TipsQRCodeForChangeDeviceViewController.m in Sources */,
+				6B5B60662B3D5FD8009A2AE2 /* fileTransfeSetViewController.m in Sources */,
 				183AE6502A8A2CF000B11CB0 /* UIButton+AFNetworking.m in Sources */,
 				A084D68E27E859D300054880 /* HWToolListCell.m in Sources */,
 				183AE6512A8A2CF000B11CB0 /* UIActivityIndicatorView+AFNetworking.m in Sources */,
@@ -2179,6 +2210,7 @@
 				184C8AD12A94980D00F26650 /* CustomerWebViewController.m in Sources */,
 				A08A94FD27E9A4E400C544BB /* NSObject+BGModel.m in Sources */,
 				181E84F32A8F0A9B00292B96 /* HelpDownScrollView.m in Sources */,
+				6B5B606B2B3D67B2009A2AE2 /* fileSetTableViewCell.m in Sources */,
 				6BF0F3D12AD391D8000AA133 /* connectDeviceManager.m in Sources */,
 				181E84F62A8F451D00292B96 /* MineViewCell.m in Sources */,
 				18FCE5412AD136670020F623 /* PlayerViewController+AdjustBtnFrame.m in Sources */,

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

@@ -85,6 +85,13 @@ UIKIT_EXTERN NSString *const Const_need_random_Change_Params;
 
 /*标记是否镜像版本更新日期*/
 UIKIT_EXTERN NSString *const Const_did_show_image_version_date;
+
+/*标记是否使用流量上传下载*/
+UIKIT_EXTERN NSString *const Const_file_Transfe_canUse_Cellular;
+
+/*标记是否低电量上传下载*/
+UIKIT_EXTERN NSString *const Const_file_Transfe_battery_level;
+
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -81,4 +81,11 @@ NSString *const Const_need_random_Change_Params  = @"need_random_Change_Params";
 
 /*标记是否镜像版本更新日期*/
 NSString *const Const_did_show_image_version_date  = @"did_show_image_version_date";
+
+/*标记是否使用流量上传下载*/
+NSString *const Const_file_Transfe_canUse_Cellular  = @"file_Transfe_canUse_Cellular";
+
+/*标记是否低电量上传下载*/
+NSString *const Const_file_Transfe_battery_level  = @"file_Transfe_battery_level";
+
 @end

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

@@ -28,6 +28,7 @@
 #import "TvStatusModel.h"
 #import "inputPWDViewController.h"
 #import "fileTransferPopView.h"
+#import "fileTransfeSetViewController.h"
 
 @interface MySetViewController ()<HelpDownScrollViewDelegate,UITableViewDelegate,UITableViewDataSource,ComontAlretViewControllerDelegate>
 {
@@ -125,9 +126,9 @@
     HLog(@"hhh %ld",tag);
     
     switch (tag) {
-        case 1:
-            {
-                
+        case 1:{
+                fileTransfeSetViewController *nextVC = [fileTransfeSetViewController new];
+                [self.navigationController pushViewController:nextVC animated:YES];
             }
             break;
         case 2:

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

@@ -0,0 +1,16 @@
+//
+//  fileTransfeSetViewController.h
+//  隐私保护
+//
+//  Created by xd h on 2023/12/28.
+//
+
+#import "BaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface fileTransfeSetViewController : BaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

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

@@ -0,0 +1,252 @@
+//
+//  fileTransfeSetViewController.m
+//  隐私保护
+//
+//  Created by xd h on 2023/12/28.
+//
+
+#import "fileTransfeSetViewController.h"
+#import "fileSetTableViewCell.h"
+
+@interface fileTransfeSetViewController ()<UITableViewDelegate,UITableViewDataSource>
+@property (nonatomic, strong) UITableView *tableView;
+@property (nonatomic, strong) UIView *tailView;
+@property (nonatomic, strong) UILabel *uploadFilePathLabel;
+@end
+
+@implementation fileTransfeSetViewController
+
+- (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(@"set_upload_download_tip",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, 110 +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.bottom.mas_equalTo(0);
+            make.top.mas_equalTo(15);
+        }];
+        
+        UILabel *titleLab = [[UILabel alloc] init];
+        titleLab.text = NSLocalizedString(@"File_upload_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;
+        [tailBgView addSubview:_uploadFilePathLabel];
+        
+        [_uploadFilePathLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(10);
+            make.right.mas_equalTo(-15);
+            make.bottom.mas_equalTo(-20);
+            make.top.mas_equalTo(titleLab.mas_bottom).offset(10.0);
+        }];
+        
+        [self setUploadFilePathLabelTitleFun];
+    }
+    
+    return _tailView;
+}
+
+- (void)setUploadFilePathLabelTitleFun
+{
+    NSString * leftStr = NSLocalizedString(@"File_upload_path_way",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
+{
+    HLog(@"111");
+}
+
+#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_Transfer_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_Transfer_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

+ 25 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/view/fileSetTableViewCell.h

@@ -0,0 +1,25 @@
+//
+//  fileSetTableViewCell.h
+//  隐私保护
+//
+//  Created by xd h on 2023/12/28.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface fileSetTableViewCell : UITableViewCell
+@property(nonatomic,strong)UIView *lineView;
+@property(nonatomic,strong)UIView *cellBgView;
+@property(nonatomic,strong)UIImageView *mImageView;
+@property(nonatomic,strong)UILabel *titleLabel;
+@property(nonatomic,strong)UILabel *titleLabel2;
+@property(nonatomic,strong)UIImageView *rightImage;
+@property(nonatomic, strong) CALayer* bgViewLayer;
+@property(nonatomic, strong) UISwitch *maskSwitch;
+
+@property (nonatomic,copy) void (^didClickSwitch)(BOOL SwitchOn);
+@end
+
+NS_ASSUME_NONNULL_END

+ 125 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/view/fileSetTableViewCell.m

@@ -0,0 +1,125 @@
+//
+//  fileSetTableViewCell.m
+//  隐私保护
+//
+//  Created by xd h on 2023/12/28.
+//
+
+#import "fileSetTableViewCell.h"
+
+@implementation fileSetTableViewCell
+@synthesize cellBgView;
+@synthesize mImageView;
+@synthesize titleLabel;
+@synthesize titleLabel2;
+@synthesize rightImage;
+@synthesize lineView;
+@synthesize maskSwitch;
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
+{
+    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+    
+    if (self)
+    {
+        [self drawView];
+    }
+    
+    return self;
+}
+
+- (void)drawView
+{
+    cellBgView = [[UIView alloc] init];
+    [self.contentView addSubview:cellBgView];
+    cellBgView.backgroundColor = [UIColor whiteColor];
+    [cellBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15.f);
+        make.top.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.width.mas_equalTo(SCREEN_W - 2*15.f);
+    }];
+    
+    /*图片*/
+    mImageView = [[UIImageView alloc] init];
+    [mImageView setBackgroundColor:[UIColor clearColor]];
+    [cellBgView addSubview:mImageView];
+    [mImageView setContentMode:(UIViewContentModeScaleAspectFill)];
+    [mImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.width.mas_equalTo(28);
+        make.height.mas_equalTo(28);
+        make.centerY.equalTo(cellBgView.mas_centerY);
+    }];
+    
+    /*右侧箭头*/
+    rightImage = [[UIImageView alloc] init];
+    [rightImage setBackgroundColor:[UIColor clearColor]];
+    [rightImage setImage:[UIImage imageNamed:@"cell_right_access"]];
+    [cellBgView 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(cellBgView.mas_centerY);
+    }];
+    
+    maskSwitch = [[UISwitch alloc] init];
+    [cellBgView addSubview:maskSwitch];
+    [maskSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-18.f);
+        make.centerY.equalTo(cellBgView.mas_centerY);
+    }];
+    [maskSwitch setOnTintColor:HW13B2EBColor];
+    [maskSwitch addTarget:self action:@selector(maskSwitchPressed:) forControlEvents:(UIControlEventValueChanged)];
+
+    BOOL haveOpenMask = [HWDataManager getBoolWithKey:Consn_Fanzhuan_Exit_app_Open];
+    [maskSwitch setOn:haveOpenMask];
+
+    /**标题*/
+    titleLabel = [[UILabel alloc] init];
+    [cellBgView addSubview:titleLabel];
+    titleLabel.font = [UIFont boldSystemFontOfSize:14.f];
+    [titleLabel setTextColor:HW0A132BColor];
+    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        //make.left.equalTo(mImageView.mas_right).offset(5.f);
+        make.left.mas_equalTo(10.f);
+        make.right.mas_equalTo(-50.f);
+        make.centerY.equalTo(cellBgView.mas_centerY);
+    }];
+    
+    /**副标题*/
+    titleLabel2 = [[UILabel alloc] init];
+    [cellBgView addSubview:titleLabel2];
+    titleLabel2.font = [UIFont systemFontOfSize:12.f];
+    [titleLabel2 setTextAlignment:(NSTextAlignmentRight)];
+    [titleLabel2 setTextColor:HW666666Color];
+    [titleLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-53.f);
+        make.left.mas_equalTo(100.f);
+        make.centerY.equalTo(cellBgView.mas_centerY);
+    }];
+    
+    lineView = [[UIView alloc] init];
+    [lineView setBackgroundColor:HW979797Color10];
+    [cellBgView addSubview:lineView];
+    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-15.f);
+        make.left.mas_equalTo(15.f);
+        make.bottom.mas_equalTo(0);
+        make.height.mas_equalTo(1.f);
+    }];
+}
+
+- (void)maskSwitchPressed:(UISwitch *)maskSwitch{
+    if(_didClickSwitch){
+        _didClickSwitch(maskSwitch.on);
+    }
+}
+
+@end

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

@@ -327,3 +327,7 @@
 "File_down_type_image"   = "图片下载";
 "File_down_type_video"   = "视频下载";
 "File_down_type_tip"   = "文件将下载到本地手机";
+"File_Transfer_set_Cellular"   = "使用手机流量上传/下载";
+"File_Transfer_set_battery_level"   = "手机电量低于15%时上传/下载";
+"File_upload_path_set"   = "上传路径设置";
+"File_upload_path_way"   = "文件默认上传至:";