






#import "BufferPulseViewController.h"
#import "SDWebImageManager.h"
#import "KinToast.h"
#import "NSString+EasyStorm.h"

@interface BufferPulseViewController ()

@property (nonatomic, strong) UIImageView *limitedHomeImageView;
@property (nonatomic, strong) UITextField *semicolonTextField;
@property (nonatomic, strong) UITextField *penFontLinkTextField;

@end

@implementation BufferPulseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.blobLogKinButton.hidden = [self.sexDeclined[0] boolValue];
    
    CGFloat mirroredFlushDiskRightNine = FixMaterial.capsLoopsAge.builtChinese;
    
    UILabel *eyeLabel = [FixMaterial waistMarkTurnEventElder:FixMaterial.dryMicroCapTag.upsideDeriveCupDashSon];
    eyeLabel.numberOfLines = 0;
    [self.view addSubview:eyeLabel];
    [eyeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(FixMaterial.capsLoopsAge.subgroupCall);
        make.left.mas_equalTo(FixMaterial.capsLoopsAge.sayDomainCup);
        make.right.mas_equalTo(-FixMaterial.capsLoopsAge.sayDomainCup);
    }];
    
    
    self.semicolonTextField = [FixMaterial mailOddSelfField:FixMaterial.dryMicroCapTag.creditsNowStartTorchBothLoss isSecure:NO];
    [self.view addSubview:self.semicolonTextField];
    [self.semicolonTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(eyeLabel.mas_bottom).offset(mirroredFlushDiskRightNine);
        make.left.mas_equalTo(FixMaterial.capsLoopsAge.niacinDegree);
        make.right.mas_equalTo(-FixMaterial.capsLoopsAge.niacinDegree);
        make.height.mas_equalTo(FixMaterial.capsLoopsAge.rearrangeSin);
    }];
    
    
    self.penFontLinkTextField = [FixMaterial mailOddSelfField:FixMaterial.dryMicroCapTag.operatingTwoIdenticalBankersMouseAccurate isSecure:NO];;
    [self.view addSubview:self.penFontLinkTextField];
    [self.penFontLinkTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.semicolonTextField.mas_bottom).offset(mirroredFlushDiskRightNine);
        make.left.right.equalTo(self.semicolonTextField);
        make.height.mas_equalTo(FixMaterial.capsLoopsAge.rearrangeSin);
    }];
    
    
    UIImageView *darkenImageView = nil;
    if ([self.sexDeclined[1] length] > 0) {
        
        darkenImageView = [[UIImageView alloc] init];
        darkenImageView.backgroundColor = UIColor.lightGrayColor;
        darkenImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:darkenImageView];
        [darkenImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.penFontLinkTextField.mas_bottom).offset(mirroredFlushDiskRightNine);
            make.width.mas_equalTo(self.penFontLinkTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.limitedHomeImageView = darkenImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.sexDeclined[1]] options:0 progress:nil completed:^(UIImage * _Nullable image2, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
            dispatch_async(dispatch_get_main_queue(), ^{
                darkenImageView.image = image2;
                CGFloat ratio = image2.size.height / image2.size.width;
                [darkenImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((FixMaterial.capsLoopsAge.ambientTeluguBlackInstancesLockWidth -FixMaterial.capsLoopsAge.niacinDegree*2)*ratio);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.limitedHomeImageView ? self.limitedHomeImageView.frame.size.height + FixMaterial.capsLoopsAge.builtChinese +FixMaterial.capsLoopsAge.boxTakeTouchMoreOneEnvelope : FixMaterial.capsLoopsAge.boxTakeTouchMoreOneEnvelope;
                    
                    make.size.mas_equalTo(CGSizeMake(FixMaterial.capsLoopsAge.ambientTeluguBlackInstancesLockWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.limitedHomeImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.limitedHomeImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *flushUsesButton = [FixMaterial rangeSeeHectaresImproperLowercaseColor:FixMaterial.dryMicroCapTag.decigramsCondensedClinicalDeviationReset];
    [flushUsesButton addTarget:self action:@selector(fetchedViolationPortraitSubtractPointerWhile:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:flushUsesButton];
    [flushUsesButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-FixMaterial.capsLoopsAge.helperCanBut);
        make.left.right.equalTo(self.semicolonTextField);
        make.height.mas_equalTo(FixMaterial.capsLoopsAge.maxCurlGuest);
    }];
    
}

- (void)fetchedViolationPortraitSubtractPointerWhile:(id)sender {

}

@end
