






#import "WinMovieStaleViewController.h"
#import "KeyToast.h"
#import "YouTopInfo.h"

@interface WinMovieStaleViewController ()

@property (nonatomic, strong) UIImageView *sinkAlongView;
@property (nonatomic, strong) UIButton *openWideMayButton;
@property (nonatomic, strong) UIView *factorHowView;
@property (nonatomic, strong) UILabel *gramGolfLabel;
@property (nonatomic, strong) UITextField *manConverterTextField;
@property (nonatomic, strong) UITextField *thinMakeEnterTextField;
@end

@implementation WinMovieStaleViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.bitLessEggButton.hidden = YES;
    
    if ([YouTopInfo samplesPassiveFilterTwentyCaloriesImage]) {
        self.sinkAlongView = [[UIImageView alloc] initWithImage:[YouTopInfo samplesPassiveFilterTwentyCaloriesImage]];
        [self.view addSubview:self.sinkAlongView];
        self.sinkAlongView.hidden = YES;
        [self.sinkAlongView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(MouthOunces.logTwelveEnd.kilowattsArt);
            make.left.equalTo(self.execAlarmButton.mas_right);
            make.top.equalTo(self.view).offset(MouthOunces.logTwelveEnd.oldBandUnify);
        }];
    }
    
    self.factorHowView = [MouthOunces factorHowView];
    self.factorHowView.hidden = YES;
    [self.view addSubview:self.factorHowView];
    [self.factorHowView mas_makeConstraints:^(MASConstraintMaker *make) {
        if ([YouTopInfo samplesPassiveFilterTwentyCaloriesImage]) {
            make.centerY.equalTo(self.sinkAlongView);
            make.left.equalTo(self.sinkAlongView.mas_right).offset(MouthOunces.logTwelveEnd.assignTrash);
        }else {
            make.top.equalTo(self.view).offset(MouthOunces.logTwelveEnd.oldBandUnify);
            make.left.equalTo(self.execAlarmButton.mas_right).offset(MouthOunces.logTwelveEnd.assignTrash);
        }
        make.right.equalTo(self.bitLessEggButton.mas_left);
        make.height.mas_equalTo(MouthOunces.logTwelveEnd.kilowattsArt);
    }];
    
    self.gramGolfLabel = [MouthOunces chestAudiencesBlendIncrementReply:MouthOunces.chatRingCharge.localityManExpandingHitCan];
    self.gramGolfLabel.numberOfLines = 0;
    [self.view addSubview:self.gramGolfLabel];
    [self.gramGolfLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(MouthOunces.logTwelveEnd.binPashtoDue);
        make.left.mas_equalTo(MouthOunces.logTwelveEnd.soloistRaise);
        make.right.mas_equalTo(-MouthOunces.logTwelveEnd.soloistRaise);
    }];
    
    
    self.manConverterTextField = [MouthOunces bigEmergencyFoldWaitingPersonalAccount];
    self.manConverterTextField.enabled = NO;
    self.manConverterTextField.text = self.rareMarkTap[MouthOunces.logTwelveEnd.flowJumpSheName];
    [self mildOveragePublisherStylePositionsReversingView:self.manConverterTextField text:MouthOunces.chatRingCharge.yellowResultPedometerSonMajor];
    [self.view addSubview:self.manConverterTextField];
    [self.manConverterTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.gramGolfLabel.mas_bottom).offset(MouthOunces.logTwelveEnd.swedishValue);
        make.left.mas_equalTo(MouthOunces.logTwelveEnd.privacyNorth);
        make.right.mas_equalTo(-MouthOunces.logTwelveEnd.privacyNorth);
        make.height.mas_equalTo(MouthOunces.logTwelveEnd.leftSmallTop);
    }];
    
    
    self.thinMakeEnterTextField = [MouthOunces bigEmergencyFoldWaitingPersonalAccount];
    self.thinMakeEnterTextField.enabled = NO;
    self.thinMakeEnterTextField.text = self.rareMarkTap[MouthOunces.logTwelveEnd.seeEggDutchKey];
    [self mildOveragePublisherStylePositionsReversingView:self.thinMakeEnterTextField text:MouthOunces.chatRingCharge.frameFreeZipOrnamentsSong];
    [self.view addSubview:self.thinMakeEnterTextField];
    [self.thinMakeEnterTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.manConverterTextField.mas_bottom).offset(MouthOunces.logTwelveEnd.swedishValue);
        make.left.right.equalTo(self.manConverterTextField);
        make.height.mas_equalTo(MouthOunces.logTwelveEnd.leftSmallTop);
    }];
    
    
    UIButton *publisherButton = [MouthOunces scaleFaxEstonianLogChamberColor:MouthOunces.chatRingCharge.percentSwipeContinuedCoercionRelation];
    [publisherButton addTarget:self action:@selector(correctedMakeGurationFullyExhaustedAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:publisherButton];
    [publisherButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.thinMakeEnterTextField.mas_bottom).offset(MouthOunces.logTwelveEnd.swedishValue);
        make.left.right.equalTo(self.thinMakeEnterTextField);
        make.height.mas_equalTo(MouthOunces.logTwelveEnd.kilowattsArt);
    }];
    
    
    self.openWideMayButton = [MouthOunces snapMusicalHertzCarSecret:MouthOunces.chatRingCharge.mathNetRestartActivatePreventsLearned];
    [self.openWideMayButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [self.openWideMayButton addTarget:self action:@selector(validatesJobCloseRequestCrossAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.openWideMayButton];
    [self.openWideMayButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(publisherButton.mas_bottom).offset(MouthOunces.logTwelveEnd.weekControl);
        make.centerX.equalTo(self.view);
    }];
}

- (void)mildOveragePublisherStylePositionsReversingView:(UITextField *)textField text:(NSString *)text
{
    CGRect frame = {{0,0},CGSizeMake(MouthOunces.logTwelveEnd.kilowattsArt, MouthOunces.logTwelveEnd.leftSmallTop)};
    UILabel *icyLater = [[UILabel alloc] initWithFrame:frame];
    icyLater.text = text;
    icyLater.textColor = UIColor.redColor;
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.leftView = icyLater;
}

- (void)validatesJobCloseRequestCrossAction:(UIButton *)sender {
    [[ProducingManager shared] sentAirArrangerPopSongComposerViewController:self.navigationController];
}

- (void)correctedMakeGurationFullyExhaustedAction:(UIButton *)sender {
    sender.hidden = YES;
    self.gramGolfLabel.hidden = YES;
    self.factorHowView.hidden = NO;
    self.sinkAlongView.hidden = NO;
    self.openWideMayButton.hidden = YES;
    
    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo(CGSizeMake(MouthOunces.logTwelveEnd.buttonDetectedPencilInternalIdleWidth, MouthOunces.logTwelveEnd.needExactnessPresentedListenerAwayTemp-MouthOunces.logTwelveEnd.lookTheInfer));
    }];
    [self.manConverterTextField mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.factorHowView.mas_bottom).offset(MouthOunces.logTwelveEnd.swedishValue);
    }];
    [self.view layoutIfNeeded];
    
    BOOL great = [[[[NSBundle mainBundle] infoDictionary] allKeys] containsObject:MouthOunces.logTwelveEnd.semicolonBarFinishedHintKeyboardDiscardInter];
    if (!great) {
        self.bitLessEggButton.hidden = NO;
        [GetAlertView refreshedResponsesGatheringRemainingSystemTriggers:nil message:MouthOunces.chatRingCharge.solvePermanentFiberAdapterExpecting completion:nil];
        return;
    }
    CGSize size = self.view.frame.size;
    size.height -= MouthOunces.logTwelveEnd.forkPlaneAny;
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:manualWinPhoneticResultingLookLoad:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image manualWinPhoneticResultingLookLoad:(NSError *)error contextInfo:(void *)contextInfo
{
    
    if(!error){
        [[ProducingManager shared] sentAirArrangerPopSongComposerViewController:self.navigationController];
        [KeyToast canSeek:MouthOunces.chatRingCharge.clockEntropyLaunchVersionAudit];
    }else {
        self.bitLessEggButton.hidden = NO;
        [GetAlertView refreshedResponsesGatheringRemainingSystemTriggers:nil message:MouthOunces.chatRingCharge.solvePermanentFiberAdapterExpecting completion:nil];
    }
}

@end
