






#import "ButMeanGetPenViewController.h"
#import "FactBasicManager.h"
#import "ExistentView.h"
#import "UIColor+PenColor.h"
#import "UIDevice+SonDevice.h"
#import "UIImage+ForImage.h"
#import "TwitterPenConfig.h"


@implementation ButMeanGetPenViewController

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = MixSnowBits.protocolApertureMemoryFadeWidthConverged ? [UIColor clearIncludesMenuColumnsBelowEncoded:MixSnowBits.protocolApertureMemoryFadeWidthConverged]:UIColor.whiteColor;

    self.offItsThird = self.thatMainFor;
    [ExistentView boxMedium];
    

    self.askUnlocked.opaque = NO;
    self.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0];
    
    [self.askUnlocked mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(skinSolveBit) name:MixSnowBits.packRouteToo.feetPeoplePrincipalReceiverIntegrateCatalan object:nil];
}

- (void)skinSolveBit {
    [self.askUnlocked reload];
}


- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self batteryLittleLimitedAlpineNorth];
}

//- (void)viewDidAppear:(BOOL)animated {


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([MixSnowBits maxFitDragPrivacyNordicName] && TwitterPenConfig.shared.learnGallonSuchAbnormalTrait.ignoredLate.safeToolBar) {
        [ExistentView submitAre];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)tapBatchHoldSize {
    UIWindow *wonTailWindow = [[FactBasicManager shared] arcadeCupIcyWindow];
    UIEdgeInsets safe = wonTailWindow.safeAreaInsets;
    CGFloat lostWaitDigit = 0;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
#pragma clang diagnostic pop
    
    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
        if (![UIDevice replaced] || [UIDevice napNot]) {//无刘海
            lostWaitDigit = UIScreen.mainScreen.bounds.size.height*MixSnowBits.tremorRecoveredOperatingBannerCrop;
        }else {
            lostWaitDigit = (UIScreen.mainScreen.bounds.size.height - safe.bottom)*MixSnowBits.tremorRecoveredOperatingBannerCrop;
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, lostWaitDigit);
        
    }else { 
        if (![UIDevice replaced] || [UIDevice napNot]) {//无刘海
            lostWaitDigit = UIScreen.mainScreen.bounds.size.width * MixSnowBits.tremorRecoveredOperatingBannerCrop;
        }else {
            if (orientation == UIInterfaceOrientationLandscapeRight) {
                lostWaitDigit = (UIScreen.mainScreen.bounds.size.width - safe.left) * MixSnowBits.tremorRecoveredOperatingBannerCrop;
            }else {
                lostWaitDigit = (UIScreen.mainScreen.bounds.size.width - safe.right) * MixSnowBits.tremorRecoveredOperatingBannerCrop;
            }
        }
        return CGSizeMake(lostWaitDigit, UIScreen.mainScreen.bounds.size.height);
    }
}

- (void)batteryLittleLimitedAlpineNorth {
    UIWindow *wonTailWindow = [[FactBasicManager shared] arcadeCupIcyWindow];
    UIEdgeInsets safe = wonTailWindow.safeAreaInsets;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
#pragma clang diagnostic pop
    
    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerX.bottom.mas_equalTo(0);
            make.size.mas_equalTo(self.tapBatchHoldSize);
        }];
    }else {
        
        if (orientation == UIInterfaceOrientationLandscapeRight) {
            
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.mas_equalTo(0);
                make.left.mas_equalTo(safe.left);
                make.size.mas_equalTo(self.tapBatchHoldSize);
            }];
        }else {
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.left.mas_equalTo(0);
                make.size.mas_equalTo(self.tapBatchHoldSize);
            }];
        }
    }
}

- (void)itemPerformsDirectPutOpacity:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super itemPerformsDirectPutOpacity:touches withEvent:event];
    [[FactBasicManager shared] whiteSlashesOverlapBusEnclosingRematchViewController:self.navigationController];
}

@end
