Skip to content

Commit

Permalink
Merge pull request #118 from wordpress-mobile/improve-no-results-view
Browse files Browse the repository at this point in the history
Improve no results view
  • Loading branch information
elibud authored Mar 27, 2017
2 parents 7292168 + e979f72 commit 546db71
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion WordPress-iOS-Shared.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "WordPress-iOS-Shared"
s.version = "0.8.0"
s.version = "0.8.1"
s.summary = "Shared components used in building the WordPress iOS apps and other library components."

s.description = <<-DESC
Expand Down
19 changes: 12 additions & 7 deletions WordPress-iOS-Shared/Core/WPNoResultsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ - (instancetype)init {

// Button
_button = [UIButton buttonWithType:UIButtonTypeCustom];
_button.titleLabel.font = [WPStyleGuide regularTextFont];
_button.titleLabel.font = [WPStyleGuide subtitleFontBold];
_button.hidden = YES;
[_button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
[_button setTitleColor:[WPStyleGuide allTAllShadeGrey] forState:UIControlStateNormal];
[_button setTitleColor:[WPStyleGuide wordPressBlue] forState:UIControlStateNormal];
[_button setBackgroundImage:[self newButtonBackgroundImage] forState:UIControlStateNormal];

// Insert Subviews
Expand All @@ -73,7 +73,7 @@ - (void)didMoveToSuperview {

- (void)layoutSubviews {

CGFloat width = 250.0f;
CGFloat width = 280.0f;

[self hideAccessoryViewIfNecessary];

Expand Down Expand Up @@ -131,8 +131,9 @@ - (UIImage *)newButtonBackgroundImage {
UIGraphicsBeginImageContextWithOptions(fillRect.size, NO, [[UIScreen mainScreen] scale]);
CGContextRef context = UIGraphicsGetCurrentContext();

CGContextSetStrokeColorWithColor(context, [WPStyleGuide allTAllShadeGrey].CGColor);
CGContextAddPath(context, [UIBezierPath bezierPathWithRoundedRect:CGRectInset(fillRect, 1, 1) cornerRadius:2.0].CGPath);
CGContextSetStrokeColorWithColor(context, [WPStyleGuide wordPressBlue].CGColor);
CGContextAddPath(context, [UIBezierPath bezierPathWithRoundedRect:CGRectInset(fillRect, 1, 1)
cornerRadius:2.0].CGPath);
CGContextStrokePath(context);

UIImage *mainImage = UIGraphicsGetImageFromCurrentImageContext();
Expand Down Expand Up @@ -219,8 +220,12 @@ - (void)centerInSuperview {

if ([self.superview isKindOfClass:[UITableView class]]) {
UITableView *tableView = (UITableView *)self.superview;
CGFloat headerHeight = (tableView.tableHeaderView == nil || tableView.tableHeaderView.hidden) ? 0 : tableView.tableHeaderView.bounds.size.height;
CGFloat footerHeight = (tableView.tableFooterView == nil || tableView.tableFooterView.hidden) ? 0 : tableView.tableFooterView.bounds.size.height;
CGFloat headerHeight = (tableView.tableHeaderView == nil
|| tableView.tableHeaderView.hidden
|| tableView.tableHeaderView.alpha == 0.0) ? 0 : tableView.tableHeaderView.bounds.size.height;
CGFloat footerHeight = (tableView.tableFooterView == nil
|| tableView.tableFooterView.hidden
|| tableView.tableFooterView.alpha == 0.0) ? 0 : tableView.tableFooterView.bounds.size.height;

verticalOffset += (headerHeight + footerHeight);

Expand Down

0 comments on commit 546db71

Please sign in to comment.