






#import "AlignCallCardViewController.h"
#import "TryToast.h"
#import "DanishInfo.h"

@interface AlignCallCardViewController ()

@property (nonatomic, strong) UIImageView *interruptView;
@property (nonatomic, strong) UIButton *tintRuleSeeButton;
@property (nonatomic, strong) UIView *addressesView;
@property (nonatomic, strong) UILabel *ownYearsLabel;
@property (nonatomic, strong) UITextField *reasonDidMixTextField;
@property (nonatomic, strong) UITextField *adaptiveInuitTextField;
@end

@implementation AlignCallCardViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.drawingMidButton.hidden = YES;
    
    if ([DanishInfo elevationMutableOurMaxKernelImage]) {
        self.interruptView = [[UIImageView alloc] initWithImage:[DanishInfo elevationMutableOurMaxKernelImage]];
        [self.view addSubview:self.interruptView];
        self.interruptView.hidden = YES;
        [self.interruptView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(SafeTradEar.smallestMany.fixTransient);
            make.left.equalTo(self.modelBoldButton.mas_right);
            make.top.equalTo(self.view).offset(SafeTradEar.smallestMany.gigabytesYet);
        }];
    }
    
    self.addressesView = [SafeTradEar addressesView];
    self.addressesView.hidden = YES;
    [self.view addSubview:self.addressesView];
    [self.addressesView mas_makeConstraints:^(MASConstraintMaker *make) {
        if ([DanishInfo elevationMutableOurMaxKernelImage]) {
            make.centerY.equalTo(self.interruptView);
            make.left.equalTo(self.interruptView.mas_right).offset(SafeTradEar.smallestMany.tensionBody);
        }else {
            make.top.equalTo(self.view).offset(SafeTradEar.smallestMany.gigabytesYet);
            make.left.equalTo(self.modelBoldButton.mas_right).offset(SafeTradEar.smallestMany.tensionBody);
        }
        make.right.equalTo(self.drawingMidButton.mas_left);
        make.height.mas_equalTo(SafeTradEar.smallestMany.fixTransient);
    }];
    
    self.ownYearsLabel = [SafeTradEar givenTamilPrintableIterativeInterior:SafeTradEar.bankRowTapsAsk.failureBeganRelevanceEarFat];
    self.ownYearsLabel.numberOfLines = 0;
    [self.view addSubview:self.ownYearsLabel];
    [self.ownYearsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(SafeTradEar.smallestMany.mayCameraRet);
        make.left.mas_equalTo(SafeTradEar.smallestMany.failureEvent);
        make.right.mas_equalTo(-SafeTradEar.smallestMany.failureEvent);
    }];
    
    
    self.reasonDidMixTextField = [SafeTradEar nearAdvancesLookNewsstandPascalAccount];
    self.reasonDidMixTextField.enabled = NO;
    self.reasonDidMixTextField.text = self.cupDropHour[SafeTradEar.smallestMany.tooUnitLoudName];
    [self shearMomentaryAcquireLowAudiencesActiveView:self.reasonDidMixTextField text:SafeTradEar.bankRowTapsAsk.exceededKeepSignatureFileUser];
    [self.view addSubview:self.reasonDidMixTextField];
    [self.reasonDidMixTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.ownYearsLabel.mas_bottom).offset(SafeTradEar.smallestMany.paddleOutlet);
        make.left.mas_equalTo(SafeTradEar.smallestMany.farFormPivot);
        make.right.mas_equalTo(-SafeTradEar.smallestMany.farFormPivot);
        make.height.mas_equalTo(SafeTradEar.smallestMany.swipeMaxTool);
    }];
    
    
    self.adaptiveInuitTextField = [SafeTradEar nearAdvancesLookNewsstandPascalAccount];
    self.adaptiveInuitTextField.enabled = NO;
    self.adaptiveInuitTextField.text = self.cupDropHour[SafeTradEar.smallestMany.neverWaxDidKey];
    [self shearMomentaryAcquireLowAudiencesActiveView:self.adaptiveInuitTextField text:SafeTradEar.bankRowTapsAsk.chineseEuropeanDitherBigGuarani];
    [self.view addSubview:self.adaptiveInuitTextField];
    [self.adaptiveInuitTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.reasonDidMixTextField.mas_bottom).offset(SafeTradEar.smallestMany.paddleOutlet);
        make.left.right.equalTo(self.reasonDidMixTextField);
        make.height.mas_equalTo(SafeTradEar.smallestMany.swipeMaxTool);
    }];
    
    
    UIButton *retryHourButton = [SafeTradEar endRedImageAccessingGrandauntColor:SafeTradEar.bankRowTapsAsk.advisedVolumeStrokingDescribesRejection];
    [retryHourButton addTarget:self action:@selector(appendPickerCheckoutMenSubsetAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:retryHourButton];
    [retryHourButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.adaptiveInuitTextField.mas_bottom).offset(SafeTradEar.smallestMany.paddleOutlet);
        make.left.right.equalTo(self.adaptiveInuitTextField);
        make.height.mas_equalTo(SafeTradEar.smallestMany.fixTransient);
    }];
    
    
    self.tintRuleSeeButton = [SafeTradEar eraserSupportedCapturesVitalAdaptive:SafeTradEar.bankRowTapsAsk.policiesWriteElapsedRawSignRenewal];
    [self.tintRuleSeeButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [self.tintRuleSeeButton addTarget:self action:@selector(birthFigureWaxAwayAssertionAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.tintRuleSeeButton];
    [self.tintRuleSeeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(retryHourButton.mas_bottom).offset(SafeTradEar.smallestMany.eggDissolve);
        make.centerX.equalTo(self.view);
    }];
}

- (void)shearMomentaryAcquireLowAudiencesActiveView:(UITextField *)textField text:(NSString *)text
{
    CGRect frame = {{0,0},CGSizeMake(SafeTradEar.smallestMany.fixTransient, SafeTradEar.smallestMany.swipeMaxTool)};
    UILabel *tryDutch = [[UILabel alloc] initWithFrame:frame];
    tryDutch.text = text;
    tryDutch.textColor = UIColor.redColor;
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.leftView = tryDutch;
}

- (void)birthFigureWaxAwayAssertionAction:(UIButton *)sender {
    [[EnergySixManager shared] teaspoonsRowCursiveFactIdleStepViewController:self.navigationController];
}

- (void)appendPickerCheckoutMenSubsetAction:(UIButton *)sender {
    sender.hidden = YES;
    self.ownYearsLabel.hidden = YES;
    self.addressesView.hidden = NO;
    self.interruptView.hidden = NO;
    self.tintRuleSeeButton.hidden = YES;
    
    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo(CGSizeMake(SafeTradEar.smallestMany.showingSexAssistiveAccurateLoadingWidth, SafeTradEar.smallestMany.encodeHeadlineViewUplinkFocusesSocket-SafeTradEar.smallestMany.popTryArtery));
    }];
    [self.reasonDidMixTextField mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.addressesView.mas_bottom).offset(SafeTradEar.smallestMany.paddleOutlet);
    }];
    [self.view layoutIfNeeded];
    
    BOOL waist = [[[[NSBundle mainBundle] infoDictionary] allKeys] containsObject:SafeTradEar.smallestMany.stoneMainWireCommitBoxExpensiveTag];
    if (!waist) {
        self.drawingMidButton.hidden = NO;
        [NetAlertView itsBlendEarlierPlusAssameseHas:nil message:SafeTradEar.bankRowTapsAsk.directDuctilitySawLegalMaterial completion:nil];
        return;
    }
    CGSize size = self.view.frame.size;
    size.height -= SafeTradEar.smallestMany.sunBeginMany;
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:waitingTipCursorIntentPagerEast:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image waitingTipCursorIntentPagerEast:(NSError *)error contextInfo:(void *)contextInfo
{
    
    if(!error){
        [[EnergySixManager shared] teaspoonsRowCursiveFactIdleStepViewController:self.navigationController];
        [TryToast autoSex:SafeTradEar.bankRowTapsAsk.inspiredScaleSourcesTeacherLimit];
    }else {
        self.drawingMidButton.hidden = NO;
        [NetAlertView itsBlendEarlierPlusAssameseHas:nil message:SafeTradEar.bankRowTapsAsk.directDuctilitySawLegalMaterial completion:nil];
    }
}

@end
