// // playerSetView.m // 双子星云手机 // // Created by xd h on 2024/6/24. // #import "playerSetView.h" #import "SYJUISwitch.h" @interface playerSetView () @property(nonatomic, strong) SYJUISwitch * bottomNavSwitch;//底部导航栏开关 @property(nonatomic, strong) SYJUISwitch * fullScreenSwitch;//全面屏开关 @property(nonatomic, strong) UIButton *TVButton; @end @implementation playerSetView - (id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; self.backgroundColor = [UIColor hwColor:@"000000" alpha:0.6]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getCouldPhoneTvStatusFun:) name:getCouldPhoneTvStatusNotification object:nil]; [self drawAnyView]; return self; } - (void)drawAnyView{ //扩大金融云机范围按钮 UIButton *bigButton = [[UIButton alloc] init]; bigButton.tag = 1; [bigButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:bigButton]; //bigButton.backgroundColor = [UIColor greenColor]; [bigButton mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(0); make.right.mas_equalTo(0); make.left.mas_equalTo(0); make.bottom.mas_equalTo(0); }]; UIView* blackBgView = [UIView new]; blackBgView.layer.cornerRadius = 20; blackBgView.backgroundColor = [UIColor hwColor:@"#202630"]; [self addSubview:blackBgView]; [blackBgView mas_makeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(256); make.width.mas_equalTo(245); make.centerX.mas_equalTo(0.f); make.centerY.mas_equalTo(00.f); }]; UIView *bg1View = [UIView new]; bg1View.layer.cornerRadius = 12; bg1View.backgroundColor = [UIColor hwColor:@"#29313D"]; [blackBgView addSubview:bg1View]; [bg1View mas_makeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(74); make.left.mas_equalTo(12); make.right.mas_equalTo(-12); make.top.mas_equalTo(16.f); }]; //底部导航栏开关 _bottomNavSwitch = [[SYJUISwitch alloc] initWithFrame:CGRectMake(0, 0, 44, 22)]; _bottomNavSwitch.onTintColor = HW13B2EBColor; _bottomNavSwitch.offTintColor = [UIColor hwColor:@"#E3E8F1"]; [_bottomNavSwitch addTarget:self action:@selector(maskSwitchPressed:) forControlEvents:UIControlEventValueChanged]; [bg1View addSubview:_bottomNavSwitch]; [_bottomNavSwitch mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(35.f); make.top.mas_equalTo(16.f); make.width.mas_equalTo(44.f); make.height.mas_equalTo(22.f); }]; UILabel *navSwitchTipLabel = [[UILabel alloc] init]; navSwitchTipLabel.text = NSLocalizedString(@"cloudPhone_nav_show_tip",nil); navSwitchTipLabel.textAlignment = NSTextAlignmentCenter; navSwitchTipLabel.textColor = [UIColor whiteColor]; navSwitchTipLabel.font = [UIFont systemFontOfSize:10.0]; [bg1View addSubview:navSwitchTipLabel]; [navSwitchTipLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(bg1View.mas_centerX).offset(-10.f); make.left.mas_equalTo(10); make.top.equalTo(_bottomNavSwitch.mas_bottom).offset(6); }]; //全面屏开关 _fullScreenSwitch = [[SYJUISwitch alloc] initWithFrame:CGRectMake(0, 0, 44, 22)]; _fullScreenSwitch.onTintColor = HW13B2EBColor; _fullScreenSwitch.offTintColor = [UIColor hwColor:@"#E3E8F1"]; [_fullScreenSwitch addTarget:self action:@selector(maskSwitchPressed:) forControlEvents:UIControlEventValueChanged]; [bg1View addSubview:_fullScreenSwitch]; [_fullScreenSwitch mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-35.f); make.top.mas_equalTo(16.f); make.width.mas_equalTo(44.f); make.height.mas_equalTo(22.f); }]; UILabel *fullScreenTipLabel = [[UILabel alloc] init]; fullScreenTipLabel.text = NSLocalizedString(@"cloudPhone_fullScreen_show_tip",nil); fullScreenTipLabel.textAlignment = NSTextAlignmentCenter; fullScreenTipLabel.textColor = [UIColor whiteColor]; fullScreenTipLabel.font = [UIFont systemFontOfSize:10.0]; [bg1View addSubview:fullScreenTipLabel]; [fullScreenTipLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(bg1View.mas_centerX).offset(10.f); make.right.mas_equalTo(-10); make.top.equalTo(_bottomNavSwitch.mas_bottom).offset(6); }]; KWeakSelf dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [weakSelf setAllSwitchFun]; }); /**********************************************************************************/ UIView *bg2View = [UIView new]; bg2View.layer.cornerRadius = 12; bg2View.backgroundColor = [UIColor hwColor:@"#29313D"]; [blackBgView addSubview:bg2View]; [bg2View mas_makeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(74); make.left.mas_equalTo(12); make.right.mas_equalTo(-12); make.top.equalTo(bg1View.mas_bottom).offset(12); }]; NSArray *titleArr = @[//NSLocalizedString(@"cloudPhone_set_screenshot_tip",nil), NSLocalizedString(@"my_set_no_restart_phone",nil), NSLocalizedString(@"cloudPhone_set_exit_tip",nil), ]; NSArray *imageArr = @[//@"cloudPhone_set_screenshot", @"cloudPhone_set_restart", @"cloudPhone_set_exit", ]; CGFloat butTopY = 15.0; CGFloat imageWH = 24.0; CGFloat butHeight = imageWH +20 +5; //CGFloat butWidth = (245 -12*2)/3.0; //70.0; CGFloat butWidth = (245 -12*2)/2.0; //70.0; CGFloat butSpace = 0.0; //(245 - butWidth*3)/3.0; for (int i=0; i