

#import "FlushBrandView.h"
#import "ElementsYellowCell.h"
#import "UIImageView+WebCache.h"

@interface FlushBrandView ()
@property (nonatomic, strong) UIImageView *manEggTradBoxImageView;
@end

@implementation FlushBrandView

- (void)simulatesLawFooterPhoneticThirteenSonModel:(EarAskTeluguInfo *)model {

    NSMutableArray *micro = [NSMutableArray new];
    for (int i = 0; i<model.spaEntries; i++) {
        ElementsYellowCell *slow = [[ElementsYellowCell alloc]init];
        slow.coverEastAny = model.alarmModal;
        slow.channelCount = 1;
        slow.online = 6;
        slow.gallonRestored = CGFLOAT_MIN;
        CGRect longRect = [model.pinRealStand boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:model.kilobytesConvergedLinkReuseAnyHandling] forKey:NSFontAttributeName] context:nil];
        slow.skinSaySize = CGSizeMake(longRect.size.width+8, longRect.size.height+4);
        slow.model = model;
        [micro addObject:slow];
    }
    [self oldCarCarBring:micro];
}

- (void)relayResourceHexNearestWaxItsFailingModel:(EarAskTeluguInfo *)model {
    NSString *url = model.talkIodineRainGeneratorFadeSmart;

    if (url.length == 0) {
        _manEggTradBoxImageView.hidden = YES;
        _manEggTradBoxImageView.image = nil;
        return;
    }

    UIImageView *air = self.manEggTradBoxImageView;
    air.hidden = NO;
    if (air.superview != self) {
        [self insertSubview:air atIndex:0];
    } else {
        [self sendSubviewToBack:air];
    }

    [air sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        if (image) [self kurdishBundleImageView:air image:image];
    }];
}

- (void)kurdishBundleImageView:(UIImageView *)air image:(UIImage *)image {
    CGFloat width = self.bounds.size.width;
    CGFloat height = self.bounds.size.height;
    if (image.size.width > 0) {
        CGFloat kilometer = image.size.height / image.size.width * width;
        
        CGFloat picture = (height - kilometer) * 0.5;
        air.frame = CGRectMake(0, picture, width, kilometer);
    } else {
        air.frame = self.bounds;
    }
}

- (UIImageView *)manEggTradBoxImageView {
    if (!_manEggTradBoxImageView) {
        _manEggTradBoxImageView = [[UIImageView alloc] init];
        _manEggTradBoxImageView.contentMode = UIViewContentModeScaleToFill;
        _manEggTradBoxImageView.userInteractionEnabled = NO;
        _manEggTradBoxImageView.clipsToBounds = NO;
    }
    return _manEggTradBoxImageView;
}

@end
