






#import "DecibelLoadingButton.h"
#import "MakerOldest.h"
#import "UIImage+PopImage.h"
#import "AliveOriginalController.h"
#import "UIImage+PopImage.h"
#import "UIColor+MenColor.h"

@implementation DecibelLoadingButton

- (instancetype)initAbnormalYetViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.mandatoryTipViewController = viewController;
        [self handoffEncipherCanonFunctionsCallback];
    }
    return self;
}


- (void)handoffEncipherCanonFunctionsCallback {
    
    NSArray *videoHealthMediumHangFooter = [AudiencesAdditionGatewaysLaunchingUnwind notifiedCoverRawPlainSeek:[TapFaxLose class]];
    
    
    NSString *charPublicSiteCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block TapFaxLose *noiseBagBagAre = nil;
    [videoHealthMediumHangFooter enumerateObjectsUsingBlock:^(TapFaxLose *country, NSUInteger idx, BOOL *stop) {
        if ([country.rejectMixEggCode caseInsensitiveCompare:charPublicSiteCode] == NSOrderedSame) {
            noiseBagBagAre = country;
            *stop = YES; 
        }
    }];
    self.funBulgarianConvertedFootPlatform = noiseBagBagAre;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",MakerOldest.redoneFinder.arbitraryOnly, noiseBagBagAre.bundleDueCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *frontYetImage = [UIImage kirghizDecodeDetachingRhythmCharName:MakerOldest.redoneFinder.kannadaLiterLemmaLoudExternalPublisher];
    
    
    CGSize routeButSixSize = CGSizeMake(13, 13); 
    
    
    UIImage *nepaliImage = [self encodeExposureImage:frontYetImage animatorSize:routeButSixSize];
    
    
    [self setImage:nepaliImage forState:UIControlStateNormal];
    [self setImage:[nepaliImage 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 nepaliAtomHashColor:[MakerOldest.caseAboutColor obscuredLearnAccuracyQueueFaxMask:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage nepaliAtomHashColor:[[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(butCroatianClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)encodeExposureImage:(UIImage *)image animatorSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat hangPartly = targetSize.width / image.size.width;
    CGFloat dateProvide = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(hangPartly, dateProvide);
    
    
    CGRect barNotRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - barNotRect.size.width) / 2.0,
                               (targetSize.height - barNotRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                barNotRect.size.width,
                                barNotRect.size.height)];
    
    UIImage *herImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return herImage;
}


- (void)butCroatianClicked {
    DrumPrincipalBezelBitVolatileArteryViewController *son = [DrumPrincipalBezelBitVolatileArteryViewController new];
    son.penCameraDelegate = self;
    [self.mandatoryTipViewController.navigationController pushViewController:son animated:NO];
}

- (void)alongCanSevenPermittedAirDismissCatTerminal:(TapFaxLose *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",MakerOldest.redoneFinder.arbitraryOnly, country.bundleDueCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.funBulgarianConvertedFootPlatform = country;
}

- (void)dealloc {
    
}
@end
