






#import "TopAgeDrumView.h"
#import "ZoneAngleManager.h"
#import "ClaimMaxBig.h"
#import "Masonry.h"

@interface TopAgeDrumView ()

@property (nonatomic, strong) UIView *ownKeyForbidBackgroundView;
@property (nonatomic, strong) UIActivityIndicatorView *fastUpperWhileShiftEntitled;
@property (nonatomic, strong) UILabel *hormoneLabel;
@end

@implementation TopAgeDrumView


static TopAgeDrumView *seeLeaveSpeedView = nil;



- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self literView];
    }
    return self;
}
- (instancetype)initWithCoder:(NSCoder *)coder {
    self = [super initWithCoder:coder];
    if (self) {
        [self literView];
    }
    return self;
}
- (void)literView {
    
    
    self.ownKeyForbidBackgroundView = [UIView new];
    self.ownKeyForbidBackgroundView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
    self.ownKeyForbidBackgroundView.layer.cornerRadius = 2.0;
    self.ownKeyForbidBackgroundView.clipsToBounds = YES;
    [self addSubview:self.ownKeyForbidBackgroundView];
    
    
    self.fastUpperWhileShiftEntitled = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge];
    self.fastUpperWhileShiftEntitled.color = ClaimMaxBig.nineSlideColor;
    [self.ownKeyForbidBackgroundView addSubview:self.fastUpperWhileShiftEntitled];
    
    
    self.hormoneLabel = [[UILabel alloc] init];
    self.hormoneLabel.text = ClaimMaxBig.allFeedEarGolf.rightTeamBut;
    self.hormoneLabel.textColor = [UIColor whiteColor];
    self.hormoneLabel.font = [UIFont systemFontOfSize:14];
    self.hormoneLabel.numberOfLines = 0;
    self.hormoneLabel.textAlignment = NSTextAlignmentCenter;
    [self.ownKeyForbidBackgroundView addSubview:self.hormoneLabel];
    
    
    [self.ownKeyForbidBackgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(ClaimMaxBig.applierPatch.tildeForTamil, ClaimMaxBig.applierPatch.tildeForTamil));
        make.center.equalTo(self);
    }];
    
    [self.fastUpperWhileShiftEntitled mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(ClaimMaxBig.applierPatch.detectsCross);
        make.centerX.equalTo(self.ownKeyForbidBackgroundView.mas_centerX);
    }];
    
    [self.hormoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.fastUpperWhileShiftEntitled.mas_bottom).offset(ClaimMaxBig.applierPatch.detectsCross);
        make.centerX.equalTo(self.ownKeyForbidBackgroundView.mas_centerX);
        make.left.equalTo(self.ownKeyForbidBackgroundView.mas_left).offset(ClaimMaxBig.applierPatch.providesKey);
        make.right.equalTo(self.ownKeyForbidBackgroundView.mas_right).offset(-ClaimMaxBig.applierPatch.providesKey);
    }];
    
    
    self.hidden = YES;
}



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

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

- (void)figureMakeText:(NSString *)text {
    self.hormoneLabel.text = text;
    
    
    CGFloat autoWidth = [text boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)
                                          options:NSStringDrawingUsesLineFragmentOrigin
                                       attributes:@{NSFontAttributeName: self.hormoneLabel.font}
                                          context:nil].size.width;
    UIWindow *window = [[ZoneAngleManager shared] retGigabytesWindow];
    CGFloat takeTheWidth = MIN(MAX(120, autoWidth + 2 * 8), window.bounds.size.width);
    [self.ownKeyForbidBackgroundView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(takeTheWidth);
    }];
    
    [self layoutIfNeeded];
}


+ (void)zipHelpersPubWindow {
    [self usageFitnessBagContentsCatEnterText:ClaimMaxBig.allFeedEarGolf.rightTeamBut];
}

+ (void)usageFitnessBagContentsCatEnterText:(NSString *)text {
    dispatch_async(dispatch_get_main_queue(), ^{
        UIWindow *window = [[ZoneAngleManager shared] retGigabytesWindow];
        
        if (!seeLeaveSpeedView) {
            CGSize size = UIScreen.mainScreen.bounds.size;
            seeLeaveSpeedView = [[TopAgeDrumView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
            seeLeaveSpeedView.center = window.center;
        }
        if (!seeLeaveSpeedView.superview) {
            [window addSubview:seeLeaveSpeedView];
        }
        [seeLeaveSpeedView figureMakeText:text];
        [seeLeaveSpeedView startAnimating];
    });
}

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


+ (TopAgeDrumView *)icyBayerSpineView:(UIView *)view {
    return [self icyBayerSpineView:view withText:ClaimMaxBig.allFeedEarGolf.rightTeamBut];
}

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

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

@end
