Skip to content

Commit

Permalink
Retina application icon support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Munsie authored and nglayton committed Aug 24, 2011
1 parent 7397898 commit c1b870c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Classes/App.m
Expand Up @@ -40,6 +40,8 @@
// Date formatter for XML files
static NSDateFormatter *dateFormatterToRead = nil;

#define SMALL_APP_ICON_SIZE 64.0
#define LARGE_APP_ICON_SIZE 112.0

@implementation App

Expand All @@ -55,8 +57,8 @@ - (id)init
if (self = [super init])
{
self.iconImage = [UIImage imageNamed:@"Empty.png"];
UIImage *tmpImageNanoResized = [self.iconImage scaleImageToSize:CGSizeMake(32.0,32.0)];
self.iconImageNano = tmpImageNanoResized;
UIImage *tmpImageNanoResized = [self.iconImage scaleImageToSize:CGSizeMake(SMALL_APP_ICON_SIZE,SMALL_APP_ICON_SIZE)];
self.iconImageNano = tmpImageNanoResized;


// subscribe to total update notifications
Expand Down Expand Up @@ -178,7 +180,7 @@ - (void) loadImageFromBirne
if (tmpImage)
{
self.iconImage = tmpImage;
UIImage *tmpImageNanoResized = [tmpImage scaleImageToSize:CGSizeMake(32.0,32.0)];
UIImage *tmpImageNanoResized = [self.iconImage scaleImageToSize:CGSizeMake(SMALL_APP_ICON_SIZE,SMALL_APP_ICON_SIZE)];
self.iconImageNano = tmpImageNanoResized;

return;
Expand Down Expand Up @@ -297,10 +299,10 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection

//UIImage *tmpImageRounded = [ImageManipulator makeRoundCornerImage:tmpImage cornerWidth:20 cornerHeight:20];

UIImage *tmpImageResized = [tmpImageRounded scaleImageToSize:CGSizeMake(56.0,56.0)];
UIImage *tmpImageResized = [tmpImageRounded scaleImageToSize:CGSizeMake(LARGE_APP_ICON_SIZE,LARGE_APP_ICON_SIZE)];
self.iconImage = tmpImageResized;

UIImage *tmpImageNanoResized = [tmpImageRounded scaleImageToSize:CGSizeMake(32.0,32.0)];
UIImage *tmpImageNanoResized = [tmpImageRounded scaleImageToSize:CGSizeMake(SMALL_APP_ICON_SIZE,SMALL_APP_ICON_SIZE)];
self.iconImageNano = tmpImageNanoResized;


Expand Down
2 changes: 2 additions & 0 deletions Classes/AppCell.m
Expand Up @@ -103,6 +103,8 @@ - (void)layoutSubviews
CGFloat width = (contentRect.size.width - LEFT_COLUMN_OFFSET - RIGHT_MARGIN - 5.0);
royaltiesLabel.frame = CGRectMake(contentRect.origin.x + LEFT_COLUMN_OFFSET + width*0.6, contentRect.origin.y+2.0*lineHeight + VERTICAL_MARGIN, width*0.4, lineHeight);
totalUnitsLabel.frame = CGRectMake(contentRect.origin.x + LEFT_COLUMN_OFFSET, contentRect.origin.y+2.0*lineHeight + VERTICAL_MARGIN, width*0.6, lineHeight);

self.imageView.frame = CGRectMake(9.0, 9.0, 56.0, 56.0);
}

- (void)dealloc
Expand Down
2 changes: 2 additions & 0 deletions Classes/ReportCell.m
Expand Up @@ -107,6 +107,8 @@ - (void)layoutSubviews
frame.size.width = 30.0;
frame.size.height = 15.0;
countryCodeLabel.frame = frame;

self.imageView.frame = CGRectMake(9.0, 9.0, 32.0, 32.0);
}

- (void)dealloc
Expand Down

0 comments on commit c1b870c

Please sign in to comment.