mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
93 lines
2.9 KiB
Objective-C
93 lines
2.9 KiB
Objective-C
//
|
|
// NewsBlurAppDelegate.m
|
|
// NewsBlur
|
|
//
|
|
// Created by Samuel Clay on 6/16/10.
|
|
// Copyright NewsBlur 2010. All rights reserved.
|
|
//
|
|
|
|
#import "NewsBlurAppDelegate.h"
|
|
#import "NewsBlurViewController.h"
|
|
#import "FeedDetailViewController.h"
|
|
#import "StoryDetailViewController.h"
|
|
|
|
@implementation NewsBlurAppDelegate
|
|
|
|
@synthesize window;
|
|
@synthesize navigationController;
|
|
@synthesize feedsViewController;
|
|
@synthesize feedDetailViewController;
|
|
@synthesize storyDetailViewController;
|
|
|
|
@synthesize activeFeed;
|
|
@synthesize activeFeedStories;
|
|
@synthesize activeStory;
|
|
|
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
|
navigationController.viewControllers = [NSArray arrayWithObject:feedsViewController];
|
|
|
|
[window addSubview:navigationController.view];
|
|
[window makeKeyAndVisible];
|
|
|
|
return YES;
|
|
}
|
|
|
|
- (void)dealloc {
|
|
[feedsViewController release];
|
|
[feedDetailViewController release];
|
|
[storyDetailViewController release];
|
|
[navigationController release];
|
|
[window release];
|
|
[activeFeed release];
|
|
[activeFeedStories release];
|
|
[activeStory release];
|
|
[super dealloc];
|
|
}
|
|
|
|
- (void)hideNavigationBar:(BOOL)animated {
|
|
[[self navigationController] setNavigationBarHidden:YES animated:animated];
|
|
}
|
|
|
|
- (void)showNavigationBar:(BOOL)animated {
|
|
[[self navigationController] setNavigationBarHidden:NO animated:animated];
|
|
}
|
|
|
|
#pragma mark -
|
|
#pragma mark Views
|
|
|
|
- (void)loadFeedDetailView {
|
|
UINavigationController *navController = self.navigationController;
|
|
[[self retain] autorelease];
|
|
UILabel *label = [[UILabel alloc] init];
|
|
[label setFont:[UIFont boldSystemFontOfSize:16.0]];
|
|
[label setBackgroundColor:[UIColor clearColor]];
|
|
[label setTextColor:[UIColor whiteColor]];
|
|
[label setText:[activeFeed objectForKey:@"feed_title"]];
|
|
[label sizeToFit];
|
|
[navController.navigationBar.topItem setTitleView:label];
|
|
navController.navigationBar.backItem.title = @"All";
|
|
[label release];
|
|
navController.navigationBar.tintColor = [UIColor colorWithRed:0.16f green:0.36f blue:0.46 alpha:0.8];
|
|
|
|
[navController pushViewController:feedDetailViewController animated:YES];
|
|
NSLog(@"Released feedDetailViewController");
|
|
}
|
|
|
|
- (void)loadStoryDetailView {
|
|
UINavigationController *navController = self.navigationController;
|
|
[[self retain] autorelease];
|
|
UILabel *label = [[UILabel alloc] init];
|
|
[label setFont:[UIFont boldSystemFontOfSize:16.0]];
|
|
[label setBackgroundColor:[UIColor clearColor]];
|
|
[label setTextColor:[UIColor whiteColor]];
|
|
[label setText:[activeStory objectForKey:@"story_title"]];
|
|
[label sizeToFit];
|
|
[navController.navigationBar.topItem setTitleView:label];
|
|
navController.navigationBar.backItem.title = @"Stories";
|
|
[label release];
|
|
[navController pushViewController:storyDetailViewController animated:YES];
|
|
}
|
|
|
|
|
|
|
|
@end
|