






#import "FailureDayViewController.h"
#import "CutStringManager.h"
#import "DispatchView.h"
#import "UIColor+TapColor.h"
#import "UIDevice+MaxDevice.h"
#import "UIImage+WayImage.h"
#import "MarkDivideConfig.h"

@interface FailureDayViewController ()

@property (nonatomic, strong) UIView * bagOddView;
@property (nonatomic, strong) UIImageView * putView;

@end

@implementation FailureDayViewController

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

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = CupDenyLeap.contentsSpatialModalMidAvailableReachable ? [UIColor fatChromeHomepageRefinedIntensityAnalysis:CupDenyLeap.contentsSpatialModalMidAvailableReachable]:UIColor.whiteColor;

    self.withinAlien = self.yetLearnTab;
    [DispatchView areExtend];
    
    self.bagOddView = [UIView new];
    self.bagOddView.backgroundColor = UIColor.whiteColor;
    [self.view addSubview:self.bagOddView];
    
    self.putView = [[UIImageView alloc] initWithImage:[UIImage messagingPictureEggRuleDetachName:CupDenyLeap.rarePutOther.illRecycleOperateOffCollectedHome]];;
    [self.view addSubview:self.putView];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(chunkSafeSaw) name:CupDenyLeap.rarePutOther.dividerLetterNineReservedTalkOur object:nil];
}

- (void)chunkSafeSaw {
    [self.withTagItem reload];
}

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

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


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([CupDenyLeap pascalCubeButRollBecomeName] && MarkDivideConfig.shared.playLettishSymbolsHeapSpoken.acceptHours.winWinSplat) {
        [DispatchView fiberWill];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)slopeBitHeadSize {
    if ([UIDevice funIcy]) {
        return CGSizeMake(CupDenyLeap.functionAssistiveHexMenMaterial, CupDenyLeap.functionAssistiveHexMenMaterial);
    }
    UIWindow *execRowWindow = [[CutStringManager shared] wetEarlyCropWindow];
    UIEdgeInsets safe = execRowWindow.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) {
        if (![UIDevice hasAcute]) {
            return CGSizeMake(UIScreen.mainScreen.bounds.size.width, CupDenyLeap.functionAssistiveHexMenMaterial);
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, CupDenyLeap.functionAssistiveHexMenMaterial + safe.bottom);
    }else {
        if (![UIDevice hasAcute]) {
            return CGSizeMake(CupDenyLeap.functionAssistiveHexMenMaterial,UIScreen.mainScreen.bounds.size.height);
        }
        if (orientation == UIInterfaceOrientationLandscapeRight) {
            return CGSizeMake(CupDenyLeap.functionAssistiveHexMenMaterial + safe.left,UIScreen.mainScreen.bounds.size.height);
        }else {
            return CGSizeMake(CupDenyLeap.functionAssistiveHexMenMaterial + 5,UIScreen.mainScreen.bounds.size.height);
        }
    }
}

- (void)strideResourcesWithinInterInstalls {
    UIWindow *execRowWindow = [[CutStringManager shared] wetEarlyCropWindow];
    UIEdgeInsets safe = execRowWindow.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) {
        
        if ([UIDevice funIcy]) {
            self.bagOddView.layer.cornerRadius = 5.f;
            self.bagOddView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
        }
        [self.bagOddView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view.mas_top);
            make.left.right.equalTo(self.view);
            make.height.mas_equalTo(CupDenyLeap.rarePutOther.builderLiner);
        }];
        [self.putView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.bagOddView.mas_top);
            make.centerX.equalTo(self.view);
            make.size.mas_equalTo(CGSizeMake(CupDenyLeap.rarePutOther.extentRedSub, CupDenyLeap.rarePutOther.fadeBarMoire));
        }];
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerX.bottom.mas_equalTo(0);
            make.size.mas_equalTo(self.slopeBitHeadSize);
        }];
        [self.withTagItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.right.mas_equalTo(0);
            make.height.mas_equalTo(CupDenyLeap.functionAssistiveHexMenMaterial);
        }];
        self.view.transform = CGAffineTransformMakeTranslation(0, self.slopeBitHeadSize.height);
    }else {
        
        if ([UIDevice funIcy]) {
            self.bagOddView.layer.cornerRadius = 5.f;
            self.bagOddView.layer.maskedCorners = kCALayerMaxXMaxYCorner | kCALayerMaxXMinYCorner;
        }
        [self.bagOddView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.view.mas_right);
            make.top.bottom.equalTo(self.view);
            make.width.mas_equalTo(CupDenyLeap.rarePutOther.builderLiner);
        }];
        UIImage *jouleCapImage = [UIImage messagingPictureEggRuleDetachName:CupDenyLeap.rarePutOther.illRecycleOperateOffCollectedHome];
        UIImage *bodySayImage = [UIImage imageWithCGImage:jouleCapImage.CGImage
                                                    scale:jouleCapImage.scale
                                              orientation:UIImageOrientationRight]; 
        self.putView.image = bodySayImage;
        [self.putView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.bagOddView.mas_right);
            make.centerY.equalTo(self.view);
            make.size.mas_equalTo(CGSizeMake(CupDenyLeap.rarePutOther.fadeBarMoire, CupDenyLeap.rarePutOther.extentRedSub));
        }];
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerY.left.mas_equalTo(0);
            make.size.mas_equalTo(self.slopeBitHeadSize);
        }];
        [self.withTagItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.right.mas_equalTo(0);
            make.width.mas_equalTo(CupDenyLeap.functionAssistiveHexMenMaterial);
        }];
        self.view.transform = CGAffineTransformMakeTranslation(-self.slopeBitHeadSize.width, 0);
    }
    [UIView animateWithDuration:0.3 animations:^{
        self.view.transform = CGAffineTransformIdentity;
    }];
}

- (void)hardBlurTatarEntitledHex:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    justWay(self);
    [super hardBlurTatarEntitledHex:touches withEvent:event];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
#pragma clang diagnostic pop
    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
        [UIView animateWithDuration:0.3 animations:^{
            weakself.view.transform = CGAffineTransformMakeTranslation(0, weakself.slopeBitHeadSize.height);;
        } completion:^(BOOL finished) {
            [[CutStringManager shared] initiatedOldTradBagSnapshotMostlyViewController:self.navigationController];
        }];
    }else {
        [UIView animateWithDuration:0.3 animations:^{
            self.view.transform = CGAffineTransformMakeTranslation(-weakself.slopeBitHeadSize.width, 0);
        } completion:^(BOOL finished) {
            [[CutStringManager shared] initiatedOldTradBagSnapshotMostlyViewController:weakself.navigationController];
        }];
    }
}

@end
