Commit 9c02e221 authored by Tamas Timar's avatar Tamas Timar Committed by Felix Paul Kühne

Translucent navbar for non-scrollable view controllers on iOS 7

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 5df918d5
......@@ -74,6 +74,8 @@
_revealController.contentViewController = navCon;
self.window.rootViewController = self.revealController;
// necessary to avoid navbar blinking in VLCOpenNetworkStreamViewController & VLCDownloadViewController
_revealController.contentViewController.view.backgroundColor = [UIColor colorWithWhite:.122 alpha:1.];
[self.window makeKeyAndVisible];
VLCMediaFileDiscoverer *discoverer = [VLCMediaFileDiscoverer sharedInstance];
......
......@@ -48,19 +48,21 @@
- (void)viewDidLoad
{
[super viewDidLoad];
[self.downloadButton setTitle:NSLocalizedString(@"BUTTON_DOWNLOAD",@"") forState:UIControlStateNormal];
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
self.title = NSLocalizedString(@"DOWNLOAD_FROM_HTTP", @"");
self.whatToDownloadHelpLabel.text = [NSString stringWithFormat:NSLocalizedString(@"DOWNLOAD_FROM_HTTP_HELP", @""), [[UIDevice currentDevice] model]];
self.urlField.delegate = self;
self.urlField.keyboardType = UIKeyboardTypeURL;
[super viewDidLoad];
if (SYSTEM_RUNS_IOS7_OR_LATER)
self.edgesForExtendedLayout = UIRectEdgeNone;
}
- (void)viewWillAppear:(BOOL)animated
{
self.navigationController.navigationBar.translucent = NO;
if ([[UIPasteboard generalPasteboard] containsPasteboardTypes:@[@"public.url", @"public.text"]]) {
NSURL *pasteURL = [[UIPasteboard generalPasteboard] valueForPasteboardType:@"public.url"];
if (!pasteURL || [[pasteURL absoluteString] isEqualToString:@""]) {
......@@ -76,13 +78,6 @@
[super viewWillAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated
{
if (SYSTEM_RUNS_IOS7_OR_LATER)
self.navigationController.navigationBar.translucent = YES;
[super viewWillDisappear:animated];
}
#pragma mark - UI interaction
- (BOOL)shouldAutorotate
......
......@@ -328,10 +328,17 @@
if (!viewController)
return;
UINavigationController *navCon = [[UINavigationController alloc] initWithRootViewController:viewController];
[navCon loadTheme];
UINavigationController *navCon = nil;
if ([_revealController.contentViewController isKindOfClass:[UINavigationController class]]) {
navCon = (UINavigationController*)_revealController.contentViewController;
navCon.viewControllers = @[viewController];
} else {
navCon = [[UINavigationController alloc] initWithRootViewController:viewController];
[navCon loadTheme];
_revealController.contentViewController = navCon;
}
_revealController.contentViewController = navCon;
[_revealController toggleSidebar:NO duration:kGHRevealSidebarDefaultAnimationDuration];
}
......
......@@ -60,12 +60,13 @@
self.passwordField.delegate = self;
self.passwordField.returnKeyType = UIReturnKeyDone;
self.passwordField.clearButtonMode = UITextFieldViewModeWhileEditing;
if (SYSTEM_RUNS_IOS7_OR_LATER)
self.edgesForExtendedLayout = UIRectEdgeNone;
}
- (void)viewWillAppear:(BOOL)animated
{
self.navigationController.navigationBar.translucent = NO;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
_saveServer = [NSMutableArray arrayWithArray:[defaults objectForKey:kVLCFTPServer]];
_saveLogin = [NSMutableArray arrayWithArray:[defaults objectForKey:kVLCFTPLogin]];
......
......@@ -35,6 +35,7 @@
- (void)viewDidLoad
{
[super viewDidLoad];
[self.openButton setTitle:NSLocalizedString(@"BUTTON_OPEN", @"") forState:UIControlStateNormal];
[self.privateModeLabel setText:NSLocalizedString(@"PRIVATE_PLAYBACK_TOGGLE", @"")];
self.title = NSLocalizedString(@"OPEN_NETWORK", @"");
......@@ -42,12 +43,13 @@
[self.whatToOpenHelpLabel setText:NSLocalizedString(@"OPEN_NETWORK_HELP", @"")];
self.urlField.delegate = self;
self.urlField.keyboardType = UIKeyboardTypeURL;
if (SYSTEM_RUNS_IOS7_OR_LATER)
self.edgesForExtendedLayout = UIRectEdgeNone;
}
- (void)viewWillAppear:(BOOL)animated
{
self.navigationController.navigationBar.translucent = NO;
if ([[UIPasteboard generalPasteboard] containsPasteboardTypes:@[@"public.url", @"public.text"]]) {
NSURL *pasteURL = [[UIPasteboard generalPasteboard] valueForPasteboardType:@"public.url"];
if (!pasteURL || [[pasteURL absoluteString] isEqualToString:@""]) {
......@@ -68,9 +70,6 @@
- (void)viewWillDisappear:(BOOL)animated
{
if (SYSTEM_RUNS_IOS7_OR_LATER)
self.navigationController.navigationBar.translucent = YES;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[NSArray arrayWithArray:_recentURLs] forKey:kVLCRecentURLs];
[defaults setBool:self.privateToggleSwitch.on forKey:kVLCPrivateWebStreaming];
......
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