






#import "CaseSliceHoldViewController.h"
#import "ShearPeakManager.h"
#import "TimeTreeView.h"
#import "UIColor+KitColor.h"
#import "UIDevice+DayDevice.h"
#import "UIImage+EyeImage.h"
#import "TagBinRealConfig.h"


@implementation CaseSliceHoldViewController

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

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = NapEscaping.dueProducesDeviationAloneSatisfiedCap ? [UIColor evictionCreditAgeRejectHebrewStable:NapEscaping.dueProducesDeviationAloneSatisfiedCap]:UIColor.whiteColor;

    self.storageBars = self.offSubExits;
    [TimeTreeView diskEmpty];
    

    self.mightWasFar.opaque = NO;
    self.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0];
    
    [self.mightWasFar mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pintSuitable) name:NapEscaping.restoringWay.averageAcceptedTagMindSymmetricZoom object:nil];
}

- (void)pintSuitable {
    [self.mightWasFar reload];
}


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

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


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([NapEscaping compoundBusHandshakeMailTradName] && TagBinRealConfig.shared.cautionMacintoshAbortedMixIndexing.indexesReal.carFitChunk) {
        [TimeTreeView sugarShow];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)popFoundLessSize {
    UIWindow *menuUseWindow = [[ShearPeakManager shared] netTripleLawWindow];
    UIEdgeInsets safe = menuUseWindow.safeAreaInsets;
    CGFloat dayTrySetting = 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 realmCut] || [UIDevice choose]) {//无刘海
            dayTrySetting = UIScreen.mainScreen.bounds.size.height*NapEscaping.tabUploadedPercentAloneEqually;
        }else {
            dayTrySetting = (UIScreen.mainScreen.bounds.size.height - safe.bottom)*NapEscaping.tabUploadedPercentAloneEqually;
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, dayTrySetting);
        
    }else { 
        if (![UIDevice realmCut] || [UIDevice choose]) {//无刘海
            dayTrySetting = UIScreen.mainScreen.bounds.size.width * NapEscaping.tabUploadedPercentAloneEqually;
        }else {
            if (orientation == UIInterfaceOrientationLandscapeRight) {
                dayTrySetting = (UIScreen.mainScreen.bounds.size.width - safe.left) * NapEscaping.tabUploadedPercentAloneEqually;
            }else {
                dayTrySetting = (UIScreen.mainScreen.bounds.size.width - safe.right) * NapEscaping.tabUploadedPercentAloneEqually;
            }
        }
        return CGSizeMake(dayTrySetting, UIScreen.mainScreen.bounds.size.height);
    }
}

- (void)decipherMayRuleMagnitudeBeginning {
    UIWindow *menuUseWindow = [[ShearPeakManager shared] netTripleLawWindow];
    UIEdgeInsets safe = menuUseWindow.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.popFoundLessSize);
        }];
    }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.popFoundLessSize);
            }];
        }else {
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.left.mas_equalTo(0);
                make.size.mas_equalTo(self.popFoundLessSize);
            }];
        }
    }
}

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

@end
