|
|
@@ -0,0 +1,167 @@
|
|
|
+//
|
|
|
+// fileTransferPathCheckViewController.m
|
|
|
+// 隐私保护
|
|
|
+//
|
|
|
+// Created by xd h on 2023/12/28.
|
|
|
+//
|
|
|
+
|
|
|
+#import "fileTransferPathCheckViewController.h"
|
|
|
+#import "fileTransferPathCheckTableViewCell.h"
|
|
|
+
|
|
|
+@interface fileTransferPathCheckViewController ()<UITableViewDelegate,UITableViewDataSource>
|
|
|
+@property (nonatomic, strong) UITableView *tableView;
|
|
|
+
|
|
|
+@end
|
|
|
+
|
|
|
+@implementation fileTransferPathCheckViewController
|
|
|
+
|
|
|
+- (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_upload_path_check",nil)];
|
|
|
+ [self.view setBackgroundColor:HWF5F7FAColor];
|
|
|
+
|
|
|
+ [self drawAnyView];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)drawAnyView{
|
|
|
+
|
|
|
+ UIButton* rightButton = [[UIButton alloc] init];
|
|
|
+ [rightButton setTitle:NSLocalizedString(@"File_upload_path_new",nil) forState:UIControlStateNormal];
|
|
|
+ [rightButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
|
|
|
+ rightButton.titleLabel.font = [UIFont systemFontOfSize:18.0];
|
|
|
+ rightButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
|
|
|
+ [rightButton addTarget:self action:@selector(didiClikRightButFun:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [self.navBarBGView addSubview:rightButton];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ [rightButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.width.mas_equalTo(120);
|
|
|
+ make.height.mas_equalTo(40);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
|
|
|
+ }];
|
|
|
+
|
|
|
+ [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);
|
|
|
+ }];
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+#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];
|
|
|
+
|
|
|
+ if (@available(iOS 15.0, *)) {
|
|
|
+ _tableView.sectionHeaderTopPadding = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return _tableView;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+#pragma mark - 列表委托
|
|
|
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
+ return 2;
|
|
|
+}
|
|
|
+
|
|
|
+- (fileTransferPathCheckTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
+
|
|
|
+ __block NSInteger row = indexPath.row;
|
|
|
+ static NSString *identifier = @"fileTransferPathCheckTableViewCell";
|
|
|
+
|
|
|
+ fileTransferPathCheckTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
|
|
|
+ cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
|
+ if (!cell){
|
|
|
+ cell = [[fileTransferPathCheckTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
|
|
|
+ [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
|
|
|
+ [cell setBackgroundColor:[UIColor clearColor]];
|
|
|
+ [cell setAccessoryType:(UITableViewCellAccessoryNone)];
|
|
|
+
|
|
|
+ [cell.bgViewLayer removeFromSuperlayer];
|
|
|
+ [cell.titleLabel2 setHidden:NO];
|
|
|
+ [cell.rightImage setHidden:YES];
|
|
|
+ [cell.lineView setHidden:NO];
|
|
|
+ [cell.checkButton setHidden:NO];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (row == 0){
|
|
|
+ //[cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_Cellular",nil)];
|
|
|
+ cell.titleLabel.text = @"云机名称/我的空间/来自[手机名称]的[XX]文件备份";
|
|
|
+
|
|
|
+ cell.checkButton.selected = YES;
|
|
|
+
|
|
|
+ /*上圆角*/
|
|
|
+ //设置部分圆角 贝塞尔曲线
|
|
|
+ UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 90)
|
|
|
+ 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)];
|
|
|
+
|
|
|
+ cell.titleLabel.text = @"云机名称/我的空间/XYJ";
|
|
|
+
|
|
|
+ /*下圆角*/
|
|
|
+ UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 90)
|
|
|
+ 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) {
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ return cell;
|
|
|
+}
|
|
|
+
|
|
|
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
+ return 90;
|
|
|
+}
|
|
|
+
|
|
|
+- (void)didiClikRightButFun:(UIButton*)but
|
|
|
+{
|
|
|
+// uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
|
|
|
+// vc.isNotUploadingType = YES;
|
|
|
+// [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
+@end
|