From fcc1d6a36d21ab97edf5e9822296e99d77bc4b0c Mon Sep 17 00:00:00 2001 From: Eddie Ehlin Date: Mon, 4 Feb 2013 21:29:35 +0100 Subject: Initial color scheme (no graphics) + bug fix (active timer view change). --- iBean/iBean.xcodeproj/project.pbxproj | 14 ++++++++ .../UserInterfaceState.xcuserstate | Bin 41928 -> 64019 bytes .../xcdebugger/Breakpoints.xcbkptlist | 20 ++++++------ iBean/iBean/.DS_Store | Bin 6148 -> 6148 bytes iBean/iBean/BeanCollectionBeanListViewController.m | 6 ++++ .../iBean/BeanCollectionExtractionViewController.m | 6 ++++ iBean/iBean/BeanCollectionListViewController.m | 6 ++++ iBean/iBean/InstantExtractionViewController.m | 6 ++++ iBean/iBean/SettingsViewController.h | 1 + iBean/iBean/ThresholdListViewController.m | 6 ++++ iBean/iBean/UIColor+Extra.h | 16 +++++++++ iBean/iBean/UIColor+Extra.m | 28 ++++++++++++++++ iBean/iBean/iPhoneStoryboard.storyboard | 36 ++++++++++++++------- 13 files changed, 124 insertions(+), 21 deletions(-) create mode 100644 iBean/iBean/UIColor+Extra.h create mode 100644 iBean/iBean/UIColor+Extra.m (limited to 'iBean') diff --git a/iBean/iBean.xcodeproj/project.pbxproj b/iBean/iBean.xcodeproj/project.pbxproj index e2c40a3..65dc07f 100644 --- a/iBean/iBean.xcodeproj/project.pbxproj +++ b/iBean/iBean.xcodeproj/project.pbxproj @@ -32,6 +32,7 @@ 020C569316A1E55600D8224C /* ExtractionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 020C569216A1E55600D8224C /* ExtractionViewController.m */; }; 020C569C16A49C8300D8224C /* Configuration+Interface.m in Sources */ = {isa = PBXBuildFile; fileRef = 020C569B16A49C8300D8224C /* Configuration+Interface.m */; }; 022A9C6B16BE9CA300DB3A4A /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 022A9C6A16BE9CA300DB3A4A /* AudioToolbox.framework */; }; + 024CB02016C04BD5009CBC15 /* UIColor+Extra.m in Sources */ = {isa = PBXBuildFile; fileRef = 024CB01F16C04BD5009CBC15 /* UIColor+Extra.m */; }; 024F676D16A4A61D004A1201 /* InstantExtractionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 024F676C16A4A61D004A1201 /* InstantExtractionViewController.m */; }; 0276253916B58D6000EE2F4E /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0276253816B58D6000EE2F4E /* SettingsViewController.m */; }; 0276253C16B59E4C00EE2F4E /* Configuration.m in Sources */ = {isa = PBXBuildFile; fileRef = 0276253B16B59E4C00EE2F4E /* Configuration.m */; }; @@ -86,6 +87,8 @@ 020C569A16A49C8300D8224C /* Configuration+Interface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Configuration+Interface.h"; sourceTree = ""; }; 020C569B16A49C8300D8224C /* Configuration+Interface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Configuration+Interface.m"; sourceTree = ""; }; 022A9C6A16BE9CA300DB3A4A /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 024CB01E16C04BD5009CBC15 /* UIColor+Extra.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+Extra.h"; sourceTree = ""; }; + 024CB01F16C04BD5009CBC15 /* UIColor+Extra.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Extra.m"; sourceTree = ""; }; 024F676B16A4A61D004A1201 /* InstantExtractionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InstantExtractionViewController.h; sourceTree = ""; }; 024F676C16A4A61D004A1201 /* InstantExtractionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstantExtractionViewController.m; sourceTree = ""; }; 0276253716B58D6000EE2F4E /* SettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsViewController.h; sourceTree = ""; }; @@ -156,6 +159,7 @@ 020C559F1691014E00D8224C /* iBean */ = { isa = PBXGroup; children = ( + 024CB02116C04BDD009CBC15 /* Categories */, 0276253316B58C2C00EE2F4E /* Settings */, 020C55D31695C2C800D8224C /* iBean */, 020C55B9169101A300D8224C /* InstantExtraction */, @@ -291,6 +295,15 @@ name = "Step 4 - Extraction"; sourceTree = ""; }; + 024CB02116C04BDD009CBC15 /* Categories */ = { + isa = PBXGroup; + children = ( + 024CB01E16C04BD5009CBC15 /* UIColor+Extra.h */, + 024CB01F16C04BD5009CBC15 /* UIColor+Extra.m */, + ); + name = Categories; + sourceTree = ""; + }; 0276253316B58C2C00EE2F4E /* Settings */ = { isa = PBXGroup; children = ( @@ -410,6 +423,7 @@ 0276254216B5A64000EE2F4E /* ThresholdListViewController.m in Sources */, 0276254516B5AACF00EE2F4E /* ThresholdViewController.m in Sources */, 0276254816B5BC5300EE2F4E /* ThresholdCell.m in Sources */, + 024CB02016C04BD5009CBC15 /* UIColor+Extra.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate index f003ada..1776333 100644 Binary files a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate and b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist index d3ee32a..6e8321f 100644 --- a/iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +++ b/iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -8,11 +8,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "iBean/InstantExtractionViewController.m" - timestampString = "381591502.753324" + timestampString = "381700930.572514" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "87" - endingLineNumber = "87" + startingLineNumber = "93" + endingLineNumber = "93" landmarkName = "-haltExtractionTimer" landmarkType = "5"> @@ -21,11 +21,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "iBean/InstantExtractionViewController.m" - timestampString = "381591502.753324" + timestampString = "381700930.572514" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "95" - endingLineNumber = "95" + startingLineNumber = "101" + endingLineNumber = "101" landmarkName = "-timerInterrupted" landmarkType = "5"> @@ -47,11 +47,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "iBean/ThresholdListViewController.m" - timestampString = "381273377.804792" + timestampString = "381702156.572563" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "140" - endingLineNumber = "140" + startingLineNumber = "146" + endingLineNumber = "146" landmarkName = "-tableView:commitEditingStyle:forRowAtIndexPath:" landmarkType = "5"> @@ -112,7 +112,7 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "iBean/AppDelegate.m" - timestampString = "381511651.662976" + timestampString = "381607816.503623" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "54" diff --git a/iBean/iBean/.DS_Store b/iBean/iBean/.DS_Store index 9578c17..4128183 100644 Binary files a/iBean/iBean/.DS_Store and b/iBean/iBean/.DS_Store differ diff --git a/iBean/iBean/BeanCollectionBeanListViewController.m b/iBean/iBean/BeanCollectionBeanListViewController.m index caddd35..f478770 100644 --- a/iBean/iBean/BeanCollectionBeanListViewController.m +++ b/iBean/iBean/BeanCollectionBeanListViewController.m @@ -12,6 +12,7 @@ #import "ExtractionViewController.h" #import "BeanCollection.h" #import "Bean.h" +#import "UIColor+Extra.h" @interface BeanCollectionBeanListViewController () @@ -132,6 +133,11 @@ Bean *currentBean = [self.beanCollection.beans objectAtIndex:indexPath.row]; cell.textLabel.text = currentBean.name; + //Set selected background color + UIView *cellSelectedBackgroundView = [[UIView alloc] init]; + [cellSelectedBackgroundView setBackgroundColor:[UIColor colorFromHEX:[UIColor selectedCellBackgroundColor]]]; + [cell setSelectedBackgroundView:cellSelectedBackgroundView]; + return cell; } diff --git a/iBean/iBean/BeanCollectionExtractionViewController.m b/iBean/iBean/BeanCollectionExtractionViewController.m index b1be270..633c44a 100644 --- a/iBean/iBean/BeanCollectionExtractionViewController.m +++ b/iBean/iBean/BeanCollectionExtractionViewController.m @@ -36,6 +36,12 @@ } +- (void) viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + [self haltExtractionTimer]; +} + - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; diff --git a/iBean/iBean/BeanCollectionListViewController.m b/iBean/iBean/BeanCollectionListViewController.m index 6c0f46c..ebcb7e7 100644 --- a/iBean/iBean/BeanCollectionListViewController.m +++ b/iBean/iBean/BeanCollectionListViewController.m @@ -11,6 +11,7 @@ #import "BeanCollectionExtractionViewController.h" #import "BeanCollection.h" #import "AppDelegate+Storage.h" +#import "UIColor+Extra.h" @interface BeanCollectionListViewController () @@ -91,6 +92,11 @@ static NSString *CellIdentifier = @"BeanCollectionCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; + //Set selected background color + UIView *cellSelectedBackgroundView = [[UIView alloc] init]; + [cellSelectedBackgroundView setBackgroundColor:[UIColor colorFromHEX:[UIColor selectedCellBackgroundColor]]]; + [cell setSelectedBackgroundView:cellSelectedBackgroundView]; + //Configure the cell and set its title BeanCollection *currentCollection = [self.beanCollections objectAtIndex:indexPath.row]; cell.textLabel.text = currentCollection.name; diff --git a/iBean/iBean/InstantExtractionViewController.m b/iBean/iBean/InstantExtractionViewController.m index b2e1372..0d22105 100644 --- a/iBean/iBean/InstantExtractionViewController.m +++ b/iBean/iBean/InstantExtractionViewController.m @@ -37,6 +37,12 @@ [self initViewController]; } +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + [self haltExtractionTimer]; +} + - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; diff --git a/iBean/iBean/SettingsViewController.h b/iBean/iBean/SettingsViewController.h index efddfb2..410e1c2 100644 --- a/iBean/iBean/SettingsViewController.h +++ b/iBean/iBean/SettingsViewController.h @@ -21,6 +21,7 @@ @property (weak, nonatomic) IBOutlet UISwitch *useThresholdsSwitch; @property (weak, nonatomic) IBOutlet UIStepper *extractionCountStepper; @property (weak, nonatomic) IBOutlet UILabel *extractionCountLabel; +@property (weak, nonatomic) IBOutlet UIButton *resetExtractionCountButton; /* UI Actions */ - (IBAction)countExtractionsSwitchChanged:(id)sender; diff --git a/iBean/iBean/ThresholdListViewController.m b/iBean/iBean/ThresholdListViewController.m index 18f087a..1f96f6a 100644 --- a/iBean/iBean/ThresholdListViewController.m +++ b/iBean/iBean/ThresholdListViewController.m @@ -11,6 +11,7 @@ #import "Configuration+Interface.h" #import "ThresholdCell.h" #import "AppDelegate+Storage.h" +#import "UIColor+Extra.h" @interface ThresholdListViewController () @@ -118,6 +119,11 @@ // Configure the cell... [cell initWithThresholdEntity:[self.configuration.thresholds objectAtIndex:indexPath.row]]; + //Set selected background color + UIView *cellSelectedBackgroundView = [[UIView alloc] init]; + [cellSelectedBackgroundView setBackgroundColor:[UIColor colorFromHEX:[UIColor selectedCellBackgroundColor]]]; + [cell setSelectedBackgroundView:cellSelectedBackgroundView]; + return cell; } diff --git a/iBean/iBean/UIColor+Extra.h b/iBean/iBean/UIColor+Extra.h new file mode 100644 index 0000000..5cbe5a2 --- /dev/null +++ b/iBean/iBean/UIColor+Extra.h @@ -0,0 +1,16 @@ +// +// UIColor+Extra.h +// iBean +// +// Created by Eddie Ehlin on 2013-02-04. +// Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import + +@interface UIColor (Extra) + ++(UIColor*) colorFromHEX: (NSInteger)hex; ++(NSInteger) selectedCellBackgroundColor; + +@end diff --git a/iBean/iBean/UIColor+Extra.m b/iBean/iBean/UIColor+Extra.m new file mode 100644 index 0000000..9821ff8 --- /dev/null +++ b/iBean/iBean/UIColor+Extra.m @@ -0,0 +1,28 @@ +// +// UIColor+Extra.m +// iBean +// +// Created by Eddie Ehlin on 2013-02-04. +// Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import "UIColor+Extra.h" + +@implementation UIColor (Extra) + ++ (UIColor*) colorFromHEX:(NSInteger)hex +{ + UIColor *c = [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16))/255.0 + green:((float)((hex & 0xFF00) >> 8))/255.0 + blue:((float)(hex & 0xFF))/255.0 + alpha:1.0f]; + return c; +} + ++ (NSInteger) selectedCellBackgroundColor +{ + //0xCBB6AC/*0xe8d1c5*/ + return 0xCBB6AC; +} + +@end diff --git a/iBean/iBean/iPhoneStoryboard.storyboard b/iBean/iBean/iPhoneStoryboard.storyboard index 22975ba..bb8cece 100644 --- a/iBean/iBean/iPhoneStoryboard.storyboard +++ b/iBean/iBean/iPhoneStoryboard.storyboard @@ -13,7 +13,7 @@ - + @@ -161,7 +161,7 @@ - + @@ -177,6 +177,7 @@ + @@ -191,7 +192,7 @@ - + @@ -207,6 +208,7 @@ + @@ -225,7 +227,7 @@ - + @@ -282,7 +284,7 @@ - + @@ -318,6 +320,7 @@ + @@ -336,7 +339,7 @@ - + @@ -359,7 +362,9 @@ - + + + @@ -399,6 +404,7 @@ + @@ -441,7 +447,7 @@ - + @@ -517,7 +523,9 @@ - + + + @@ -563,6 +571,7 @@ + @@ -676,7 +685,7 @@ - + @@ -715,6 +724,7 @@ + @@ -967,6 +977,7 @@ + @@ -1028,6 +1039,7 @@ + @@ -1201,6 +1213,7 @@ + @@ -1324,6 +1337,7 @@ + @@ -1363,7 +1377,7 @@ - + -- cgit v1.2.3