






#import "OneCatalanView.h"
#import "ProducingManager.h"
#import "MouthOunces.h"
#import "Masonry.h"

@interface OneCatalanView ()

@property (nonatomic, strong) UIView *elevenPreferBackgroundView;
@property (nonatomic, strong) UIActivityIndicatorView *reuseSexButThinSingle;
@property (nonatomic, strong) UILabel *ageMileLabel;
@end

@implementation OneCatalanView


static OneCatalanView *biometryTraitView = nil;



- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self briefView];
    }
    return self;
}
- (instancetype)initWithCoder:(NSCoder *)coder {
    self = [super initWithCoder:coder];
    if (self) {
        [self briefView];
    }
    return self;
}
- (void)briefView {
    
    
    self.elevenPreferBackgroundView = [UIView new];
    self.elevenPreferBackgroundView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
    self.elevenPreferBackgroundView.layer.cornerRadius = MouthOunces.logTwelveEnd.lookTheInfer;
    self.elevenPreferBackgroundView.clipsToBounds = YES;
    [self addSubview:self.elevenPreferBackgroundView];
    
    
    self.reuseSexButThinSingle = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge];
    self.reuseSexButThinSingle.color = MouthOunces.syntheticColor;
    [self.elevenPreferBackgroundView addSubview:self.reuseSexButThinSingle];
    
    
    self.ageMileLabel = [[UILabel alloc] init];
    self.ageMileLabel.text = MouthOunces.chatRingCharge.drawingGiven;
    self.ageMileLabel.textColor = [UIColor whiteColor];
    self.ageMileLabel.font = [UIFont systemFontOfSize:14];
    self.ageMileLabel.numberOfLines = 0;
    self.ageMileLabel.textAlignment = NSTextAlignmentCenter;
    [self.elevenPreferBackgroundView addSubview:self.ageMileLabel];
    
    
    [self.elevenPreferBackgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(MouthOunces.logTwelveEnd.decigramsFive, MouthOunces.logTwelveEnd.decigramsFive));
        make.center.equalTo(self);
    }];
    
    [self.reuseSexButThinSingle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(MouthOunces.logTwelveEnd.lookTheInfer);
        make.centerX.equalTo(self.elevenPreferBackgroundView.mas_centerX);
    }];
    
    [self.ageMileLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.reuseSexButThinSingle.mas_bottom).offset(MouthOunces.logTwelveEnd.lookTheInfer);
        make.centerX.equalTo(self.elevenPreferBackgroundView.mas_centerX);
        make.left.equalTo(self.elevenPreferBackgroundView.mas_left).offset(MouthOunces.logTwelveEnd.assignTrash);
        make.right.equalTo(self.elevenPreferBackgroundView.mas_right).offset(-MouthOunces.logTwelveEnd.assignTrash);
    }];
    
    
    self.hidden = YES;
}



- (void)startAnimating {
    self.hidden = NO;
    [self.reuseSexButThinSingle startAnimating];
}

- (void)stopAnimating {
    [self.reuseSexButThinSingle stopAnimating];
    self.hidden = YES;
}

- (void)bigFixRedoText:(NSString *)text {
    self.ageMileLabel.text = text;
    
    
    CGFloat fireWidth = [text boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)
                                          options:NSStringDrawingUsesLineFragmentOrigin
                                       attributes:@{NSFontAttributeName: self.ageMileLabel.font}
                                          context:nil].size.width;
    UIWindow *window = [[ProducingManager shared] normalOldPutWindow];
    CGFloat thiaminWidth = MIN(MAX(120, fireWidth + 2 * 8), window.bounds.size.width);
    [self.elevenPreferBackgroundView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(thiaminWidth);
    }];
    
    [self layoutIfNeeded];
}


+ (void)rowsArmAgeAskWindow {
    [self obscuredExpandExtrasMegahertzPositionsPolishText:MouthOunces.chatRingCharge.drawingGiven];
}

+ (void)obscuredExpandExtrasMegahertzPositionsPolishText:(NSString *)text {
    dispatch_async(dispatch_get_main_queue(), ^{
        UIWindow *window = [[ProducingManager shared] normalOldPutWindow];
        
        if (!biometryTraitView) {
            CGSize size = UIScreen.mainScreen.bounds.size;
            biometryTraitView = [[OneCatalanView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
            biometryTraitView.center = window.center;
        }
        if (!biometryTraitView.superview) {
            [window addSubview:biometryTraitView];
        }
        [biometryTraitView bigFixRedoText:text];
        [biometryTraitView startAnimating];
    });
}

+ (void)balticDecimalPublishEightArtWindow {
    dispatch_async(dispatch_get_main_queue(), ^{
        [biometryTraitView stopAnimating];
        [biometryTraitView removeFromSuperview];
        biometryTraitView = nil;
    });
}


+ (OneCatalanView *)buddySameHailView:(UIView *)view {
    return [self buddySameHailView:view withText:MouthOunces.chatRingCharge.drawingGiven];
}

+ (OneCatalanView *)buddySameHailView:(UIView *)view withText:(NSString *)text {
    __block OneCatalanView *usesMaxView = nil;
    dispatch_async(dispatch_get_main_queue(), ^{
        
        usesMaxView = [[OneCatalanView alloc] initWithFrame:CGRectMake(0, 0, view.frame.size.width, view.frame.size.height)];
        usesMaxView.center = CGPointMake(CGRectGetMidX(view.bounds), CGRectGetMidY(view.bounds));
        [usesMaxView bigFixRedoText:text];
        [usesMaxView startAnimating];
        [view addSubview:usesMaxView];
    });
    return usesMaxView;
}

+ (void)restoresBrokenReclaimRecursiveSensorView:(UIView *)view {
    dispatch_async(dispatch_get_main_queue(), ^{
        
        for (UIView *skipKit in view.subviews) {
            if ([skipKit isKindOfClass:[OneCatalanView class]]) {
                [(OneCatalanView *)skipKit stopAnimating];
                [skipKit removeFromSuperview];
            }
        }
    });
}

@end
