






#import "OddSuggestViewController.h"
#import "ParentKitManager.h"
#import "MarkSameView.h"
#import "UIColor+SumColor.h"
#import "UIDevice+SonDevice.h"
#import "UIImage+SpaImage.h"
#import "WasPutBitsConfig.h"

@interface OddSuggestViewController ()

@property (nonatomic, strong) UIView * wonOneView;
@property (nonatomic, strong) UIImageView * subView;

@end

@implementation OddSuggestViewController

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

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = EventPinWho.decodingEncipherSheClientsTexturedPhase ? [UIColor subsetTeethFlipMidUsageAlong:EventPinWho.decodingEncipherSheClientsTexturedPhase]:UIColor.whiteColor;

    self.siblingsWax = self.roundTooMap;
    [MarkSameView lastSpace];
    
    self.wonOneView = [UIView new];
    self.wonOneView.backgroundColor = UIColor.whiteColor;
    [self.view addSubview:self.wonOneView];
    
    self.subView = [[UIImageView alloc] initWithImage:[UIImage zipRecoveryAcuteTowerWayName:EventPinWho.animatingYet.fourteenMisplacedProvisionTipSpaBar]];;
    [self.view addSubview:self.subView];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(carrierAbout) name:EventPinWho.animatingYet.armenianExporterDecayAxesSwedishYet object:nil];
}

- (void)carrierAbout {
    [self.timeWarning reload];
}

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

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


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([EventPinWho unlockedDynamicUserPromotionKernelsName] && WasPutBitsConfig.shared.tryTeaspoonsFathomsCursiveWaiting.panelGetNap.useBadAcute) {
        [MarkSameView menResign];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)startupLargeSize {
    if ([UIDevice redFun]) {
        return CGSizeMake(EventPinWho.pageRotateDownloadSubFlow, EventPinWho.pageRotateDownloadSubFlow);
    }
    UIWindow *showingWindow = [[ParentKitManager shared] distortedAskWindow];
    UIEdgeInsets safe = showingWindow.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 saveSwap]) {
            return CGSizeMake(UIScreen.mainScreen.bounds.size.width, EventPinWho.pageRotateDownloadSubFlow);
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, EventPinWho.pageRotateDownloadSubFlow + safe.bottom);
    }else {
        if (![UIDevice saveSwap]) {
            return CGSizeMake(EventPinWho.pageRotateDownloadSubFlow,UIScreen.mainScreen.bounds.size.height);
        }
        if (orientation == UIInterfaceOrientationLandscapeRight) {
            return CGSizeMake(EventPinWho.pageRotateDownloadSubFlow + safe.left,UIScreen.mainScreen.bounds.size.height);
        }else {
            return CGSizeMake(EventPinWho.pageRotateDownloadSubFlow + 5,UIScreen.mainScreen.bounds.size.height);
        }
    }
}

- (void)sceneFlatSideFurlongsDays {
    UIWindow *showingWindow = [[ParentKitManager shared] distortedAskWindow];
    UIEdgeInsets safe = showingWindow.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 redFun]) {
            self.wonOneView.layer.cornerRadius = 5.f;
            self.wonOneView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
        }
        [self.wonOneView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view.mas_top);
            make.left.right.equalTo(self.view);
            make.height.mas_equalTo(EventPinWho.animatingYet.failAreQuick);
        }];
        [self.subView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.wonOneView.mas_top);
            make.centerX.equalTo(self.view);
            make.size.mas_equalTo(CGSizeMake(EventPinWho.animatingYet.proposalBars, EventPinWho.animatingYet.leapSigmaSun));
        }];
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerX.bottom.mas_equalTo(0);
            make.size.mas_equalTo(self.startupLargeSize);
        }];
        [self.timeWarning mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.right.mas_equalTo(0);
            make.height.mas_equalTo(EventPinWho.pageRotateDownloadSubFlow);
        }];
        self.view.transform = CGAffineTransformMakeTranslation(0, self.startupLargeSize.height);
    }else {
        
        if ([UIDevice redFun]) {
            self.wonOneView.layer.cornerRadius = 5.f;
            self.wonOneView.layer.maskedCorners = kCALayerMaxXMaxYCorner | kCALayerMaxXMinYCorner;
        }
        [self.wonOneView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.view.mas_right);
            make.top.bottom.equalTo(self.view);
            make.width.mas_equalTo(EventPinWho.animatingYet.failAreQuick);
        }];
        UIImage *pointTwoImage = [UIImage zipRecoveryAcuteTowerWayName:EventPinWho.animatingYet.fourteenMisplacedProvisionTipSpaBar];
        UIImage *topTalkImage = [UIImage imageWithCGImage:pointTwoImage.CGImage
                                                    scale:pointTwoImage.scale
                                              orientation:UIImageOrientationRight]; 
        self.subView.image = topTalkImage;
        [self.subView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.wonOneView.mas_right);
            make.centerY.equalTo(self.view);
            make.size.mas_equalTo(CGSizeMake(EventPinWho.animatingYet.leapSigmaSun, EventPinWho.animatingYet.proposalBars));
        }];
        [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.centerY.left.mas_equalTo(0);
            make.size.mas_equalTo(self.startupLargeSize);
        }];
        [self.timeWarning mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.right.mas_equalTo(0);
            make.width.mas_equalTo(EventPinWho.pageRotateDownloadSubFlow);
        }];
        self.view.transform = CGAffineTransformMakeTranslation(-self.startupLargeSize.width, 0);
    }
    [UIView animateWithDuration:0.3 animations:^{
        self.view.transform = CGAffineTransformIdentity;
    }];
}

- (void)salientBaselineReadableUnifiedReminder:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    extents(self);
    [super salientBaselineReadableUnifiedReminder: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.startupLargeSize.height);;
        } completion:^(BOOL finished) {
            [[ParentKitManager shared] pressedCutRestoresSideDecreaseChangeViewController:self.navigationController];
        }];
    }else {
        [UIView animateWithDuration:0.3 animations:^{
            self.view.transform = CGAffineTransformMakeTranslation(-weakself.startupLargeSize.width, 0);
        } completion:^(BOOL finished) {
            [[ParentKitManager shared] pressedCutRestoresSideDecreaseChangeViewController:weakself.navigationController];
        }];
    }
}

@end
