






#import "ShiftDegradedViewController.h"
#import "PerformerManager.h"
#import "AliveFarView.h"
#import "UIColor+HerColor.h"
#import "UIDevice+NapDevice.h"
#import "UIImage+DryImage.h"
#import "CubePosterConfig.h"


@implementation ShiftDegradedViewController

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

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = RedFlexible.dynamicYouKilohertzWasRenderRussian ? [UIColor portalLegalFiveRectifiedAnswerRepeat:RedFlexible.dynamicYouKilohertzWasRenderRussian]:UIColor.whiteColor;

    self.matrixApple = self.manyLeadOur;
    [AliveFarView illCousin];
    

    self.twoObserved.opaque = NO;
    self.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0];
    
    [self.twoObserved mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ironOldTrust) name:RedFlexible.capContinued.linearlyBuildEndIndexesKelvinInjection object:nil];
}

- (void)ironOldTrust {
    [self.twoObserved reload];
}


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

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


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([RedFlexible spaTransmitSameLeaveGeorgianName] && CubePosterConfig.shared.whoPresenterNapGermanInfinity.absoluteRaw.tabWeighted) {
        [AliveFarView hiddenArm];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)andPotentialSize {
    UIWindow *succeedWindow = [[PerformerManager shared] sobHandBasalWindow];
    UIEdgeInsets safe = succeedWindow.safeAreaInsets;
    CGFloat homeTenWetPut = 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 gateways] || [UIDevice putKin]) {//无刘海
            homeTenWetPut = UIScreen.mainScreen.bounds.size.height*RedFlexible.abortFixNorthRecipientEnter;
        }else {
            homeTenWetPut = (UIScreen.mainScreen.bounds.size.height - safe.bottom)*RedFlexible.abortFixNorthRecipientEnter;
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, homeTenWetPut);
        
    }else { 
        if (![UIDevice gateways] || [UIDevice putKin]) {//无刘海
            homeTenWetPut = UIScreen.mainScreen.bounds.size.width * RedFlexible.abortFixNorthRecipientEnter;
        }else {
            if (orientation == UIInterfaceOrientationLandscapeRight) {
                homeTenWetPut = (UIScreen.mainScreen.bounds.size.width - safe.left) * RedFlexible.abortFixNorthRecipientEnter;
            }else {
                homeTenWetPut = (UIScreen.mainScreen.bounds.size.width - safe.right) * RedFlexible.abortFixNorthRecipientEnter;
            }
        }
        return CGSizeMake(homeTenWetPut, UIScreen.mainScreen.bounds.size.height);
    }
}

- (void)plainSolveAllowVisibleKit {
    UIWindow *succeedWindow = [[PerformerManager shared] sobHandBasalWindow];
    UIEdgeInsets safe = succeedWindow.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.andPotentialSize);
        }];
    }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.andPotentialSize);
            }];
        }else {
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.left.mas_equalTo(0);
                make.size.mas_equalTo(self.andPotentialSize);
            }];
        }
    }
}

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

@end
