From 6ece0b7130b4160b57a18252c2a2bc89b33602ab Mon Sep 17 00:00:00 2001 From: Eddie Ehlin Date: Mon, 11 Feb 2013 22:26:14 +0100 Subject: Added bean cell icon + introduced alternate colors for rows in bean collection extraction view. --- iBean/iBean.xcodeproj/project.pbxproj | 4 +++ .../UserInterfaceState.xcuserstate | Bin 51012 -> 50031 bytes iBean/iBean/BeanCollectionExtractionScrollView.m | 4 +-- .../iBean/BeanCollectionExtractionViewController.m | 8 ++++++ iBean/iBean/Graphics/ibean-beancell-bean-cut.pxm | Bin 0 -> 193009 bytes iBean/iBean/Graphics/ibean-beancell-bean.png | Bin 0 -> 78738 bytes iBean/iBean/Graphics/ibean-beancell-bean.pxm | Bin 0 -> 21906708 bytes iBean/iBean/iPhoneStoryboard.storyboard | 29 +++++++++------------ 8 files changed, 27 insertions(+), 18 deletions(-) create mode 100644 iBean/iBean/Graphics/ibean-beancell-bean-cut.pxm create mode 100644 iBean/iBean/Graphics/ibean-beancell-bean.png create mode 100644 iBean/iBean/Graphics/ibean-beancell-bean.pxm diff --git a/iBean/iBean.xcodeproj/project.pbxproj b/iBean/iBean.xcodeproj/project.pbxproj index 72a51e6..2721cd3 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 */; }; + 023AAB3E16C98B2A00B6886C /* ibean-beancell-bean.png in Resources */ = {isa = PBXBuildFile; fileRef = 023AAB3D16C98B2A00B6886C /* ibean-beancell-bean.png */; }; 024CB02016C04BD5009CBC15 /* UIColor+Extra.m in Sources */ = {isa = PBXBuildFile; fileRef = 024CB01F16C04BD5009CBC15 /* UIColor+Extra.m */; }; 024CB03716C2EF10009CBC15 /* UITableView+Extra.m in Sources */ = {isa = PBXBuildFile; fileRef = 024CB03616C2EF10009CBC15 /* UITableView+Extra.m */; }; 024CB03916C2EFD5009CBC15 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 024CB03816C2EFD5009CBC15 /* QuartzCore.framework */; }; @@ -89,6 +90,7 @@ 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; }; + 023AAB3D16C98B2A00B6886C /* ibean-beancell-bean.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ibean-beancell-bean.png"; path = "Graphics/ibean-beancell-bean.png"; sourceTree = ""; }; 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 = ""; }; 024CB03516C2EF10009CBC15 /* UITableView+Extra.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+Extra.h"; sourceTree = ""; }; @@ -317,6 +319,7 @@ 024CB02216C0543B009CBC15 /* Graphics */ = { isa = PBXGroup; children = ( + 023AAB3D16C98B2A00B6886C /* ibean-beancell-bean.png */, ); name = Graphics; sourceTree = ""; @@ -405,6 +408,7 @@ 020C55AE1691014E00D8224C /* Default@2x.png in Resources */, 020C55B01691014E00D8224C /* Default-568h@2x.png in Resources */, 020C55BD169101FB00D8224C /* iPhoneStoryboard.storyboard in Resources */, + 023AAB3E16C98B2A00B6886C /* ibean-beancell-bean.png in Resources */, ); 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 3a993b4..7bbba69 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/BeanCollectionExtractionScrollView.m b/iBean/iBean/BeanCollectionExtractionScrollView.m index 682f525..e1db1d0 100644 --- a/iBean/iBean/BeanCollectionExtractionScrollView.m +++ b/iBean/iBean/BeanCollectionExtractionScrollView.m @@ -27,8 +27,8 @@ UITableView *bt = [self.subviews objectAtIndex:0]; //1 - Set the height of the table cells [bt setRowHeight:60.0f]; - //2 - Calculate the total height for the tableview (i.e.: numberOfRows*rowHeight) - bt.frame = CGRectMake(bt.frame.origin.x, bt.frame.origin.y, bt.frame.size.width, ([bt numberOfRowsInSection:0]*bt.rowHeight)+bt.tableFooterView.bounds.size.height); + //2 - Calculate the total height for the tableview (i.e.: numberOfRows*rowHeight + 10 (pushing down the gradient under last cell)) + bt.frame = CGRectMake(bt.frame.origin.x, bt.frame.origin.y, bt.frame.size.width, ([bt numberOfRowsInSection:0]*bt.rowHeight)+bt.tableFooterView.bounds.size.height+10); //Move down the note text view, so that it don't overlaps the table. UITextView *note = [self.subviews objectAtIndex:1]; diff --git a/iBean/iBean/BeanCollectionExtractionViewController.m b/iBean/iBean/BeanCollectionExtractionViewController.m index 7ac982f..6f620fd 100644 --- a/iBean/iBean/BeanCollectionExtractionViewController.m +++ b/iBean/iBean/BeanCollectionExtractionViewController.m @@ -13,6 +13,7 @@ #import "Bean+Interface.h" #import "AppDelegate+Storage.h" #import "UITableView+Extra.h" +#import "UIColor+Extra.h" @interface BeanCollectionExtractionViewController () @@ -184,9 +185,16 @@ Bean *currentBean = [self.beanCollection.beans objectAtIndex:indexPath.row]; [cell initWithNameGrindSettingAndAmount:currentBean.name :currentBean.grindSetting :currentBean.amount]; + return cell; } +- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath +{ + //Alternate the background color + [cell.contentView setBackgroundColor: [UIColor colorFromHEX:(indexPath.row % 2 == 0) ? 0xFFFFFF : /*[UIColor selectedCellBackgroundColor]*/0xe9e5df]]; +} + - (UIView*) tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { //Add shadow to the bottom of the bean table view. diff --git a/iBean/iBean/Graphics/ibean-beancell-bean-cut.pxm b/iBean/iBean/Graphics/ibean-beancell-bean-cut.pxm new file mode 100644 index 0000000..7a440f0 Binary files /dev/null and b/iBean/iBean/Graphics/ibean-beancell-bean-cut.pxm differ diff --git a/iBean/iBean/Graphics/ibean-beancell-bean.png b/iBean/iBean/Graphics/ibean-beancell-bean.png new file mode 100644 index 0000000..bd267a7 Binary files /dev/null and b/iBean/iBean/Graphics/ibean-beancell-bean.png differ diff --git a/iBean/iBean/Graphics/ibean-beancell-bean.pxm b/iBean/iBean/Graphics/ibean-beancell-bean.pxm new file mode 100644 index 0000000..7867caf Binary files /dev/null and b/iBean/iBean/Graphics/ibean-beancell-bean.pxm differ diff --git a/iBean/iBean/iPhoneStoryboard.storyboard b/iBean/iBean/iPhoneStoryboard.storyboard index 18bb04e..9be079b 100644 --- a/iBean/iBean/iPhoneStoryboard.storyboard +++ b/iBean/iBean/iPhoneStoryboard.storyboard @@ -1075,14 +1075,14 @@ - + - - - - - - - + - + + - @@ -1226,6 +1220,9 @@ + + + -- cgit v1.2.3