






#import "CertSnapCanViewController.h"
#import "SDWebImageManager.h"
#import "FixToast.h"
#import "NSString+FunDecode.h"

@interface CertSnapCanViewController ()

@property (nonatomic, strong) UIImageView *sheTitleSumImageView;
@property (nonatomic, strong) UITextField *jouleStarTextField;
@property (nonatomic, strong) UITextField *roomKnowKitTextField;

@end

@implementation CertSnapCanViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.subLoadSumButton.hidden = [self.mailBigPack[0] boolValue];
    
    CGFloat catNetTurkmenMillionDog = MenuCluster.thirteenHand.globalIndian;
    
    UILabel *hisLabel = [MenuCluster stairRectumFullItsKannada:MenuCluster.hallFloorExist.dashNarrativeSafeNowPage];
    hisLabel.numberOfLines = 0;
    [self.view addSubview:hisLabel];
    [hisLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(MenuCluster.thirteenHand.correctedOne);
        make.left.mas_equalTo(MenuCluster.thirteenHand.sayIconLevel);
        make.right.mas_equalTo(-MenuCluster.thirteenHand.sayIconLevel);
    }];
    
    
    self.jouleStarTextField = [MenuCluster providerCupField:MenuCluster.hallFloorExist.ascendingDeletingPointerArtsRetainThermal isSecure:NO];
    [self.view addSubview:self.jouleStarTextField];
    [self.jouleStarTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(hisLabel.mas_bottom).offset(catNetTurkmenMillionDog);
        make.left.mas_equalTo(MenuCluster.thirteenHand.twoHitAdverb);
        make.right.mas_equalTo(-MenuCluster.thirteenHand.twoHitAdverb);
        make.height.mas_equalTo(MenuCluster.thirteenHand.hisCursorWho);
    }];
    
    
    self.roomKnowKitTextField = [MenuCluster providerCupField:MenuCluster.hallFloorExist.soloJabberSpecifiedCatalanScrollsSwedish isSecure:NO];;
    [self.view addSubview:self.roomKnowKitTextField];
    [self.roomKnowKitTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.jouleStarTextField.mas_bottom).offset(catNetTurkmenMillionDog);
        make.left.right.equalTo(self.jouleStarTextField);
        make.height.mas_equalTo(MenuCluster.thirteenHand.hisCursorWho);
    }];
    
    
    UIImageView *dueKitImageView = nil;
    if ([self.mailBigPack[1] length] > 0) {
        
        dueKitImageView = [[UIImageView alloc] init];
        dueKitImageView.backgroundColor = UIColor.lightGrayColor;
        dueKitImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:dueKitImageView];
        [dueKitImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.roomKnowKitTextField.mas_bottom).offset(catNetTurkmenMillionDog);
            make.width.mas_equalTo(self.roomKnowKitTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.sheTitleSumImageView = dueKitImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.mailBigPack[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(), ^{
                dueKitImageView.image = image2;
                CGFloat dirty = image2.size.height / image2.size.width;
                [dueKitImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((MenuCluster.thirteenHand.pullFemaleIconFitClangWidth -MenuCluster.thirteenHand.twoHitAdverb*2)*dirty);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.sheTitleSumImageView ? self.sheTitleSumImageView.frame.size.height + MenuCluster.thirteenHand.globalIndian +MenuCluster.thirteenHand.sixLiveIgnoreRecoverySixSide : MenuCluster.thirteenHand.sixLiveIgnoreRecoverySixSide;
                    
                    make.size.mas_equalTo(CGSizeMake(MenuCluster.thirteenHand.pullFemaleIconFitClangWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.sheTitleSumImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.sheTitleSumImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *capPolishButton = [MenuCluster systolicFlagSwitchSlovakDenyColor:MenuCluster.hallFloorExist.mediaColleagueParentalHailFooter];
    [capPolishButton addTarget:self action:@selector(onceTaggerHerTrackPrefersSystem:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:capPolishButton];
    [capPolishButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-MenuCluster.thirteenHand.planeCarNear);
        make.left.right.equalTo(self.jouleStarTextField);
        make.height.mas_equalTo(MenuCluster.thirteenHand.armMinAuthor);
    }];
    
}

- (void)onceTaggerHerTrackPrefersSystem:(id)sender {

}

@end
