Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
gliechtenstein committed Apr 8, 2017
2 parents 78c6f8c + d2def98 commit 733ea1e
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions app/Jasonette/JasonButtonComponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ + (UIView *)build: (UIButton *)component withJSON: (NSDictionary *)json withOpti
[imageView sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:placeholder_image completed:^(UIImage *i, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
if(!error){
JasonComponentFactory.imageLoaded[url] = [NSValue valueWithCGSize:i.size];
[component setImage:imageView.image forState:UIControlStateNormal];
if(style[@"color"]){
NSString *colorHex = style[@"color"];
UIColor *c = [JasonHelper colorwithHexString:colorHex alpha:1.0];
UIImage *image = [imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[component setTintColor:c];
[component setImage: image forState:UIControlStateNormal];
} else {
[component setImage:imageView.image forState:UIControlStateNormal];
}
}
}];
}
Expand Down Expand Up @@ -151,13 +159,14 @@ + (UIView *)build: (UIButton *)component withJSON: (NSDictionary *)json withOpti
// text button
[self stylize:json text:component.titleLabel];

if(style[@"color"]){
NSString *colorHex = style[@"color"];
component.tintColor = [JasonHelper colorwithHexString:colorHex alpha:1.0];
UIColor *c = [JasonHelper colorwithHexString:colorHex alpha:1.0];
[component setTitleColor:c forState:UIControlStateNormal];
}
}
if(style[@"color"]){
NSString *colorHex = style[@"color"];
UIColor *c = [JasonHelper colorwithHexString:colorHex alpha:1.0];
component.tintColor = c;
[component setTitleColor:c forState:UIControlStateNormal];
}

}


Expand Down

0 comments on commit 733ea1e

Please sign in to comment.