HidenMaskSetViewController.m 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. //
  2. // HidenMaskSetViewController.m
  3. // 双子星云手机
  4. //
  5. // Created by APPLE on 2023/8/22.
  6. //
  7. #import "HidenMaskSetViewController.h"
  8. #import <Masonry.h>
  9. @interface HidenMaskSetViewController ()
  10. @end
  11. @implementation HidenMaskSetViewController
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. // Do any additional setup after loading the view.
  15. [self drawAnyView];
  16. }
  17. - (void)drawAnyView{
  18. [self.view setBackgroundColor:HWF5F7FAColor];
  19. [self.toolBar setHidden:YES];
  20. [self.navigationBar setHidden:YES];
  21. [self.navBarBGView setHidden:NO];
  22. [self.titleLabel setText:NSLocalizedString(@"mask_view_hiden_set",nil)];
  23. /*进程隐藏设置*/
  24. UIView *bgView = [[UIView alloc] init];
  25. [bgView setBackgroundColor:[UIColor whiteColor]];
  26. [self.view addSubview:bgView];
  27. [bgView.layer setCornerRadius:8.f];
  28. [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
  29. make.left.mas_equalTo(16.f);
  30. make.right.mas_equalTo(-16.f);
  31. make.height.mas_equalTo(60.f);
  32. make.top.equalTo(self.navBarBGView.mas_bottom).offset(12.f);
  33. }];
  34. UIImageView *leftImage = [[UIImageView alloc] init];
  35. [leftImage setImage:[UIImage imageNamed:@"icon_mask_hiden_set"]];
  36. [bgView addSubview:leftImage];
  37. [leftImage mas_makeConstraints:^(MASConstraintMaker *make) {
  38. make.left.mas_equalTo(14.f);
  39. make.width.mas_equalTo(28.f);
  40. make.height.mas_equalTo(28.f);
  41. make.centerY.equalTo(bgView.mas_centerY);
  42. }];
  43. UILabel *tipsLabel = [[UILabel alloc] init];
  44. [tipsLabel setText:NSLocalizedString(@"mask_view_hiden_set_hiden",nil)];
  45. [tipsLabel setTextColor:HW0A132BColor];
  46. [tipsLabel setFont:[UIFont systemFontOfSize:13.f]];
  47. [bgView addSubview:tipsLabel];
  48. [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  49. make.left.mas_equalTo(47.f);
  50. make.width.mas_equalTo(100.f);
  51. make.height.mas_equalTo(18.f);
  52. make.centerY.equalTo(bgView.mas_centerY);
  53. }];
  54. UISwitch *maskSwitch = [[UISwitch alloc] init];
  55. [bgView addSubview:maskSwitch];
  56. [maskSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
  57. make.right.mas_equalTo(-16.f);
  58. make.centerY.equalTo(bgView.mas_centerY);
  59. }];
  60. [maskSwitch setOnTintColor:HW13B2EBColor];
  61. [maskSwitch addTarget:self action:@selector(maskSwitchPressed:) forControlEvents:(UIControlEventValueChanged)];
  62. BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_Mask_View_Open];
  63. [maskSwitch setOn:haveOpenMask];
  64. /*功能说明*/
  65. UILabel *strTipsLabel = [[UILabel alloc] init];
  66. [strTipsLabel setText:NSLocalizedString(@"mask_view_hiden_funct_struct",nil)];
  67. [strTipsLabel setTextColor:HW0A132BColor];
  68. [strTipsLabel setFont:[UIFont boldSystemFontOfSize:16.f]];
  69. [self.view addSubview:strTipsLabel];
  70. [strTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  71. make.left.mas_equalTo(16.f);
  72. make.width.mas_equalTo(100.f);
  73. make.height.mas_equalTo(22.f);
  74. make.top.equalTo(bgView.mas_bottom).offset(24.f);
  75. }];
  76. /*底部提示视图*/
  77. UIView *bgDownView = [[UIView alloc] init];
  78. [bgDownView setBackgroundColor:[UIColor whiteColor]];
  79. [self.view addSubview:bgDownView];
  80. [bgDownView.layer setCornerRadius:8.f];
  81. [bgDownView mas_makeConstraints:^(MASConstraintMaker *make) {
  82. make.left.mas_equalTo(16.f);
  83. make.right.mas_equalTo(-16.f);
  84. make.height.mas_equalTo(329.f);
  85. make.top.equalTo(strTipsLabel.mas_bottom).offset(12.f);
  86. }];
  87. UIImageView *downImage = [[UIImageView alloc] init];
  88. [downImage setImage:[UIImage imageNamed:@"mask_tips_down_img"]];
  89. [bgDownView addSubview:downImage];
  90. [downImage mas_makeConstraints:^(MASConstraintMaker *make) {
  91. make.top.mas_equalTo(30.f);
  92. make.width.mas_equalTo(286.f);
  93. make.height.mas_equalTo(236.f);
  94. make.centerX.equalTo(bgDownView.mas_centerX);
  95. }];
  96. UILabel *tipsDownLeftLabel = [[UILabel alloc] init];
  97. [tipsDownLeftLabel setText:NSLocalizedString(@"mask_view_hiden_up_swipe",nil)];
  98. [tipsDownLeftLabel setTextColor:HW0A132BColor];
  99. [tipsDownLeftLabel setFont:[UIFont systemFontOfSize:13.f]];
  100. [tipsDownLeftLabel setTextAlignment:(NSTextAlignmentCenter)];
  101. [bgDownView addSubview:tipsDownLeftLabel];
  102. [tipsDownLeftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  103. make.top.equalTo(downImage.mas_bottom).offset(15.f);
  104. make.width.mas_equalTo(100.f);
  105. make.height.mas_equalTo(18.f);
  106. make.centerX.equalTo(downImage.mas_centerX).offset(-76);
  107. }];
  108. UILabel *tipsDownRightLabel = [[UILabel alloc] init];
  109. [tipsDownRightLabel setText:NSLocalizedString(@"mask_view_hiden_app_window",nil)];
  110. [tipsDownRightLabel setTextColor:HW0A132BColor];
  111. [tipsDownRightLabel setFont:[UIFont systemFontOfSize:13.f]];
  112. [tipsDownRightLabel setTextAlignment:(NSTextAlignmentCenter)];
  113. [bgDownView addSubview:tipsDownRightLabel];
  114. [tipsDownRightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  115. make.top.equalTo(downImage.mas_bottom).offset(15.f);
  116. make.width.mas_equalTo(100.f);
  117. make.height.mas_equalTo(18.f);
  118. make.centerX.equalTo(downImage.mas_centerX).offset(76);
  119. }];
  120. UILabel *downTipsLabel = [[UILabel alloc] init];
  121. [downTipsLabel setText:NSLocalizedString(@"mask_view_hiden_app_window_detail",nil)];
  122. [downTipsLabel setNumberOfLines:0];
  123. [downTipsLabel setTextColor:HW666666Color];
  124. [downTipsLabel setFont:[UIFont systemFontOfSize:13.f]];
  125. [self.view addSubview:downTipsLabel];
  126. [downTipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  127. make.left.mas_equalTo(16.f);
  128. make.right.mas_equalTo(-16.f);
  129. make.height.mas_equalTo(36.f);
  130. make.top.equalTo(bgDownView.mas_bottom).offset(12.f);
  131. }];
  132. }
  133. - (void)maskSwitchPressed:(UISwitch *)maskSwitch{
  134. [HWDataManager setBoolWithKey:Const_Mask_View_Open value:maskSwitch.on];
  135. }
  136. /*
  137. #pragma mark - Navigation
  138. // In a storyboard-based application, you will often want to do a little preparation before navigation
  139. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  140. // Get the new view controller using [segue destinationViewController].
  141. // Pass the selected object to the new view controller.
  142. }
  143. */
  144. @end