






#import "PreviewsPitchViewController.h"
#import "AboutLikeManager.h"
#import "IdentityView.h"
#import "UIColor+LogColor.h"
#import "UIDevice+BagDevice.h"
#import "UIImage+KeyImage.h"
#import "PopPoloAddConfig.h"


@implementation PreviewsPitchViewController

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

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = PaceDownHue.headlineInvitedParseSphericalTransientHelp ? [UIColor cutMealIdentifyApertureAssumeNordic:PaceDownHue.headlineInvitedParseSphericalTransientHelp]:UIColor.whiteColor;

    self.traverseBad = self.hisEllipsis;
    [IdentityView soundPlay];
    

    self.splatSexCat.opaque = NO;
    self.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0];
    
    [self.splatSexCat mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(queryLinkage) name:PaceDownHue.absoluteAuto.convertedDeriveIcyEncryptedUndoChina object:nil];
}

- (void)queryLinkage {
    [self.splatSexCat reload];
}


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

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


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([PaceDownHue retainDistantDocumentEmbeddingFoundName] && PopPoloAddConfig.shared.rejectPutIconPasswordsPace.mapRearDust.wordRawWork) {
        [IdentityView toneSplat];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)putListFirstSize {
    UIWindow *filtersWindow = [[AboutLikeManager shared] scriptRhythmWindow];
    UIEdgeInsets safe = filtersWindow.safeAreaInsets;
    CGFloat bedAboutShelf = 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 whiteMid] || [UIDevice german]) {//无刘海
            bedAboutShelf = UIScreen.mainScreen.bounds.size.height*PaceDownHue.gopherQueryElapsedCollisionBurst;
        }else {
            bedAboutShelf = (UIScreen.mainScreen.bounds.size.height - safe.bottom)*PaceDownHue.gopherQueryElapsedCollisionBurst;
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, bedAboutShelf);
        
    }else { 
        if (![UIDevice whiteMid] || [UIDevice german]) {//无刘海
            bedAboutShelf = UIScreen.mainScreen.bounds.size.width * PaceDownHue.gopherQueryElapsedCollisionBurst;
        }else {
            if (orientation == UIInterfaceOrientationLandscapeRight) {
                bedAboutShelf = (UIScreen.mainScreen.bounds.size.width - safe.left) * PaceDownHue.gopherQueryElapsedCollisionBurst;
            }else {
                bedAboutShelf = (UIScreen.mainScreen.bounds.size.width - safe.right) * PaceDownHue.gopherQueryElapsedCollisionBurst;
            }
        }
        return CGSizeMake(bedAboutShelf, UIScreen.mainScreen.bounds.size.height);
    }
}

- (void)rollBrownFlatnessUnloadBasic {
    UIWindow *filtersWindow = [[AboutLikeManager shared] scriptRhythmWindow];
    UIEdgeInsets safe = filtersWindow.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.putListFirstSize);
        }];
    }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.putListFirstSize);
            }];
        }else {
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.left.mas_equalTo(0);
                make.size.mas_equalTo(self.putListFirstSize);
            }];
        }
    }
}

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

@end
