






#import "BitJumpCanDoneButton.h"
#import "SubBondFour.h"
#import "UIImage+GetImage.h"
#import "KitBasicLoopsController.h"
#import "UIImage+GetImage.h"
#import "UIColor+RetColor.h"

@implementation BitJumpCanDoneButton

- (instancetype)initBigSnapHeadViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.hitNeedVoiceViewController = viewController;
        [self restoredDashForbiddenCauseFront];
    }
    return self;
}


- (void)restoredDashForbiddenCauseFront {
    
    NSArray *whoItalicZeroSceneMinute = [RelationLateAdvisedOverrideCompose bufferedElevatedCreditsDeletionOutputs:[SplitStorm class]];
    
    
    NSString *catSunFourStarCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block SplitStorm *howBoundOurDue = nil;
    [whoItalicZeroSceneMinute enumerateObjectsUsingBlock:^(SplitStorm *country, NSUInteger idx, BOOL *stop) {
        if ([country.waistSwedishCode caseInsensitiveCompare:catSunFourStarCode] == NSOrderedSame) {
            howBoundOurDue = country;
            *stop = YES; 
        }
    }];
    self.largerTensionBigExtendUniform = howBoundOurDue;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",SubBondFour.nodeFourteen.lateRetKeySaw, howBoundOurDue.pullShakeCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *yetNeverImage = [UIImage positionOwnMeteringSourcesBookName:SubBondFour.nodeFourteen.inuitLightProgressFormatsIllWaist];
    
    
    CGSize taskPubNameSize = CGSizeMake(13, 13); 
    
    
    UIImage *spaItsImage = [self softwareSocialImage:yetNeverImage cellularSize:taskPubNameSize];
    
    
    [self setImage:spaItsImage forState:UIControlStateNormal];
    [self setImage:[spaItsImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateHighlighted]; 
    
    
    self.imageView.contentMode = UIViewContentModeScaleAspectFit;
    
    
    self.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft; 
    CGFloat spacing = 3.0; 
    self.imageEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, -spacing);  
    self.titleEdgeInsets = UIEdgeInsetsMake(0, -spacing, 0, spacing);   
    
    
    [self setBackgroundImage:[UIImage advertiseGreekColor:[SubBondFour.routeHeapColor remainingPreviewsDiscardsChromiumJouleMap:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage advertiseGreekColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]]
                   forState:UIControlStateHighlighted];
    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.layer.cornerRadius = 2.f;
    self.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMinXMaxYCorner;
    self.layer.masksToBounds = YES;
    
    
    self.contentEdgeInsets = UIEdgeInsetsMake(8, 12, 8, 12); 
    
    
    [self sizeToFit];
    
    
    [self addTarget:self action:@selector(bigBadgeCutClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)softwareSocialImage:(UIImage *)image cellularSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat ownEndBars = targetSize.width / image.size.width;
    CGFloat referentDue = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(ownEndBars, referentDue);
    
    
    CGRect tabEndRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - tabEndRect.size.width) / 2.0,
                               (targetSize.height - tabEndRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                tabEndRect.size.width,
                                tabEndRect.size.height)];
    
    UIImage *bagImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return bagImage;
}


- (void)bigBadgeCutClicked {
    CriticalFigureAbortFitManyNowViewController *cat = [CriticalFigureAbortFitManyNowViewController new];
    cat.whiteHaveDelegate = self;
    [self.hitNeedVoiceViewController.navigationController pushViewController:cat animated:NO];
}

- (void)revertPeoplePhotoBusyAlongsideAirRefinedAudit:(SplitStorm *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",SubBondFour.nodeFourteen.lateRetKeySaw, country.pullShakeCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.largerTensionBigExtendUniform = country;
}

- (void)dealloc {
    
}
@end
