Fixing interactions and activities sizing.

This commit is contained in:
Samuel Clay 2014-12-16 14:24:55 -08:00
parent 0642b9471e
commit 168e5ee4b5
5 changed files with 15 additions and 12 deletions

View file

@ -58,9 +58,9 @@
// position label to bounds // position label to bounds
labelFrame.origin.x = leftMargin*2 + avatarSize; labelFrame.origin.x = leftMargin*2 + avatarSize;
labelFrame.origin.y = topMargin - 1; labelFrame.origin.y = 0;
labelFrame.size.width = contentRect.size.width - leftMargin - avatarSize - leftMargin - rightMargin - 20; labelFrame.size.width = contentRect.size.width - leftMargin - avatarSize - leftMargin - rightMargin - 20;
labelFrame.size.height = contentRect.size.height - topMargin - bottomMargin; labelFrame.size.height = contentRect.size.height;
self.activityLabel.frame = labelFrame; self.activityLabel.frame = labelFrame;
} }
@ -108,8 +108,8 @@
feedId = [activity objectForKey:@"story_feed_id"]; feedId = [activity objectForKey:@"story_feed_id"];
} }
if (feedId && [feedId class] != [NSNull class]) { if (feedId && [feedId class] != [NSNull class]) {
NSString *faviconUrl = [NSString stringWithFormat:@"%@/rss_feeds/icon/%i", NSString *faviconUrl = [NSString stringWithFormat:@"%@/%i",
NEWSBLUR_URL, ICONS_HOST,
[feedId intValue]]; [feedId intValue]];
[self.faviconView setImageWithURL:[NSURL URLWithString:faviconUrl] [self.faviconView setImageWithURL:[NSURL URLWithString:faviconUrl]
placeholderImage:nil]; placeholderImage:nil];

View file

@ -42,8 +42,8 @@
myBackView.backgroundColor = UIColorFromRGB(NEWSBLUR_HIGHLIGHT_COLOR); myBackView.backgroundColor = UIColorFromRGB(NEWSBLUR_HIGHLIGHT_COLOR);
self.selectedBackgroundView = myBackView; self.selectedBackgroundView = myBackView;
topMargin = 15; topMargin = 12;
bottomMargin = 15; bottomMargin = 12;
leftMargin = 20; leftMargin = 20;
rightMargin = 20; rightMargin = 20;
avatarSize = 48; avatarSize = 48;
@ -65,9 +65,9 @@
// position label to bounds // position label to bounds
labelFrame.origin.x = leftMargin*2 + avatarSize; labelFrame.origin.x = leftMargin*2 + avatarSize;
labelFrame.origin.y = topMargin - 1; labelFrame.origin.y = 0;
labelFrame.size.width = contentRect.size.width - leftMargin - avatarSize - leftMargin - rightMargin - 20; labelFrame.size.width = contentRect.size.width - leftMargin - avatarSize - leftMargin - rightMargin - 20;
labelFrame.size.height = contentRect.size.height - topMargin - bottomMargin; labelFrame.size.height = contentRect.size.height;
self.interactionLabel.frame = labelFrame; self.interactionLabel.frame = labelFrame;
} }

View file

@ -52,9 +52,9 @@
// position label to bounds // position label to bounds
labelFrame.origin.x = leftMargin*2 + avatarSize; labelFrame.origin.x = leftMargin*2 + avatarSize;
labelFrame.origin.y = topMargin - 1; labelFrame.origin.y = 0;
labelFrame.size.width = contentRect.size.width - leftMargin - avatarSize - leftMargin - rightMargin - 20; labelFrame.size.width = contentRect.size.width - leftMargin - avatarSize - leftMargin - rightMargin - 20;
labelFrame.size.height = contentRect.size.height - topMargin - bottomMargin; labelFrame.size.height = contentRect.size.height;
self.activityLabel.frame = labelFrame; self.activityLabel.frame = labelFrame;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {

View file

@ -52,9 +52,9 @@
// position label to bounds // position label to bounds
labelFrame.origin.x = leftMargin*2 + avatarSize; labelFrame.origin.x = leftMargin*2 + avatarSize;
labelFrame.origin.y = topMargin - 1; labelFrame.origin.y = 0;
labelFrame.size.width = contentRect.size.width - leftMargin - avatarSize - leftMargin - rightMargin - 20; labelFrame.size.width = contentRect.size.width - leftMargin - avatarSize - leftMargin - rightMargin - 20;
labelFrame.size.height = contentRect.size.height - topMargin - bottomMargin; labelFrame.size.height = contentRect.size.height;
self.interactionLabel.frame = labelFrame; self.interactionLabel.frame = labelFrame;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {

View file

@ -12,14 +12,17 @@
#define BACKGROUND_REFRESH_SECONDS -5 #define BACKGROUND_REFRESH_SECONDS -5
#define NEWSBLUR_URL [NSString stringWithFormat:@"http://nb.local.com"] #define NEWSBLUR_URL [NSString stringWithFormat:@"http://nb.local.com"]
#define NEWSBLUR_HOST [NSString stringWithFormat:@"nb.local.com"] #define NEWSBLUR_HOST [NSString stringWithFormat:@"nb.local.com"]
#define ICONS_HOST [NSString stringWithFormat:@"http://nb.local.com/rss_feeds/icon"]
#elif PROD_DEBUG #elif PROD_DEBUG
#define BACKGROUND_REFRESH_SECONDS -5 #define BACKGROUND_REFRESH_SECONDS -5
#define NEWSBLUR_URL [NSString stringWithFormat:@"http://debug.newsblur.com"] #define NEWSBLUR_URL [NSString stringWithFormat:@"http://debug.newsblur.com"]
#define NEWSBLUR_HOST [NSString stringWithFormat:@"debug.newsblur.com"] #define NEWSBLUR_HOST [NSString stringWithFormat:@"debug.newsblur.com"]
#define ICONS_HOST [NSString stringWithFormat:@"https://s3.amazonaws.com/icons.newsblur.com"]
#else #else
#define BACKGROUND_REFRESH_SECONDS -10*60 #define BACKGROUND_REFRESH_SECONDS -10*60
#define NEWSBLUR_URL [NSString stringWithFormat:@"https://www.newsblur.com"] #define NEWSBLUR_URL [NSString stringWithFormat:@"https://www.newsblur.com"]
#define NEWSBLUR_HOST [NSString stringWithFormat:@"www.newsblur.com"] #define NEWSBLUR_HOST [NSString stringWithFormat:@"www.newsblur.com"]
#define ICONS_HOST [NSString stringWithFormat:@"https://s3.amazonaws.com/icons.newsblur.com"]
#endif #endif
#define _ Underscore #define _ Underscore