PrivacyViewController.m 1.7 KB
//
//  PrivacyViewController.m
//  DreamSleep
//
//  Created by peter on 2022/4/6.
//

#import "PrivacyViewController.h"
#import "PrivacyView.h"

@interface PrivacyViewController ()
@property (nonatomic, strong) PrivacyView *policyView;
@property (nonatomic, strong) UIView *maskView;
@end

@implementation PrivacyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = DSWhite;
    [self showPrivacyView];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    self.navigationController.navigationBarHidden = YES;
}

#pragma mark - 关闭侧滑
- (BOOL)enableInteractivePopGestureRecognizer {
    return NO;
}

#pragma mark - 导航栏为NaviStyleUndef
- (NaviStyle)navigationBarStyle {
    return NaviStyleUndef;
}

#pragma mark - 设置状态栏文字颜色
- (UIStatusBarStyle)preferredStatusBarStyle {
    return [self.dk_manager.themeVersion isEqualToString:DKThemeVersionNormal] ? UIStatusBarStyleDefault : UIStatusBarStyleLightContent;
}

- (void)showPrivacyView {
    self.policyView = [[PrivacyView alloc] init];
    [self.view addSubview:self.policyView];
    
    [self.policyView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.view.mas_centerY);
        make.centerX.equalTo(self.view.mas_centerX);
        make.width.equalTo(@280);
        make.height.equalTo(@236);
    }];
    self.policyView.hidden = NO;
    self.maskView = [[UIView alloc] initWithFrame:self.view.frame];
    [self.view addSubview:self.maskView];
    self.maskView.backgroundColor = ColorFromRGBA(0, 0, 0, .35);
    [self.view insertSubview:self.maskView belowSubview:self.policyView];
    self.maskView.hidden = NO;
}

@end