aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Ehlin <eddiex@eddiex.se>2013-02-11 22:26:14 +0100
committerEddie Ehlin <eddiex@eddiex.se>2013-02-11 22:26:14 +0100
commit6ece0b7130b4160b57a18252c2a2bc89b33602ab (patch)
tree820f02636be9d0fcf802fce5e7fef8f826b086d6
parentea5bce8099d735b0058139589b1f1bbe5afb7272 (diff)
downloadiBean-6ece0b7130b4160b57a18252c2a2bc89b33602ab.tar.gz
iBean-6ece0b7130b4160b57a18252c2a2bc89b33602ab.zip
Added bean cell icon + introduced alternate colors for rows in bean collection extraction view.
-rw-r--r--iBean/iBean.xcodeproj/project.pbxproj4
-rw-r--r--iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstatebin51012 -> 50031 bytes
-rw-r--r--iBean/iBean/BeanCollectionExtractionScrollView.m4
-rw-r--r--iBean/iBean/BeanCollectionExtractionViewController.m8
-rw-r--r--iBean/iBean/Graphics/ibean-beancell-bean-cut.pxmbin0 -> 193009 bytes
-rw-r--r--iBean/iBean/Graphics/ibean-beancell-bean.pngbin0 -> 78738 bytes
-rw-r--r--iBean/iBean/Graphics/ibean-beancell-bean.pxmbin0 -> 21906708 bytes
-rw-r--r--iBean/iBean/iPhoneStoryboard.storyboard29
8 files changed, 27 insertions, 18 deletions
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 = "<group>"; };
020C569B16A49C8300D8224C /* Configuration+Interface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Configuration+Interface.m"; sourceTree = "<group>"; };
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 = "<group>"; };
024CB01E16C04BD5009CBC15 /* UIColor+Extra.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+Extra.h"; sourceTree = "<group>"; };
024CB01F16C04BD5009CBC15 /* UIColor+Extra.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Extra.m"; sourceTree = "<group>"; };
024CB03516C2EF10009CBC15 /* UITableView+Extra.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+Extra.h"; sourceTree = "<group>"; };
@@ -317,6 +319,7 @@
024CB02216C0543B009CBC15 /* Graphics */ = {
isa = PBXGroup;
children = (
+ 023AAB3D16C98B2A00B6886C /* ibean-beancell-bean.png */,
);
name = Graphics;
sourceTree = "<group>";
@@ -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
--- a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate
+++ b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate
Binary files 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
--- /dev/null
+++ b/iBean/iBean/Graphics/ibean-beancell-bean-cut.pxm
Binary files 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
--- /dev/null
+++ b/iBean/iBean/Graphics/ibean-beancell-bean.png
Binary files 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
--- /dev/null
+++ b/iBean/iBean/Graphics/ibean-beancell-bean.pxm
Binary files 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 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="59"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="k5L-1w-O9k">
+ <imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="ibean-beancell-bean.png" translatesAutoresizingMaskIntoConstraints="NO" id="k5L-1w-O9k">
<constraints>
<constraint firstAttribute="height" constant="43" id="U2T-ao-Szq"/>
- <constraint firstAttribute="width" constant="48" id="V9C-sk-j6i"/>
</constraints>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Bean name" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6BI-CV-5ED">
<constraints>
+ <constraint firstAttribute="width" constant="197" id="TLJ-eq-2HY"/>
<constraint firstAttribute="height" constant="21" id="cPO-Kr-w2I"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
@@ -1091,44 +1091,38 @@
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Grind setting" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SEv-Mc-lOV">
<constraints>
+ <constraint firstAttribute="width" constant="149" id="IgI-fe-eO0"/>
<constraint firstAttribute="height" constant="21" id="aa2-WE-QFC"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</label>
- <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Amount" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xmw-e4-noZ">
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="0,0 g" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xmw-e4-noZ">
+ <constraints>
+ <constraint firstAttribute="width" constant="59" id="dC7-HO-dmb"/>
+ </constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</label>
- <imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2GK-CS-zgy">
- <constraints>
- <constraint firstAttribute="height" constant="59" id="DQy-8I-fQ4"/>
- <constraint firstAttribute="width" constant="87" id="ERq-Fo-mp1"/>
- </constraints>
- </imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<constraints>
- <constraint firstItem="2GK-CS-zgy" firstAttribute="leading" secondItem="SEv-Mc-lOV" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="2VR-qW-jA5"/>
<constraint firstItem="k5L-1w-O9k" firstAttribute="leading" secondItem="GFY-k6-GqL" secondAttribute="leading" type="default" id="2cW-c9-WxX"/>
- <constraint firstAttribute="trailing" secondItem="Xmw-e4-noZ" secondAttribute="trailing" constant="40" id="4EQ-61-O6m"/>
<constraint firstItem="6BI-CV-5ED" firstAttribute="leading" secondItem="k5L-1w-O9k" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="4Kv-4c-Gvf"/>
<constraint firstItem="SEv-Mc-lOV" firstAttribute="leading" secondItem="k5L-1w-O9k" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="8f2-UX-Sae"/>
- <constraint firstAttribute="trailing" secondItem="2GK-CS-zgy" secondAttribute="trailing" constant="20" type="default" id="C7U-b9-00Q"/>
- <constraint firstItem="k5L-1w-O9k" firstAttribute="centerY" secondItem="2GK-CS-zgy" secondAttribute="centerY" type="default" id="NTN-Lv-EKt"/>
- <constraint firstItem="2GK-CS-zgy" firstAttribute="leading" secondItem="6BI-CV-5ED" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="PUO-UO-1ph"/>
<constraint firstItem="Xmw-e4-noZ" firstAttribute="top" secondItem="GFY-k6-GqL" secondAttribute="top" constant="18" id="aUJ-34-sGe"/>
+ <constraint firstItem="6BI-CV-5ED" firstAttribute="leading" secondItem="GFY-k6-GqL" secondAttribute="leading" constant="56" id="cEU-ZK-uez"/>
<constraint firstItem="6BI-CV-5ED" firstAttribute="top" secondItem="k5L-1w-O9k" secondAttribute="top" type="default" id="duo-SS-MKg"/>
<constraint firstItem="SEv-Mc-lOV" firstAttribute="bottom" secondItem="k5L-1w-O9k" secondAttribute="bottom" type="default" id="fZo-8g-3Tu"/>
- <constraint firstItem="2GK-CS-zgy" firstAttribute="top" secondItem="GFY-k6-GqL" secondAttribute="top" type="default" id="ofN-ns-fMn"/>
+ <constraint firstAttribute="trailing" secondItem="Xmw-e4-noZ" secondAttribute="trailing" constant="7" id="ovb-Gf-R9D"/>
+ <constraint firstItem="k5L-1w-O9k" firstAttribute="top" secondItem="GFY-k6-GqL" secondAttribute="top" constant="8" id="rb9-E4-wUV"/>
</constraints>
<connections>
<outlet property="beanAmountLabel" destination="Xmw-e4-noZ" id="yOh-Jm-eCd"/>
<outlet property="beanGrindSettingLabel" destination="SEv-Mc-lOV" id="bmF-mE-K60"/>
<outlet property="beanImageLeft" destination="k5L-1w-O9k" id="PTO-SU-myY"/>
- <outlet property="beanImageRight" destination="2GK-CS-zgy" id="MVl-xR-hyY"/>
<outlet property="beanNameLabel" destination="6BI-CV-5ED" id="frx-6h-S3f"/>
</connections>
</tableViewCell>
@@ -1226,6 +1220,9 @@
<point key="canvasLocation" x="773" y="1288"/>
</scene>
</scenes>
+ <resources>
+ <image name="ibean-beancell-bean.png" width="200" height="198"/>
+ </resources>
<classes>
<class className="AddBeanViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/AddBeanViewController.h"/>