






#import "UsageKeepNineViewController.h"
#import "EarColumnManager.h"
#import "TooSwipeView.h"
#import "UIColor+SpaColor.h"
#import "UIDevice+PanDevice.h"
#import "UIImage+GetImage.h"
#import "FaxClosestConfig.h"


@implementation UsageKeepNineViewController

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

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = ForHueAfter.tempCoalescedTemporaryEyeLoudCommon ? [UIColor sheOffsetShowersPenAccuracyDecide:ForHueAfter.tempCoalescedTemporaryEyeLoudCommon]:UIColor.whiteColor;

    self.routeSunWax = self.retCellStay;
    [TooSwipeView kindExist];
    

    self.silentAvail.opaque = NO;
    self.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0];
    
    [self.silentAvail mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resizeOptPop) name:ForHueAfter.grayGradient.connectedBeganBoyfriendItsClipThreads object:nil];
}

- (void)resizeOptPop {
    [self.silentAvail reload];
}


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

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


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([ForHueAfter fileHandledHiddenDifferentSixName] && FaxClosestConfig.shared.filenameChannelDepthSocialBut.askSameAuto.mildReceive) {
        [TooSwipeView slantPost];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)yearInterestSize {
    UIWindow *outlineWindow = [[EarColumnManager shared] indicatorFarWindow];
    UIEdgeInsets safe = outlineWindow.safeAreaInsets;
    CGFloat printPathGram = 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 hasNotch] || [UIDevice zipPin]) {//无刘海
            printPathGram = UIScreen.mainScreen.bounds.size.height*ForHueAfter.willSaveBasqueSubObsolete;
        }else {
            printPathGram = (UIScreen.mainScreen.bounds.size.height - safe.bottom)*ForHueAfter.willSaveBasqueSubObsolete;
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, printPathGram);
        
    }else { 
        if (![UIDevice hasNotch] || [UIDevice zipPin]) {//无刘海
            printPathGram = UIScreen.mainScreen.bounds.size.width * ForHueAfter.willSaveBasqueSubObsolete;
        }else {
            if (orientation == UIInterfaceOrientationLandscapeRight) {
                printPathGram = (UIScreen.mainScreen.bounds.size.width - safe.left) * ForHueAfter.willSaveBasqueSubObsolete;
            }else {
                printPathGram = (UIScreen.mainScreen.bounds.size.width - safe.right) * ForHueAfter.willSaveBasqueSubObsolete;
            }
        }
        return CGSizeMake(printPathGram, UIScreen.mainScreen.bounds.size.height);
    }
}

- (void)eraCapsScalePromiseGuarani {
    UIWindow *outlineWindow = [[EarColumnManager shared] indicatorFarWindow];
    UIEdgeInsets safe = outlineWindow.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.yearInterestSize);
        }];
    }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.yearInterestSize);
            }];
        }else {
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.left.mas_equalTo(0);
                make.size.mas_equalTo(self.yearInterestSize);
            }];
        }
    }
}

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

@end
