






#import "FootersDirectViewController.h"
#import "PrimeArtsManager.h"
#import "TakeBendView.h"
#import "UIColor+TenColor.h"
#import "UIDevice+YouDevice.h"
#import "UIImage+RetImage.h"
#import "DoneTryTenConfig.h"


@implementation FootersDirectViewController

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

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = SaveWayTaps.oppositeIncomingLosePeerSongFar ? [UIColor googleRespondLiftReversePrepTelephony:SaveWayTaps.oppositeIncomingLosePeerSongFar]:UIColor.whiteColor;

    self.farRecorded = self.mindFastTab;
    [TakeBendView filenames];
    

    self.externMeter.opaque = NO;
    self.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0];
    
    [self.externMeter mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(centeringRun) name:SaveWayTaps.offerHitEasy.anchoringPutHandTradSwitchEra object:nil];
}

- (void)centeringRun {
    [self.externMeter reload];
}


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

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


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([SaveWayTaps numericSubstringAssignChecksumLargeName] && DoneTryTenConfig.shared.writingMoodTapMidSpecified.designInuit.floatSixTap) {
        [TakeBendView largerLaw];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)tryDetectionSize {
    UIWindow *yetHostWindow = [[PrimeArtsManager shared] staleButLeftWindow];
    UIEdgeInsets safe = yetHostWindow.safeAreaInsets;
    CGFloat capFitFastSub = 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 multiple] || [UIDevice linear]) {//无刘海
            capFitFastSub = UIScreen.mainScreen.bounds.size.height*SaveWayTaps.ambiguitySeventeenWidthDownloadsTouch;
        }else {
            capFitFastSub = (UIScreen.mainScreen.bounds.size.height - safe.bottom)*SaveWayTaps.ambiguitySeventeenWidthDownloadsTouch;
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, capFitFastSub);
        
    }else { 
        if (![UIDevice multiple] || [UIDevice linear]) {//无刘海
            capFitFastSub = UIScreen.mainScreen.bounds.size.width * SaveWayTaps.ambiguitySeventeenWidthDownloadsTouch;
        }else {
            if (orientation == UIInterfaceOrientationLandscapeRight) {
                capFitFastSub = (UIScreen.mainScreen.bounds.size.width - safe.left) * SaveWayTaps.ambiguitySeventeenWidthDownloadsTouch;
            }else {
                capFitFastSub = (UIScreen.mainScreen.bounds.size.width - safe.right) * SaveWayTaps.ambiguitySeventeenWidthDownloadsTouch;
            }
        }
        return CGSizeMake(capFitFastSub, UIScreen.mainScreen.bounds.size.height);
    }
}

- (void)loadingAirRestExternHockey {
    UIWindow *yetHostWindow = [[PrimeArtsManager shared] staleButLeftWindow];
    UIEdgeInsets safe = yetHostWindow.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.tryDetectionSize);
        }];
    }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.tryDetectionSize);
            }];
        }else {
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.left.mas_equalTo(0);
                make.size.mas_equalTo(self.tryDetectionSize);
            }];
        }
    }
}

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

@end
