






#import "HeapSelectorsViewController.h"
#import "VolumeAddManager.h"
#import "MoveFontView.h"
#import "UIColor+HueColor.h"
#import "UIDevice+KinDevice.h"
#import "UIImage+EyeImage.h"
#import "HisCapForkConfig.h"


@implementation HeapSelectorsViewController

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

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = HisTwoEject.airImproperDublinBadRedoReference ? [UIColor lappishPulseArcheryCompactKilometerNet:HisTwoEject.airImproperDublinBadRedoReference]:UIColor.whiteColor;

    self.childWeekly = self.setupHowAdd;
    [MoveFontView stopHuman];
    

    self.trapSampler.opaque = NO;
    self.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0];
    
    [self.trapSampler mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(featAliveYou) name:HisTwoEject.mildVitalEar.capableJustAirSeparateYahooCube object:nil];
}

- (void)featAliveYou {
    [self.trapSampler reload];
}


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

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


//}

-(void)viewWillDisappear:(BOOL)animated {
    if ([HisTwoEject profilePasswordInuitIcyReverseName] && HisCapForkConfig.shared.subfamilyLossyKitOwnerConsumes.barrierPlus.leapPastSon) {
        [MoveFontView smileSink];
    }
    [super viewWillDisappear:animated];
    
}

- (CGSize)seeMomentarySize {
    UIWindow *butHardWindow = [[VolumeAddManager shared] otherKeyOnceWindow];
    UIEdgeInsets safe = butHardWindow.safeAreaInsets;
    CGFloat headWatchDown = 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 eightPub] || [UIDevice kitNap]) {//无刘海
            headWatchDown = UIScreen.mainScreen.bounds.size.height*HisTwoEject.snapshotOverrideWaterNegativeSpeed;
        }else {
            headWatchDown = (UIScreen.mainScreen.bounds.size.height - safe.bottom)*HisTwoEject.snapshotOverrideWaterNegativeSpeed;
        }
        return CGSizeMake(UIScreen.mainScreen.bounds.size.width, headWatchDown);
        
    }else { 
        if (![UIDevice eightPub] || [UIDevice kitNap]) {//无刘海
            headWatchDown = UIScreen.mainScreen.bounds.size.width * HisTwoEject.snapshotOverrideWaterNegativeSpeed;
        }else {
            if (orientation == UIInterfaceOrientationLandscapeRight) {
                headWatchDown = (UIScreen.mainScreen.bounds.size.width - safe.left) * HisTwoEject.snapshotOverrideWaterNegativeSpeed;
            }else {
                headWatchDown = (UIScreen.mainScreen.bounds.size.width - safe.right) * HisTwoEject.snapshotOverrideWaterNegativeSpeed;
            }
        }
        return CGSizeMake(headWatchDown, UIScreen.mainScreen.bounds.size.height);
    }
}

- (void)peakRaceVideoShadowSignaling {
    UIWindow *butHardWindow = [[VolumeAddManager shared] otherKeyOnceWindow];
    UIEdgeInsets safe = butHardWindow.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.seeMomentarySize);
        }];
    }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.seeMomentarySize);
            }];
        }else {
            [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.left.mas_equalTo(0);
                make.size.mas_equalTo(self.seeMomentarySize);
            }];
        }
    }
}

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

@end
