Skip to content

Commit

Permalink
Style the UserVoice thing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisballinger committed May 14, 2013
1 parent f0d5e2d commit e332275
Show file tree
Hide file tree
Showing 8 changed files with 203 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@
url = https://github.com/mattlawer/BButton.git
[submodule "Submodules/UserVoice-SDK"]
path = Submodules/UserVoice-SDK
url = https://github.com/uservoice/uservoice-iphone-sdk.git
url = git@github.com:OpenWatch/uservoice-iphone-sdk.git
147 changes: 146 additions & 1 deletion OpenWatch.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion OpenWatch/OWSettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#import "OWLoginViewController.h"
#import "OWLocalMediaObjectListViewController.h"
#import "OWUtilities.h"
#import "UserVoice.h"
#import "OWAPIKeys.h"
#import "OWStyleSheet.h"

#define ACCOUNT_ROW 0
#define FEEDBACK_ROW 1
Expand Down Expand Up @@ -56,7 +59,11 @@ - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
[OWUtilities styleNavigationController:navController];
[self presentViewController:navController animated:YES completion:nil];
} else if (indexPath.row == FEEDBACK_ROW) {
[TestFlight openFeedbackView];
UVConfig *config = [UVConfig configWithSite:@"openwatch.uservoice.com"
andKey:USERVOICE_API_KEY
andSecret:USERVOICE_API_SECRET];
[UVStyleSheet setStyleSheet:[[OWStyleSheet alloc] init]];
[UserVoice presentUserVoiceInterfaceForParentViewController:self andConfig:config];
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
Expand Down
13 changes: 13 additions & 0 deletions OpenWatch/OWStyleSheet.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// OWStyleSheet.h
// OpenWatch
//
// Created by Christopher Ballinger on 5/14/13.
// Copyright (c) 2013 OpenWatch FPC. All rights reserved.
//

#import "UVStyleSheet.h"

@interface OWStyleSheet : UVStyleSheet

@end
27 changes: 27 additions & 0 deletions OpenWatch/OWStyleSheet.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// OWStyleSheet.m
// OpenWatch
//
// Created by Christopher Ballinger on 5/14/13.
// Copyright (c) 2013 OpenWatch FPC. All rights reserved.
//

#import "OWStyleSheet.h"
#import "OWUtilities.h"

@implementation OWStyleSheet

- (UIColor*) backgroundColor {
return [OWUtilities stoneBackgroundPattern];
}

- (UIImage*) navigationBarBackgroundImage {
return [OWUtilities navigationBarBackgroundImage];
}

- (UIColor*) navigationBarTintColor {
return [OWUtilities navigationBarColor];
}


@end
2 changes: 2 additions & 0 deletions OpenWatch/OWUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
+ (UIColor*) greyColorWithGreyness:(CGFloat)greyness;
+ (UIColor*) textFieldTextColor;

+ (UIImage*) navigationBarBackgroundImage;

+ (void) logFrame:(CGRect)frame;

+ (void) styleNavigationController:(UINavigationController*)navigationController;
Expand Down
6 changes: 5 additions & 1 deletion OpenWatch/OWUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ + (UIColor*) stoneBackgroundPattern {
return [UIColor colorWithPatternImage:[UIImage imageNamed:@"stone.png"]];
}

+ (UIImage*) navigationBarBackgroundImage {
return [UIImage imageNamed:@"navbar.png"];
}

+ (void) applyShadowToView:(UIView *)view {
view.layer.shadowColor = [UIColor blackColor].CGColor;
view.layer.shadowOpacity = 1;
Expand All @@ -31,7 +35,7 @@ + (void) applyShadowToView:(UIView *)view {

+ (void) styleNavigationController:(UINavigationController*)navigationController {
UINavigationBar *navigationBar = navigationController.navigationBar;
UIImage *image = [UIImage imageNamed: @"navbar.png"];
UIImage *image = [self navigationBarBackgroundImage];
[navigationBar setBackgroundImage:image forBarMetrics: UIBarMetricsDefault];
navigationController.navigationBar.backgroundColor = [UIColor clearColor];
navigationController.navigationBar.tintColor = [OWUtilities navigationBarColor];
Expand Down
2 changes: 1 addition & 1 deletion Submodules/UserVoice-SDK

0 comments on commit e332275

Please sign in to comment.