diff options
Diffstat (limited to 'Classes')
-rw-r--r-- | Classes/BrowseViewController.m | 8 | ||||
-rw-r--r-- | Classes/BrowseViewController.xib | 74 | ||||
-rw-r--r-- | Classes/PhotoViewController.m | 48 | ||||
-rw-r--r-- | Classes/PicCastAppDelegate.m | 42 | ||||
-rw-r--r-- | Classes/SearchViewController.m | 47 | ||||
-rw-r--r-- | Classes/SourcesEditViewController.xib | 37 | ||||
-rw-r--r-- | Classes/TopicTableViewCell.m | 19 | ||||
-rw-r--r-- | Classes/TopicsViewController.m | 18 |
8 files changed, 213 insertions, 80 deletions
diff --git a/Classes/BrowseViewController.m b/Classes/BrowseViewController.m index 22742c7..ca39545 100644 --- a/Classes/BrowseViewController.m +++ b/Classes/BrowseViewController.m @@ -21,6 +21,14 @@ - (void)viewDidLoad { [super viewDidLoad]; + [self.navigationController.navigationBar drawLogo]; + + UIView *backgroundView = [[UIView alloc] initWithFrame:self.view.frame]; + backgroundView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"backgroundGradient.png"]]; + + self.tableView.backgroundView = backgroundView; + self.tableView.backgroundColor = [UIColor clearColor]; + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem; diff --git a/Classes/BrowseViewController.xib b/Classes/BrowseViewController.xib index 7baf5fb..022a284 100644 --- a/Classes/BrowseViewController.xib +++ b/Classes/BrowseViewController.xib @@ -45,7 +45,7 @@ <object class="IBUITableView" id="873029372"> <reference key="NSNextResponder" ref="830177019"/> <int key="NSvFlags">274</int> - <string key="NSFrame">{{0, 44}, {320, 387}}</string> + <string key="NSFrameSize">{320, 387}</string> <reference key="NSSuperview" ref="830177019"/> <object class="NSColor" key="IBUIBackgroundColor"> <int key="NSColorSpace">10</int> @@ -93,27 +93,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <float key="IBUISectionHeaderHeight">10</float> <float key="IBUISectionFooterHeight">10</float> </object> - <object class="IBUINavigationBar" id="746896018"> - <reference key="NSNextResponder" ref="830177019"/> - <int key="NSvFlags">290</int> - <string key="NSFrameSize">{320, 44}</string> - <reference key="NSSuperview" ref="830177019"/> - <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> - <object class="NSColor" key="IBUITintColor"> - <int key="NSColorSpace">1</int> - <bytes key="NSRGB">MC4wOTMzOTc2Mzk2OSAwLjE3NTQ0MzM4MTEgMC4yNTAzODczMTEAA</bytes> - </object> - <object class="NSArray" key="IBUIItems"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBUINavigationItem" id="1068085944"> - <reference key="IBUINavigationBar" ref="746896018"/> - <string key="IBUITitle">PicCast</string> - <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> - </object> - </object> - </object> </object> - <string key="NSFrameSize">{320, 431}</string> + <string key="NSFrameSize">{320, 387}</string> <reference key="NSSuperview"/> <object class="NSColor" key="IBUIBackgroundColor"> <int key="NSColorSpace">3</int> @@ -122,6 +103,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <int key="NSID">2</int> </object> </object> + <object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics"> + <bool key="IBUIPrompted">NO</bool> + </object> <object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/> <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> </object> @@ -187,26 +171,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <reference key="object" ref="830177019"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="746896018"/> <reference ref="873029372"/> </object> <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> - <int key="objectID">9</int> - <reference key="object" ref="746896018"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="1068085944"/> - </object> - <reference key="parent" ref="830177019"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">10</int> - <reference key="object" ref="1068085944"/> - <reference key="parent" ref="746896018"/> - </object> - <object class="IBObjectRecord"> <int key="objectID">4</int> <reference key="object" ref="873029372"/> <reference key="parent" ref="830177019"/> @@ -219,20 +188,17 @@ AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <bool key="EncodedWithXMLCoder">YES</bool> <string>-1.CustomClassName</string> <string>-2.CustomClassName</string> - <string>10.IBPluginDependency</string> <string>4.IBEditorWindowLastContentRect</string> <string>4.IBPluginDependency</string> <string>4.IBViewBoundsToFrameTransform</string> <string>8.IBEditorWindowLastContentRect</string> <string>8.IBPluginDependency</string> <string>8.IBViewBoundsToFrameTransform</string> - <string>9.IBPluginDependency</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>BrowseViewController</string> <string>UIResponder</string> - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string>{{329, 376}, {320, 480}}</string> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <object class="NSAffineTransform"> @@ -243,7 +209,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSAffineTransform"> <bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAw9aAAA</bytes> </object> - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> </object> </object> <object class="NSMutableDictionary" key="unlocalizedProperties"> @@ -395,35 +360,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> </object> <object class="IBPartialClassDescription"> - <string key="className">UIBarButtonItem</string> - <string key="superclassName">UIBarItem</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">UIKit.framework/Headers/UIBarButtonItem.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">UIBarItem</string> - <string key="superclassName">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">UIKit.framework/Headers/UIBarItem.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">UINavigationBar</string> - <string key="superclassName">UIView</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier" id="744273050"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">UIKit.framework/Headers/UINavigationBar.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">UINavigationItem</string> - <string key="superclassName">NSObject</string> - <reference key="sourceIdentifier" ref="744273050"/> - </object> - <object class="IBPartialClassDescription"> <string key="className">UIResponder</string> <string key="superclassName">NSObject</string> <reference key="sourceIdentifier" ref="317748069"/> diff --git a/Classes/PhotoViewController.m b/Classes/PhotoViewController.m index 35e58ca..6874df4 100644 --- a/Classes/PhotoViewController.m +++ b/Classes/PhotoViewController.m @@ -47,6 +47,54 @@ [customItem release]; [flex release]; [flex2 release]; + +// UIBarButtonItem *infoDarkButtonType = [[UIButton buttonWithType:UIButtonTypeInfoLight] retain]; +//// infoDarkButtonType = CGRectMake(0.0, 0.0, 25.0, 25.0); +//// infoDarkButtonType.backgroundColor = [UIColor clearColor]; +// [infoDarkButtonType addTarget:self action:@selector(infoButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; +// UIBarButtonItem *infoButton = [[UIBarButtonItem alloc] initWithCustomView:infoDarkButtonType]; +// +// [self.navigationItem.leftBarButtonItem setTitle:@"back"]; + +// self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"back" +// style:UIBarButtonItemStyleBordered +// target:nil +// action:nil]; + +// self.navigationItem.rightBarButtonItem = [UIButton buttonWithType:UIButtonTypeInfoLight]; +// [infoDarkButtonType release]; +// [infoButton release]; +} + +//- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { +// [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; +// self.navigationItem.backBarButtonItem.title = @"back"; +//} + +- (void)updateChrome { + //[self updateTitle]; +// if (![self.previousViewController isKindOfClass: [TTThumbsViewController class]]) { +// if (_photoSource.numberOfPhotos > 1) { +// self.navigationItem.rightBarButtonItem = [[UIBarButtonItem +// alloc] +// initWithTitle:TTLocalizedString(@"See All", @"See all photo +// thumbnails") +// style:UIBarButtonItemStyleBordered target:self action:@selector +// (showThumbnails)]; +// } else { +// self.navigationItem.rightBarButtonItem = [UIButton buttonWithType:UIButtonTypeInfoLight]; +// } +// } else { +// self.navigationItem.rightBarButtonItem = [UIButton buttonWithType:UIButtonTypeInfoLight]; +// } + [super updateChrome]; + self.navigationItem.backBarButtonItem.title = @"back"; + //self.navigationItem.rightBarButtonItem = [UIButton buttonWithType:UIButtonTypeInfoLight]; +// UIBarButtonItem* playButton = [_toolbar itemWithTag:1]; +// playButton.enabled = _photoSource.numberOfPhotos > 1; +// _previousButton.enabled = _centerPhotoIndex > 0; +// _nextButton.enabled = _centerPhotoIndex < +// _photoSource.numberOfPhotos-1; } -(void)action:(id)sender{ diff --git a/Classes/PicCastAppDelegate.m b/Classes/PicCastAppDelegate.m index 3da5a07..854e3c7 100644 --- a/Classes/PicCastAppDelegate.m +++ b/Classes/PicCastAppDelegate.m @@ -9,6 +9,17 @@ #import "PicCastAppDelegate.h" #import <Three20Network/TTURLRequestQueue.h> +// monkey patches! what a racist term :'(, smh lol + +@implementation UIColor (PicCastColors) +-(void) orangeColor { + return [UIColor colorWithRed:1.0 green:143/255.0 blue:0.0 alpha:1.0]; +} + +-(void) yellowColor { + return [UIColor colorWithRed:209/255.0 green:231/255.0 blue:0.0 alpha:1.0]; +} +@end @implementation UINavigationBar (CustomImage) - (void)drawRect:(CGRect)rect { @@ -23,6 +34,37 @@ } //[super drawRect:rect]; } +- (void)drawLogo { + NSLog(@"logo"); + UIImageView *iv = [[[UIImageView alloc] initWithImage:[UIImage imageNamed: @"titleLogo.png"]] retain]; + [iv setFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; + [self addSubview:iv]; + [iv release]; +} +- (void)animateLoading { + UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:CGRectMake(6, 6, 32, 32)]; + + animatedImageView.animationImages = [NSArray arrayWithObjects: + [UIImage imageNamed:@"loading.1.png"], + [UIImage imageNamed:@"loading.2.png"], + [UIImage imageNamed:@"loading.3.png"], + [UIImage imageNamed:@"loading.4.png"], + nil]; + + animatedImageView.animationDuration = 0.25; + animatedImageView.animationRepeatCount = 0; + //add quartz core? + //animatedImageView.layer.opacity = 0.5; + + [self addSubview:animatedImageView]; + [animatedImageView startAnimating]; +} +- (void)stopLoadingAnimation { + for (id obj in [self subviews]) { + if ([obj isKindOfClass:[UIImageView class]] && [(UIImageView *)obj animationDuration] == 0.25) + [obj removeFromSuperview]; + } +} @end @implementation PicCastAppDelegate diff --git a/Classes/SearchViewController.m b/Classes/SearchViewController.m index 8272dd9..e4718be 100644 --- a/Classes/SearchViewController.m +++ b/Classes/SearchViewController.m @@ -17,6 +17,14 @@ - (void)viewDidLoad { [super viewDidLoad]; + [self.navigationController.navigationBar drawLogo]; + + UIView *backgroundView = [[UIView alloc] initWithFrame:self.view.frame]; + backgroundView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"backgroundGradient.png"]]; + + self.tableView.backgroundView = backgroundView; + self.tableView.backgroundColor = [UIColor clearColor]; + [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleSingleLine]; [self.tableView setSeparatorColor:[UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1.0]]; @@ -132,16 +140,49 @@ #pragma mark - #pragma mark uitableviewcontroller protocol +- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section +{ + // create the parent view that will hold header Label + UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(10.0, 0.0, 300.0, 44.0)]; + + // create the button object + UILabel * headerLabel = [[UILabel alloc] initWithFrame:CGRectZero]; + headerLabel.backgroundColor = [UIColor clearColor]; + headerLabel.opaque = NO; + headerLabel.textColor = [UIColor orangeColor]; + headerLabel.highlightedTextColor = [UIColor whiteColor]; + headerLabel.font = [UIFont boldSystemFontOfSize:20]; + headerLabel.frame = CGRectMake(10.0, 0.0, 300.0, 44.0); + + // If you want to align the header text as centered + // headerLabel.frame = CGRectMake(150.0, 0.0, 300.0, 44.0); + + headerLabel.text = @"tamper proof cap"; // i.e. array element + [customView addSubview:headerLabel]; + + return customView; +} + +- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section +{ + return 44.0; +} + - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 10; + return 3; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 5; + return 3; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - return @"tamper proof cap"; + if (section == 0) + return @"Feeds"; + else if (section == 1) + return @"Sets"; + else + return @"Photos"; } //- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath diff --git a/Classes/SourcesEditViewController.xib b/Classes/SourcesEditViewController.xib index 774a35b..ed531bd 100644 --- a/Classes/SourcesEditViewController.xib +++ b/Classes/SourcesEditViewController.xib @@ -12,7 +12,7 @@ </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="8"/> + <integer value="11"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -107,7 +107,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBUINavigationItem" id="478129613"> <reference key="IBUINavigationBar" ref="755609719"/> - <string key="IBUITitle">Edit PicCast Sources</string> + <string key="IBUITitle">Edit Subscriptions</string> <object class="IBUIBarButtonItem" key="IBUIRightBarButtonItem" id="591147835"> <string key="IBUITitle">Done</string> <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> @@ -288,14 +288,35 @@ AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string key="className">SourcesEditViewController</string> <string key="superclassName">UIViewController</string> <object class="NSMutableDictionary" key="actions"> - <string key="NS.key.0">done:</string> - <string key="NS.object.0">id</string> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>done:</string> + <string>switchedOnOff:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>id</string> + <string>id</string> + </object> </object> <object class="NSMutableDictionary" key="actionInfosByName"> - <string key="NS.key.0">done:</string> - <object class="IBActionInfo" key="NS.object.0"> - <string key="name">done:</string> - <string key="candidateClassName">id</string> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>done:</string> + <string>switchedOnOff:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBActionInfo"> + <string key="name">done:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">switchedOnOff:</string> + <string key="candidateClassName">id</string> + </object> </object> </object> <object class="NSMutableDictionary" key="outlets"> diff --git a/Classes/TopicTableViewCell.m b/Classes/TopicTableViewCell.m index c2753b6..03d202d 100644 --- a/Classes/TopicTableViewCell.m +++ b/Classes/TopicTableViewCell.m @@ -21,9 +21,28 @@ } // titleLabel.lineBreakMode = UILineBreakModeWordWrap; // titleLabel.numberOfLines = 0; +// UIView *backgroundView = [[UIView alloc] initWithFrame:self.frame]; +// backgroundView.backgroundColor = [UIColor whiteColor]; +// self.backgroundView = backgroundView; +// [backgroundView release]; + + //self.contentView.backgroundColor = [UIColor whiteColor]; + //NSLog(@"where"); return self; } +//- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier { +// [super initWithFrame:frame reuseIdentifier:reuseIdentifier]; +// NSLog(@"here"); +//} +//- (void)init { +// [super init]; +// NSLog(@"there"); +// UIView *myBackView = [[UIView alloc] initWithFrame:self.frame]; +// myBackView.backgroundColor = [UIColor whiteColor]; +// self.backgroundView = myBackView; +//} + - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [gradient removeFromSuperview]; [super setSelected:selected animated:animated]; diff --git a/Classes/TopicsViewController.m b/Classes/TopicsViewController.m index d7ca089..9505272 100644 --- a/Classes/TopicsViewController.m +++ b/Classes/TopicsViewController.m @@ -30,10 +30,21 @@ - (void)viewDidLoad { [super viewDidLoad]; NSLog(@"viewDidLoad"); + + [self.navigationController.navigationBar drawLogo]; + self.tableView.rowHeight = 100; [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleSingleLine]; [self.tableView setSeparatorColor:[UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1.0]]; + UIView *backgroundView = [[UIView alloc] initWithFrame:self.view.frame]; + backgroundView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"backgroundGradient.png"]]; + + self.tableView.backgroundView = backgroundView; + self.tableView.backgroundColor = [UIColor clearColor]; + + [backgroundView release]; + objMan = [[HJObjManager alloc] initWithLoadingBufferSize:6 memCacheSize:20]; _today = [[Topic dateToString:[NSDate new]] retain]; @@ -203,6 +214,8 @@ } [result close]; [db close]; + + [self.navigationController.navigationBar animateLoading]; } #pragma mark - @@ -218,6 +231,7 @@ } - (void) connection:(NSURLConnection *)connection finishedWithData:(NSData *)data andPayload:(id)payload { + [self.navigationController.navigationBar stopLoadingAnimation]; [self addTopicsFromJson:data forSource:(Source *)payload]; } @@ -369,6 +383,10 @@ [micon clear]; [mi clear]; } + + UIView *myBackView = [[UIView alloc] initWithFrame:cell.frame]; + myBackView.backgroundColor = [UIColor whiteColor]; + cell.backgroundView = myBackView; Topic *topic = [[tableDictionary objectForIndex:[indexPath section]] objectAtIndex:[indexPath row]]; //cell.useDarkBackground = (indexPath.row % 2 == 0); |