summaryrefslogtreecommitdiffstats
path: root/Classes/TopicTableViewCell.m
diff options
context:
space:
mode:
Diffstat (limited to 'Classes/TopicTableViewCell.m')
-rw-r--r--Classes/TopicTableViewCell.m80
1 files changed, 80 insertions, 0 deletions
diff --git a/Classes/TopicTableViewCell.m b/Classes/TopicTableViewCell.m
new file mode 100644
index 0000000..a933c7d
--- /dev/null
+++ b/Classes/TopicTableViewCell.m
@@ -0,0 +1,80 @@
+//
+// TopicTableViewCell.m
+// acidcow
+//
+// Created by Matthew Handler on 4/15/11.
+// Copyright 2011 Earl Industries. All rights reserved.
+//
+
+#import "TopicTableViewCell.h"
+
+
+@implementation TopicTableViewCell
+
+@synthesize useDarkBackground, title, iconUrl, picCount, gradient; // titleLabel, icon
+
+- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
+
+ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+ if (self) {
+ // Initialization code.
+ }
+// titleLabel.lineBreakMode = UILineBreakModeWordWrap;
+// titleLabel.numberOfLines = 0;
+ return self;
+}
+
+
+#define DARK_BACKGROUND [UIColor colorWithRed:200.0/255.0 green:240.0/255.0 blue:240.0/255.0 alpha:1.0]
+#define LIGHT_BACKGROUND [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0]
+
+- (void)setUseDarkBackground:(BOOL)flag
+{
+ if (flag != useDarkBackground || !self.backgroundView)
+ {
+ useDarkBackground = flag;
+
+ //NSString *backgroundImagePath = [[NSBundle mainBundle] pathForResource:useDarkBackground ? @"DarkBackground" : @"LightBackground" ofType:@"png"];
+ //UIImage *backgroundImage = [[UIImage imageWithContentsOfFile:backgroundImagePath] stretchableImageWithLeftCapWidth:0.0 topCapHeight:1.0];
+ //self.backgroundView = [[[UIImageView alloc] initWithImage:backgroundImage] autorelease];
+ //self.backgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+
+ //self.backgroundColor = LIGHT_BACKGROUND;
+ //[self setBackgroundColor:LIGHT_BACKGROUND];
+ //[self.contentView setBackgroundColor:LIGHT_BACKGROUND];
+ }
+ else {
+ //[self.contentView setBackgroundColor:DARK_BACKGROUND];
+ //[self setBackgroundColor:DARK_BACKGROUND];
+ //self.backgroundColor = DARK_BACKGROUND;
+ }
+ self.backgroundView.frame = self.bounds;
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+ [gradient removeFromSuperview];
+ [super setSelected:selected animated:animated];
+
+ // Configure the view for the selected state.
+}
+
+- (void)setIconUrl:(NSString *)url {
+// NSData *imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:url]];
+// [icon setImage:[[UIImage alloc] initWithData:imageData]];
+}
+
+- (void)setTitle:(NSString *)string {
+ titleLabel.text = string;
+}
+
+- (void)setPicCount:(NSString *)string {
+ picCountLabel.text = string;
+}
+
+- (void)dealloc {
+ //NSLog(@"powering down");
+ [super dealloc];
+}
+
+
+@end