|
|
@@ -0,0 +1,257 @@
|
|
|
+//
|
|
|
+// 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;//全面屏开关
|
|
|
+@end
|
|
|
+
|
|
|
+@implementation playerSetView
|
|
|
+
|
|
|
+- (id)initWithFrame:(CGRect)frame{
|
|
|
+ self = [super initWithFrame:frame];
|
|
|
+ self.backgroundColor = [UIColor hwColor:@"000000" alpha:0.6];
|
|
|
+ [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);
|
|
|
+ }];
|
|
|
+
|
|
|
+// BOOL haveOpenMask = [HWDataManager getBoolWithKey:Consn_Fanzhuan_Exit_app_Open];
|
|
|
+// [_bottomNavSwitch setOn:haveOpenMask];
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }];
|
|
|
+
|
|
|
+// BOOL haveOpenMask = [HWDataManager getBoolWithKey:Consn_Fanzhuan_Exit_app_Open];
|
|
|
+// [_bottomNavSwitch setOn:haveOpenMask];
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**********************************************************************************/
|
|
|
+ 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 butSpace = 0.0; //(245 - butWidth*3)/3.0;
|
|
|
+
|
|
|
+ for (int i=0; i<titleArr.count; i++) {
|
|
|
+
|
|
|
+ UIButton *but = [[UIButton alloc] init];
|
|
|
+ but.tag = 10+i;
|
|
|
+ [but addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [bg2View addSubview:but];
|
|
|
+ //but.backgroundColor = [UIColor greenColor];
|
|
|
+
|
|
|
+ [but mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(butSpace + (butWidth+butSpace)*(i%4));
|
|
|
+ make.width.mas_equalTo(butWidth);
|
|
|
+ make.height.mas_equalTo(butHeight);
|
|
|
+ make.top.mas_equalTo(butTopY + (i/4)* (butHeight + 25) );
|
|
|
+ }];
|
|
|
+
|
|
|
+ UIImageView *imageV = [[UIImageView alloc] init];
|
|
|
+ imageV.image = [UIImage imageNamed:imageArr[i]];
|
|
|
+ [but addSubview:imageV];
|
|
|
+
|
|
|
+ [imageV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.centerX.mas_equalTo(0);
|
|
|
+ make.width.mas_equalTo(imageWH);
|
|
|
+ make.height.mas_equalTo(imageWH);
|
|
|
+ make.top.mas_equalTo(0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ UILabel *textLabel = [[UILabel alloc] init];
|
|
|
+ textLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
+ textLabel.font = [UIFont systemFontOfSize:10.0];
|
|
|
+ textLabel.textColor = [UIColor whiteColor];
|
|
|
+ textLabel.text = titleArr[i];
|
|
|
+ [but addSubview:textLabel];
|
|
|
+ //textLabel.backgroundColor = [UIColor redColor];
|
|
|
+
|
|
|
+ [textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.centerX.mas_equalTo(0);
|
|
|
+ make.width.mas_equalTo(butWidth);
|
|
|
+ make.height.mas_equalTo(20);
|
|
|
+ make.top.equalTo(imageV.mas_bottom).offset(5);
|
|
|
+ }];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**********************************************************************************/
|
|
|
+ UIButton *TVButton = [[UIButton alloc] init];
|
|
|
+ TVButton.tag = 100;
|
|
|
+ [TVButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [TVButton setTitle:NSLocalizedString(@"my_set_no_TV_p2p",nil) forState:(UIControlStateNormal)];
|
|
|
+ [TVButton setTitle:NSLocalizedString(@"my_set_no_close_TV_p2p",nil) forState:(UIControlStateSelected)];
|
|
|
+ TVButton.layer.cornerRadius = 12;
|
|
|
+ [TVButton.titleLabel setFont:[UIFont boldSystemFontOfSize:14.f]];
|
|
|
+ TVButton.backgroundColor = [UIColor hwColor:@"#29313D"];
|
|
|
+ [blackBgView addSubview:TVButton];
|
|
|
+
|
|
|
+
|
|
|
+ [TVButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.mas_equalTo(50);
|
|
|
+ make.left.mas_equalTo(12);
|
|
|
+ make.right.mas_equalTo(-12);
|
|
|
+ make.top.equalTo(bg2View.mas_bottom).offset(12);
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+- (void)maskSwitchPressed:(UISwitch *)maskSwitch{
|
|
|
+ HLog(@"11111");
|
|
|
+// [HWDataManager setBoolWithKey:Consn_Fanzhuan_Exit_app_Open value:maskSwitch.on];
|
|
|
+//
|
|
|
+// if (maskSwitch.on) {
|
|
|
+// [[iToast makeText:NSLocalizedString(@"my_set_no_fanzhuan_exit_open",nil)] show];
|
|
|
+// }
|
|
|
+// else{
|
|
|
+// [[iToast makeText:NSLocalizedString(@"my_set_no_fanzhuan_exit_close",nil)] show];
|
|
|
+// }
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 按钮事件
|
|
|
+- (void)didClickButtonFun:(UIButton*)but
|
|
|
+{
|
|
|
+ NSInteger tag = but.tag;
|
|
|
+ HLog(@"%ld",tag);
|
|
|
+
|
|
|
+ [self removeFun];
|
|
|
+ if(tag == 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(tag == 100 && but.selected){
|
|
|
+ tag = 101;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(_didClickButtonFun){
|
|
|
+ _didClickButtonFun(tag);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+- (void)removeFun
|
|
|
+{
|
|
|
+ [self removeFromSuperview];
|
|
|
+}
|
|
|
+@end
|