fileTransferPathCheckViewController.m 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. //
  2. // fileTransferPathCheckViewController.m
  3. // 隐私保护
  4. //
  5. // Created by xd h on 2023/12/28.
  6. //
  7. #import "fileTransferPathCheckViewController.h"
  8. #import "fileTransferPathCheckTableViewCell.h"
  9. @interface fileTransferPathCheckViewController ()<UITableViewDelegate,UITableViewDataSource>
  10. @property (nonatomic, strong) UITableView *tableView;
  11. @end
  12. @implementation fileTransferPathCheckViewController
  13. - (void)viewDidLoad {
  14. [super viewDidLoad];
  15. // Do any additional setup after loading the view.
  16. [self.toolBar setHidden:YES];
  17. [self.navigationBar setHidden:YES];
  18. [self.navBarBGView setHidden:NO];
  19. [self.titleLabel setText:NSLocalizedString(@"File_upload_path_check",nil)];
  20. [self.view setBackgroundColor:HWF5F7FAColor];
  21. [self drawAnyView];
  22. }
  23. - (void)drawAnyView{
  24. UIButton* rightButton = [[UIButton alloc] init];
  25. [rightButton setTitle:NSLocalizedString(@"File_upload_path_new",nil) forState:UIControlStateNormal];
  26. [rightButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
  27. rightButton.titleLabel.font = [UIFont systemFontOfSize:18.0];
  28. rightButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
  29. [rightButton addTarget:self action:@selector(didiClikRightButFun:) forControlEvents:UIControlEventTouchUpInside];
  30. [self.navBarBGView addSubview:rightButton];
  31. [rightButton mas_makeConstraints:^(MASConstraintMaker *make) {
  32. make.width.mas_equalTo(120);
  33. make.height.mas_equalTo(40);
  34. make.right.mas_equalTo(-15);
  35. make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
  36. }];
  37. [self.view addSubview:self.tableView];
  38. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  39. make.left.mas_equalTo(0);
  40. make.right.mas_equalTo(0);
  41. make.bottom.mas_equalTo(0);
  42. make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
  43. }];
  44. }
  45. #pragma mark - 懒加载
  46. - (UITableView *)tableView{
  47. if (!_tableView) {
  48. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
  49. _tableView.delegate = self;
  50. _tableView.dataSource = self;
  51. _tableView.showsVerticalScrollIndicator = NO;
  52. _tableView.showsHorizontalScrollIndicator = NO;
  53. // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
  54. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  55. [_tableView setSeparatorColor:[UIColor clearColor]];
  56. [_tableView setBackgroundColor:[UIColor clearColor]];
  57. [_tableView setTableFooterView:[UIView new]];
  58. [_tableView setBounces:YES];
  59. if (@available(iOS 15.0, *)) {
  60. _tableView.sectionHeaderTopPadding = 0;
  61. }
  62. }
  63. return _tableView;
  64. }
  65. #pragma mark - 列表委托
  66. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  67. return 1;
  68. }
  69. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  70. return 2;
  71. }
  72. - (fileTransferPathCheckTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  73. __block NSInteger row = indexPath.row;
  74. static NSString *identifier = @"fileTransferPathCheckTableViewCell";
  75. fileTransferPathCheckTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  76. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  77. if (!cell){
  78. cell = [[fileTransferPathCheckTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  79. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  80. [cell setBackgroundColor:[UIColor clearColor]];
  81. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  82. [cell.bgViewLayer removeFromSuperlayer];
  83. [cell.titleLabel2 setHidden:NO];
  84. [cell.rightImage setHidden:YES];
  85. [cell.lineView setHidden:NO];
  86. [cell.checkButton setHidden:NO];
  87. }
  88. if (row == 0){
  89. //[cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_Cellular",nil)];
  90. cell.titleLabel.text = @"云机名称/我的空间/来自[手机名称]的[XX]文件备份";
  91. cell.checkButton.selected = YES;
  92. /*上圆角*/
  93. //设置部分圆角 贝塞尔曲线
  94. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 90)
  95. byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight
  96. cornerRadii:CGSizeMake(8, 8)];
  97. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  98. maskLayer.frame = cell.cellBgView.bounds;
  99. maskLayer.path = maskPath.CGPath;
  100. cell.bgViewLayer = maskLayer;
  101. cell.cellBgView.layer.mask = cell.bgViewLayer;
  102. }else if (row == 1){
  103. //[cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_battery_level",nil)];
  104. cell.titleLabel.text = @"云机名称/我的空间/XYJ";
  105. /*下圆角*/
  106. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 90)
  107. byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
  108. cornerRadii:CGSizeMake(8, 8)];
  109. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  110. maskLayer.frame = cell.cellBgView.bounds;
  111. maskLayer.path = maskPath.CGPath;
  112. cell.bgViewLayer = maskLayer;
  113. cell.cellBgView.layer.mask = cell.bgViewLayer;
  114. [cell.lineView setHidden:YES];
  115. }
  116. KWeakSelf
  117. cell.didClickSwitch = ^(BOOL SwitchOn) {
  118. };
  119. return cell;
  120. }
  121. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  122. return 90;
  123. }
  124. - (void)didiClikRightButFun:(UIButton*)but
  125. {
  126. // uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  127. // vc.isNotUploadingType = YES;
  128. // [self.navigationController pushViewController:vc animated:YES];
  129. }
  130. @end