Skip to content

Commit

Permalink
Added some color scheming
Browse files Browse the repository at this point in the history
  • Loading branch information
brung committed Feb 21, 2015
1 parent fe316b3 commit 9cc7b0e
Show file tree
Hide file tree
Showing 12 changed files with 167 additions and 5 deletions.
18 changes: 18 additions & 0 deletions unnamed.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
3E7C1D681A966CBA0046FDE1 /* AnswerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E7C1D661A966CBA0046FDE1 /* AnswerCell.m */; };
3E7C1D691A966CBA0046FDE1 /* AnswerCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3E7C1D671A966CBA0046FDE1 /* AnswerCell.xib */; };
B827A9E81A9815E100AB43CE /* ProfileImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = B827A9E71A9815E100AB43CE /* ProfileImageView.m */; };
B827A9EB1A9823DF00AB43CE /* UIColor+AppTintColor.m in Sources */ = {isa = PBXBuildFile; fileRef = B827A9EA1A9823DF00AB43CE /* UIColor+AppTintColor.m */; };
B827A9EE1A98287B00AB43CE /* GrayBarButtonItem.m in Sources */ = {isa = PBXBuildFile; fileRef = B827A9ED1A98287B00AB43CE /* GrayBarButtonItem.m */; };
B827A9F41A982B2600AB43CE /* UIColor+AppBgColor.m in Sources */ = {isa = PBXBuildFile; fileRef = B827A9F31A982B2600AB43CE /* UIColor+AppBgColor.m */; };
B862A88C1A970E25008B2310 /* DetailAnswerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B862A88A1A970E25008B2310 /* DetailAnswerCell.m */; };
B862A88D1A970E25008B2310 /* DetailAnswerCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B862A88B1A970E25008B2310 /* DetailAnswerCell.xib */; };
B87C15BC1A93113400191823 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B87C15B71A93113400191823 /* LoginViewController.m */; };
Expand Down Expand Up @@ -87,6 +90,12 @@
5BA90E0F57CF5978BEB02DE4 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
B827A9E61A9815E100AB43CE /* ProfileImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProfileImageView.h; sourceTree = "<group>"; };
B827A9E71A9815E100AB43CE /* ProfileImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProfileImageView.m; sourceTree = "<group>"; };
B827A9E91A9823DF00AB43CE /* UIColor+AppTintColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+AppTintColor.h"; sourceTree = "<group>"; };
B827A9EA1A9823DF00AB43CE /* UIColor+AppTintColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+AppTintColor.m"; sourceTree = "<group>"; };
B827A9EC1A98287B00AB43CE /* GrayBarButtonItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GrayBarButtonItem.h; sourceTree = "<group>"; };
B827A9ED1A98287B00AB43CE /* GrayBarButtonItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GrayBarButtonItem.m; sourceTree = "<group>"; };
B827A9F21A982B2600AB43CE /* UIColor+AppBgColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+AppBgColor.h"; sourceTree = "<group>"; };
B827A9F31A982B2600AB43CE /* UIColor+AppBgColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+AppBgColor.m"; sourceTree = "<group>"; };
B862A8891A970E25008B2310 /* DetailAnswerCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailAnswerCell.h; sourceTree = "<group>"; };
B862A88A1A970E25008B2310 /* DetailAnswerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailAnswerCell.m; sourceTree = "<group>"; };
B862A88B1A970E25008B2310 /* DetailAnswerCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DetailAnswerCell.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -219,8 +228,14 @@
B8C291B21A930BDD000F2143 /* Supporting Files */ = {
isa = PBXGroup;
children = (
B827A9E91A9823DF00AB43CE /* UIColor+AppTintColor.h */,
B827A9EA1A9823DF00AB43CE /* UIColor+AppTintColor.m */,
B8C291B31A930BDD000F2143 /* Info.plist */,
B8C291B41A930BDD000F2143 /* main.m */,
B827A9EC1A98287B00AB43CE /* GrayBarButtonItem.h */,
B827A9ED1A98287B00AB43CE /* GrayBarButtonItem.m */,
B827A9F21A982B2600AB43CE /* UIColor+AppBgColor.h */,
B827A9F31A982B2600AB43CE /* UIColor+AppBgColor.m */,
);
name = "Supporting Files";
sourceTree = "<group>";
Expand Down Expand Up @@ -477,11 +492,13 @@
files = (
B8C0DBF41A95C2D60023BC39 /* ParseClient.m in Sources */,
B8BA93E81A9459B5003BD476 /* User.m in Sources */,
B827A9F41A982B2600AB43CE /* UIColor+AppBgColor.m in Sources */,
B8C0DBF11A95C1DA0023BC39 /* Survey.m in Sources */,
B8C704AA1A97065600243C3B /* DetailQuestionCell.m in Sources */,
3E2BB7E01A94FF0000E78B3A /* AppNavigationController.m in Sources */,
3E312E011A970EBC00DC747B /* BarView.m in Sources */,
B8BA93F41A947718003BD476 /* Answer.m in Sources */,
B827A9EB1A9823DF00AB43CE /* UIColor+AppTintColor.m in Sources */,
B8C0DBCD1A94F71A0023BC39 /* ComposeViewController.m in Sources */,
3E7C1D541A958D120046FDE1 /* SurveyCell.m in Sources */,
B8C291B81A930BDD000F2143 /* AppDelegate.m in Sources */,
Expand All @@ -493,6 +510,7 @@
3E7C1D591A95AA520046FDE1 /* SurveyViewController.m in Sources */,
B8BA93EB1A9464C7003BD476 /* Question.m in Sources */,
E25DBF061A9489530074D48B /* TabBarMenuViewController.m in Sources */,
B827A9EE1A98287B00AB43CE /* GrayBarButtonItem.m in Sources */,
B8C0DBDC1A95138C0023BC39 /* ComposeAnswerCell.m in Sources */,
3E7C1D681A966CBA0046FDE1 /* AnswerCell.m in Sources */,
B827A9E81A9815E100AB43CE /* ProfileImageView.m in Sources */,
Expand Down
5 changes: 5 additions & 0 deletions unnamed/AppNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "AppNavigationController.h"
#import "UIColor+AppTintColor.h"

@interface AppNavigationController ()

Expand All @@ -18,6 +19,10 @@ - (void)viewDidLoad {
[super viewDidLoad];
self.navigationBar.translucent = NO;
self.navigationBar.barTintColor = [UIColor whiteColor];
[self.navigationBar setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor appTintColor],
NSForegroundColorAttributeName,
nil]];
}

- (void)didReceiveMemoryWarning {
Expand Down
2 changes: 1 addition & 1 deletion unnamed/ComposeAnswerCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ @implementation ComposeAnswerCell

- (void)awakeFromNib {
// Initialization code
self.valueLabels = @[@"A", @"B", @"C", @"D", @"E", @"F"];
self.valueLabels = @[@"1.", @"2.", @"3.", @"4.", @"5.", @"6."];
self.answerLabel.alpha = 0;
self.answerText.alpha = 1;

Expand Down
11 changes: 8 additions & 3 deletions unnamed/ComposeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#import "Answer.h"
#import "Survey.h"
#import "ParseClient.h"
#import "GrayBarButtonItem.h"
#import "UIColor+AppBgColor.h"

NSString * const AnswerCell = @"ComposeAnswerCell";
NSString * const AskAQuestion = @"Ask a question . . .";
Expand All @@ -34,6 +36,7 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self.title = @"Create";
self.tabBarItem.image = [UIImage imageNamed:@"Poll Topic"];
}
self.view.backgroundColor = [UIColor appBgColor];
return self;
}

Expand All @@ -48,9 +51,9 @@ - (void)viewDidLoad {
[super viewDidLoad];
self.isUpdating = NO;
// Button
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonItemStylePlain target:self action:@selector(onCancelButton)];
GrayBarButtonItem *cancelButton = [[GrayBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonItemStylePlain target:self action:@selector(onCancelButton)];
self.navigationItem.leftBarButtonItem = cancelButton;
UIBarButtonItem *submitButton = [[UIBarButtonItem alloc] initWithTitle:@"Submit" style:UIBarButtonItemStylePlain target:self action:@selector(onSubmitButton)];
GrayBarButtonItem *submitButton = [[GrayBarButtonItem alloc] initWithTitle:@"Submit" style:UIBarButtonItemStylePlain target:self action:@selector(onSubmitButton)];
self.navigationItem.rightBarButtonItem = submitButton;
// Do any additional setup after loading the view from its nib.
self.tableView.dataSource = self;
Expand Down Expand Up @@ -106,12 +109,14 @@ - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSIntege
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UILabel *footer = [[UILabel alloc] init];
footer.contentMode = UIViewContentModeCenter;
footer.textAlignment = NSTextAlignmentCenter;
footer.textColor = [UIColor lightGrayColor];
if (self.answers.count < 4) {
footer.text = (self.answers.count < 4) ? @"+ Add an Answer" : @"";
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onAddAnswerButton:)];
footer.userInteractionEnabled = YES;
[footer addGestureRecognizer:tapGesture];
footer.backgroundColor = [UIColor lightGrayColor];
footer.backgroundColor = [UIColor whiteColor];
}
return footer;
}
Expand Down
2 changes: 1 addition & 1 deletion unnamed/ComposeViewController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2eW-Cr-3wD">
<rect key="frame" x="8" y="16" width="304" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="86v-la-mTY">
Expand Down
13 changes: 13 additions & 0 deletions unnamed/GrayBarButtonItem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// GrayBarButtonItem.h
// unnamed
//
// Created by Bruce Ng on 2/20/15.
// Copyright (c) 2015 com.yahoo. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface GrayBarButtonItem : UIBarButtonItem

@end
63 changes: 63 additions & 0 deletions unnamed/GrayBarButtonItem.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
//
// GrayBarButtonItem.m
// unnamed
//
// Created by Bruce Ng on 2/20/15.
// Copyright (c) 2015 com.yahoo. All rights reserved.
//

#import "GrayBarButtonItem.h"

@implementation GrayBarButtonItem
- (void) setup {
[self setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor lightGrayColor],
NSForegroundColorAttributeName,
nil]
forState:UIControlStateNormal];
}

- (id) initWithBarButtonSystemItem:(UIBarButtonSystemItem)systemItem target:(id)target action:(SEL)action {
self = [super initWithBarButtonSystemItem:systemItem target:target action:action];
[self setup];
return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
[self setup];
return self;
}

- (id)init {
self = [super init];
[self setup];
return self;
}

- (id)initWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action {
self = [super initWithTitle:title style:style target:target action:action];
[self setup];
return self;
}

- (id)initWithCustomView:(UIView *)customView {
self = [super initWithCustomView:customView];
[self setup];
return self;
}

- (id)initWithImage:(UIImage *)image style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action {
self = [super initWithImage:image style:style target:target action:action];
[self setup];
return self;
}

- (id)initWithImage:(UIImage *)image landscapeImagePhone:(UIImage *)landscapeImagePhone style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action {
self = [super initWithImage:image landscapeImagePhone:landscapeImagePhone style:style target:target action:action];
[self setup];
return self;
}

@end
2 changes: 2 additions & 0 deletions unnamed/TabBarMenuViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "TabBarMenuViewController.h"
#import "UIColor+AppTintColor.h"

@interface TabBarMenuViewController ()

Expand All @@ -17,6 +18,7 @@ @implementation TabBarMenuViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[self.tabBar setTintColor:[UIColor appTintColor]];
}

- (void)didReceiveMemoryWarning {
Expand Down
13 changes: 13 additions & 0 deletions unnamed/UIColor+AppBgColor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// UIColor+AppBgColor.h
// unnamed
//
// Created by Bruce Ng on 2/20/15.
// Copyright (c) 2015 com.yahoo. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIColor (AppBgColor)
+ (UIColor *)appBgColor;
@end
15 changes: 15 additions & 0 deletions unnamed/UIColor+AppBgColor.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// UIColor+AppBgColor.m
// unnamed
//
// Created by Bruce Ng on 2/20/15.
// Copyright (c) 2015 com.yahoo. All rights reserved.
//

#import "UIColor+AppBgColor.h"

@implementation UIColor (AppBgColor)
+ (UIColor *)appBgColor {
return [UIColor colorWithRed:246.0/255.0 green:241.0/255.0 blue:234.0/255.0 alpha:1];
}
@end
13 changes: 13 additions & 0 deletions unnamed/UIColor+AppTintColor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// UIColor+AppTintColor.h
// unnamed
//
// Created by Bruce Ng on 2/20/15.
// Copyright (c) 2015 com.yahoo. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIColor (AppTintColor)
+ (UIColor *)appTintColor;
@end
15 changes: 15 additions & 0 deletions unnamed/UIColor+AppTintColor.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// UIColor+AppTintColor.m
// unnamed
//
// Created by Bruce Ng on 2/20/15.
// Copyright (c) 2015 com.yahoo. All rights reserved.
//

#import "UIColor+AppTintColor.h"

@implementation UIColor (AppTintColor)
+ (UIColor *)appTintColor {
return [UIColor colorWithRed:170.0/255.0 green:20.0/255.0 blue:20.0/255.0 alpha:1];
}
@end

0 comments on commit 9cc7b0e

Please sign in to comment.