Commit 4660b5f7 authored by Felix Paul Kühne's avatar Felix Paul Kühne

menu: reveal public method to the public so view controllers don't have to...

menu: reveal public method to the public so view controllers don't have to abuse the reveal controller to switch context
parent ba078d20
......@@ -11,6 +11,7 @@
#import "VLCDropboxTableViewController.h"
#import "VLCHTTPUploaderController.h"
#import "GHRevealViewController.h"
#import "VLCMenuTableViewController.h"
@class VLCPlaylistViewController;
@class PAPasscodeViewController;
......@@ -26,6 +27,7 @@
@property (nonatomic, strong) UIWindow *window;
@property (nonatomic, strong) GHRevealViewController *revealController;
@property (nonatomic, strong) VLCMenuTableViewController *menuViewController;
@property (nonatomic, retain) NSDate *nextPasscodeCheckDate;
......
......@@ -63,7 +63,8 @@
[navCon loadTheme];
_revealController = [[GHRevealViewController alloc] initWithNibName:nil bundle:nil];
_revealController.sidebarViewController = [[VLCMenuTableViewController alloc] initWithNibName:nil bundle:nil];
_menuViewController = [[VLCMenuTableViewController alloc] initWithNibName:nil bundle:nil];
_revealController.sidebarViewController = _menuViewController;
_revealController.contentViewController = navCon;
self.window.rootViewController = self.revealController;
......@@ -100,12 +101,7 @@
[self updateMediaList];
} else {
NSURL *parsedUrl = [self parseOpenURL:url];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self.playlistViewController];
[navController loadTheme];
self.revealController.contentViewController = navController;
[self.revealController toggleSidebar:NO duration:kGHRevealSidebarDefaultAnimationDuration];
[self.menuViewController selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionNone];
[self.playlistViewController performSelector:@selector(openMovieFromURL:) withObject:parsedUrl afterDelay:kGHRevealSidebarDefaultAnimationDuration];
}
return YES;
......
......@@ -20,4 +20,6 @@
@property (nonatomic, strong) UITableView *tableView;
- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition;
@end
......@@ -13,6 +13,7 @@
#import "VLCPlaylistViewController.h"
#import "UIBarButtonItem+Theme.h"
#import "UINavigationController+Theme.h"
#import "VLCMenuTableViewController.h"
@interface VLCOpenNetworkStreamViewController ()
{
......@@ -160,13 +161,7 @@
- (void)_openURLStringAndDismiss:(NSString *)url
{
VLCAppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:appDelegate.playlistViewController];
[navController loadTheme];
appDelegate.revealController.contentViewController = navController;
[appDelegate.revealController toggleSidebar:NO duration:kGHRevealSidebarDefaultAnimationDuration];
[appDelegate.menuViewController selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionNone];
[appDelegate.playlistViewController performSelector:@selector(openMovieFromURL:) withObject:[NSURL URLWithString:url] afterDelay:kGHRevealSidebarDefaultAnimationDuration];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment