






#import "FormatsPlayButton.h"
#import "UserArtRoot.h"
#import "UIImage+WasImage.h"

@interface FormatsPlayButton ()


@property (nonatomic, strong) NSTimer *mustKnowOffOwnTimer;

@property (nonatomic, assign) NSInteger symptomOptSpeakingPopoverStrokedTolerance;

@property (nonatomic, copy) NSString *audioLoveFlushTimeDid;

@end

@implementation FormatsPlayButton

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self buttonsFourEntryVisibleColumns];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)coder {
    self = [super initWithCoder:coder];
    if (self) {
        [self buttonsFourEntryVisibleColumns];
    }
    return self;
}


- (void)buttonsFourEntryVisibleColumns {
    
    self.yetFastestToneAuthorsFetchedStamp = 60;
    self.audioLoveFlushTimeDid = UserArtRoot.builtOwnSeeEar.brokenBalticReachableMarginsTriangleIcyCode;
    [self setTitle:self.audioLoveFlushTimeDid forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage solutionsLeaveColor:UserArtRoot.partBoostColor] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage solutionsLeaveColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.layer.cornerRadius = 2.f;
    self.layer.masksToBounds = YES;
    
    self.contentEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
    
    [self sizeToFit];
    
    
    [self addTarget:self action:@selector(skinDrawCarClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (void)skinDrawCarClicked {
    [self phaseBagLaunchAffectedWho];
    if (self.rebusAreThreeAction) {
        self.rebusAreThreeAction();
    }
}


- (void)phaseBagLaunchAffectedWho {
    self.enabled = NO;
    self.symptomOptSpeakingPopoverStrokedTolerance = self.yetFastestToneAuthorsFetchedStamp;
    [self descentCheckingNumberCanCategoryEmail];
    
    
    self.mustKnowOffOwnTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(airAcuteLoadingEnableOff:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)airAcuteLoadingEnableOff:(NSTimer *)stamp {
    self.symptomOptSpeakingPopoverStrokedTolerance--;
    if (self.symptomOptSpeakingPopoverStrokedTolerance <= 0) {
        [self clustersTranslatePacketUnderlineGranting];
    } else {
        [self descentCheckingNumberCanCategoryEmail];
    }
}


- (void)descentCheckingNumberCanCategoryEmail {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",UserArtRoot.builtOwnSeeEar.incomingTabularRecentOutdoorFormClearCode, (long)self.symptomOptSpeakingPopoverStrokedTolerance];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)clustersTranslatePacketUnderlineGranting {
    [self.mustKnowOffOwnTimer invalidate];
    self.mustKnowOffOwnTimer = nil;
    self.enabled = YES;
    [self setTitle:self.audioLoveFlushTimeDid forState:UIControlStateNormal];
}

- (void)dealloc {
    
    [self.mustKnowOffOwnTimer invalidate];
    self.mustKnowOffOwnTimer = nil;
}

@end
