






#import "BorderedArrayViewController.h"
#import "VortexBusManager.h"
#import "LocationView.h"
#import "UIColor+RunColor.h"
#import "UIDevice+WinDevice.h"
#import "UIImage+OptImage.h"
#import "WetSymbolsConfig.h"


@implementation BorderedArrayViewController

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

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = MainMinimal.charDownloadsNominallyNowTamilQuotes ? [UIColor farsiProcessFeaturesSmoothingRotatingSix:MainMinimal.charDownloadsNominallyNowTamilQuotes]:UIColor.whiteColor;

    self.cornersPack = self.freeKinDark;
    [LocationView betterWet];
    

    self.lossBoxChat.opaque = NO;
    self.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0];
    
    [self.lossBoxChat mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(brownPersist) name:MainMinimal.nordicPubTen.descendLinkageQueueEggWinExec object:nil];
}

- (void)brownPersist {
    [self.lossBoxChat reload];
}


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

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


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([MainMinimal headphoneAcrossMainSayPeakName] && WetSymbolsConfig.shared.tempPortionTokenBoostStroked.mapOrderDay.herFileExec) {
        [LocationView subRemote];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)hashClampButSize {
    UIWindow *mindfulWindow = [[VortexBusManager shared] broadcastOptWindow];
    UIEdgeInsets safe = mindfulWindow.safeAreaInsets;
    CGFloat photoBoxReset = 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 overhang] || [UIDevice kinOdd]) {//无刘海
            photoBoxReset = UIScreen.mainScreen.bounds.size.height*MainMinimal.presenceDuctilityGetMatchFunnel;
        }else {
            photoBoxReset = (UIScreen.mainScreen.bounds.size.height - safe.bottom)*MainMinimal.presenceDuctilityGetMatchFunnel;
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, photoBoxReset);
        
    }else { 
        if (![UIDevice overhang] || [UIDevice kinOdd]) {//无刘海
            photoBoxReset = UIScreen.mainScreen.bounds.size.width * MainMinimal.presenceDuctilityGetMatchFunnel;
        }else {
            if (orientation == UIInterfaceOrientationLandscapeRight) {
                photoBoxReset = (UIScreen.mainScreen.bounds.size.width - safe.left) * MainMinimal.presenceDuctilityGetMatchFunnel;
            }else {
                photoBoxReset = (UIScreen.mainScreen.bounds.size.width - safe.right) * MainMinimal.presenceDuctilityGetMatchFunnel;
            }
        }
        return CGSizeMake(photoBoxReset, UIScreen.mainScreen.bounds.size.height);
    }
}

- (void)chargingWalkCollisionCentersNautical {
    UIWindow *mindfulWindow = [[VortexBusManager shared] broadcastOptWindow];
    UIEdgeInsets safe = mindfulWindow.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.hashClampButSize);
        }];
    }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.hashClampButSize);
            }];
        }else {
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.left.mas_equalTo(0);
                make.size.mas_equalTo(self.hashClampButSize);
            }];
        }
    }
}

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

@end
