






#import "HisUsesTwoPutViewController.h"
#import "AlwaysButManager.h"
#import "SinkDaysView.h"
#import "UIColor+TenColor.h"
#import "UIDevice+TooDevice.h"
#import "UIImage+EyeImage.h"
#import "DueBlurNetConfig.h"


@implementation HisUsesTwoPutViewController

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

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = DenyQuarter.capSkippedResponseGenderSuspendedButterfly ? [UIColor boxBadEditAddressesAdvisedCalories:DenyQuarter.capSkippedResponseGenderSuspendedButterfly]:UIColor.whiteColor;

    self.insideAgent = self.vitaminWalk;
    [SinkDaysView speechThe];
    

    self.sinWonBound.opaque = NO;
    self.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0];
    
    [self.sinWonBound mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(operateExact) name:DenyQuarter.nowPinReport.tipSpeakUploadingResultingUpperSpherical object:nil];
}

- (void)operateExact {
    [self.sinWonBound reload];
}


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

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


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([DenyQuarter relatedCoverDiscardsEmergencyTrackName] && DueBlurNetConfig.shared.weeklySiteYetLoudOpen.sheCleanAge.stackAgeRow) {
        [SinkDaysView wordReset];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)moireVersionSize {
    UIWindow *scrollsWindow = [[AlwaysButManager shared] relayHelpersWindow];
    UIEdgeInsets safe = scrollsWindow.safeAreaInsets;
    CGFloat deltaZoomFeed = 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 hasBin]) {//无刘海
            deltaZoomFeed = UIScreen.mainScreen.bounds.size.height*DenyQuarter.simulatesSecurelyDeciliterFractionsLook;
        }else {
            deltaZoomFeed = (UIScreen.mainScreen.bounds.size.height - safe.bottom)*DenyQuarter.simulatesSecurelyDeciliterFractionsLook;
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, deltaZoomFeed);
        
    }else { 
        if (![UIDevice hasNotch] || [UIDevice hasBin]) {//无刘海
            deltaZoomFeed = UIScreen.mainScreen.bounds.size.width * DenyQuarter.simulatesSecurelyDeciliterFractionsLook;
        }else {
            if (orientation == UIInterfaceOrientationLandscapeRight) {
                deltaZoomFeed = (UIScreen.mainScreen.bounds.size.width - safe.left) * DenyQuarter.simulatesSecurelyDeciliterFractionsLook;
            }else {
                deltaZoomFeed = (UIScreen.mainScreen.bounds.size.width - safe.right) * DenyQuarter.simulatesSecurelyDeciliterFractionsLook;
            }
        }
        return CGSizeMake(deltaZoomFeed, UIScreen.mainScreen.bounds.size.height);
    }
}

- (void)installWideSpecifySkippedQueue {
    UIWindow *scrollsWindow = [[AlwaysButManager shared] relayHelpersWindow];
    UIEdgeInsets safe = scrollsWindow.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.moireVersionSize);
        }];
    }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.moireVersionSize);
            }];
        }else {
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.left.mas_equalTo(0);
                make.size.mas_equalTo(self.moireVersionSize);
            }];
        }
    }
}

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

@end
