






#import "LogPointLinerViewController.h"
#import "AnyToast.h"
#import "LookupInfo.h"

@interface LogPointLinerViewController ()

@property (nonatomic, strong) UIImageView *borderPopView;
@property (nonatomic, strong) UIButton *sawHairCharButton;
@property (nonatomic, strong) UIView *ropePagerView;
@property (nonatomic, strong) UILabel *longUsedLabel;
@property (nonatomic, strong) UITextField *fixExitsCostTextField;
@property (nonatomic, strong) UITextField *emergencyClipTextField;
@end

@implementation LogPointLinerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.rawPinkCarButton.hidden = YES;
    
    if ([LookupInfo localHandClosestEmergencyMixImage]) {
        self.borderPopView = [[UIImageView alloc] initWithImage:[LookupInfo localHandClosestEmergencyMixImage]];
        [self.view addSubview:self.borderPopView];
        self.borderPopView.hidden = YES;
        [self.borderPopView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(VitalityTab.noneMidMicro.borderResume);
            make.left.equalTo(self.pinchHaveButton.mas_right);
            make.top.equalTo(self.view).offset(VitalityTab.noneMidMicro.lighterSmall);
        }];
    }
    
    self.ropePagerView = [VitalityTab ropePagerView];
    self.ropePagerView.hidden = YES;
    [self.view addSubview:self.ropePagerView];
    [self.ropePagerView mas_makeConstraints:^(MASConstraintMaker *make) {
        if ([LookupInfo localHandClosestEmergencyMixImage]) {
            make.centerY.equalTo(self.borderPopView);
            make.left.equalTo(self.borderPopView.mas_right).offset(VitalityTab.noneMidMicro.phoneticArt);
        }else {
            make.top.equalTo(self.view).offset(VitalityTab.noneMidMicro.lighterSmall);
            make.left.equalTo(self.pinchHaveButton.mas_right).offset(VitalityTab.noneMidMicro.phoneticArt);
        }
        make.right.equalTo(self.rawPinkCarButton.mas_left);
        make.height.mas_equalTo(VitalityTab.noneMidMicro.borderResume);
    }];
    
    self.longUsedLabel = [VitalityTab shelfUploadedLogAndGoogle:VitalityTab.foggyCycleUnit.ourCurlCupScrollArmour];
    self.longUsedLabel.numberOfLines = 0;
    [self.view addSubview:self.longUsedLabel];
    [self.longUsedLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(VitalityTab.noneMidMicro.areAllowable);
        make.left.mas_equalTo(VitalityTab.noneMidMicro.visualWaySaw);
        make.right.mas_equalTo(-VitalityTab.noneMidMicro.visualWaySaw);
    }];
    
    
    self.fixExitsCostTextField = [VitalityTab mainArmSinNarrativeAccessoryAccount];
    self.fixExitsCostTextField.enabled = NO;
    self.fixExitsCostTextField.text = self.moleShotRaw[VitalityTab.noneMidMicro.fullCardAgeName];
    [self baseValueKinBarUnorderedUsesView:self.fixExitsCostTextField text:VitalityTab.foggyCycleUnit.busyOrderEffortSlopeGathering];
    [self.view addSubview:self.fixExitsCostTextField];
    [self.fixExitsCostTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.longUsedLabel.mas_bottom).offset(VitalityTab.noneMidMicro.bikeReliable);
        make.left.mas_equalTo(VitalityTab.noneMidMicro.dispatchHand);
        make.right.mas_equalTo(-VitalityTab.noneMidMicro.dispatchHand);
        make.height.mas_equalTo(VitalityTab.noneMidMicro.minEmailRows);
    }];
    
    
    self.emergencyClipTextField = [VitalityTab mainArmSinNarrativeAccessoryAccount];
    self.emergencyClipTextField.enabled = NO;
    self.emergencyClipTextField.text = self.moleShotRaw[VitalityTab.noneMidMicro.modeNeutralKey];
    [self baseValueKinBarUnorderedUsesView:self.emergencyClipTextField text:VitalityTab.foggyCycleUnit.averageReceivedCollapseSettingSupply];
    [self.view addSubview:self.emergencyClipTextField];
    [self.emergencyClipTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.fixExitsCostTextField.mas_bottom).offset(VitalityTab.noneMidMicro.bikeReliable);
        make.left.right.equalTo(self.fixExitsCostTextField);
        make.height.mas_equalTo(VitalityTab.noneMidMicro.minEmailRows);
    }];
    
    
    UIButton *cancelTwoButton = [VitalityTab cousinAlertRomanVibrancyIdleColor:VitalityTab.foggyCycleUnit.tooOnlineFractionsFlatProvince];
    [cancelTwoButton addTarget:self action:@selector(denyTwoDistanceFrontLenientAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:cancelTwoButton];
    [cancelTwoButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.emergencyClipTextField.mas_bottom).offset(VitalityTab.noneMidMicro.bikeReliable);
        make.left.right.equalTo(self.emergencyClipTextField);
        make.height.mas_equalTo(VitalityTab.noneMidMicro.borderResume);
    }];
    
    
    self.sawHairCharButton = [VitalityTab allEngravedAddTeethThe:VitalityTab.foggyCycleUnit.jobKilovoltsAnimatedCrossSkinCorrected];
    [self.sawHairCharButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [self.sawHairCharButton addTarget:self action:@selector(affineSpellPrecisionDirectoryExternAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.sawHairCharButton];
    [self.sawHairCharButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(cancelTwoButton.mas_bottom).offset(VitalityTab.noneMidMicro.linkWinHard);
        make.centerX.equalTo(self.view);
    }];
}

- (void)baseValueKinBarUnorderedUsesView:(UITextField *)textField text:(NSString *)text
{
    CGRect frame = {{0,0},CGSizeMake(VitalityTab.noneMidMicro.borderResume, VitalityTab.noneMidMicro.minEmailRows)};
    UILabel *useMonth = [[UILabel alloc] initWithFrame:frame];
    useMonth.text = text;
    useMonth.textColor = UIColor.redColor;
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.leftView = useMonth;
}

- (void)affineSpellPrecisionDirectoryExternAction:(UIButton *)sender {
    [[InterlaceManager shared] suffixBackupSchoolResourceLogBlinkViewController:self.navigationController];
}

- (void)denyTwoDistanceFrontLenientAction:(UIButton *)sender {
    sender.hidden = YES;
    self.longUsedLabel.hidden = YES;
    self.ropePagerView.hidden = NO;
    self.borderPopView.hidden = NO;
    self.sawHairCharButton.hidden = YES;
    
    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo(CGSizeMake(VitalityTab.noneMidMicro.bufferDeliverBikeDiastolicSpecifierWidth, VitalityTab.noneMidMicro.zoomPairUnlikelySlopeWaxMargins-VitalityTab.noneMidMicro.youMixPascal));
    }];
    [self.fixExitsCostTextField mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.ropePagerView.mas_bottom).offset(VitalityTab.noneMidMicro.bikeReliable);
    }];
    [self.view layoutIfNeeded];
    
    BOOL slash = [[[[NSBundle mainBundle] infoDictionary] allKeys] containsObject:VitalityTab.noneMidMicro.endpointUtilityEstablishCreditUnableFourteenOpacity];
    if (!slash) {
        self.rawPinkCarButton.hidden = NO;
        [SonAlertView presenceFloatMetadataCompoundPreparingEgg:nil message:VitalityTab.foggyCycleUnit.earIncorrectGroupElevationAfter completion:nil];
        return;
    }
    CGSize size = self.view.frame.size;
    size.height -= VitalityTab.noneMidMicro.sockSunClaim;
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:vowelDietaryExpiresLaotianExistingStylistic:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image vowelDietaryExpiresLaotianExistingStylistic:(NSError *)error contextInfo:(void *)contextInfo
{
    
    if(!error){
        [[InterlaceManager shared] suffixBackupSchoolResourceLogBlinkViewController:self.navigationController];
        [AnyToast forkAir:VitalityTab.foggyCycleUnit.eggYetBringMonotonicVisited];
    }else {
        self.rawPinkCarButton.hidden = NO;
        [SonAlertView presenceFloatMetadataCompoundPreparingEgg:nil message:VitalityTab.foggyCycleUnit.earIncorrectGroupElevationAfter completion:nil];
    }
}

@end
