Commit 6a08098a authored by Felix Paul Kühne's avatar Felix Paul Kühne

Unify menu behavior for pad and phone form factors

parent c72e8c36
......@@ -24,11 +24,8 @@
[contributeButton setBackgroundImage:[UIImage imageNamed:@"button"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[contributeButton setBackgroundImage:[UIImage imageNamed:@"buttonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
self.navigationItem.rightBarButtonItem = contributeButton;
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
} else
self.navigationItem.leftBarButtonItem = contributeButton;
self.navigationItem.rightBarButtonItem = contributeButton;
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
NSMutableString *htmlContent = [NSMutableString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"About Contents" ofType:@"html"] encoding:NSUTF8StringEncoding error:nil];
[htmlContent replaceOccurrencesOfString:@"ASPENVERSION" withString:[[NSString stringWithFormat:NSLocalizedString(@"VERSION_FORMAT",@""), [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]] stringByAppendingFormat:@" %@", kVLCVersionCodename] options:NSLiteralSearch range:NSMakeRange(0, 1000)];
......
......@@ -56,8 +56,7 @@
_backButton = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(goBack:)];
_backToMenuButton = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
self.navigationItem.leftBarButtonItem = _backToMenuButton;
self.navigationItem.leftBarButtonItem = _backToMenuButton;
self.tableView.rowHeight = [VLCDropboxTableViewCell heightOfCell];
self.tableView.separatorColor = [UIColor colorWithWhite:.122 alpha:1.];
......@@ -117,10 +116,7 @@
[_activityIndicator startAnimating];
[_dropboxController requestDirectoryListingAtPath:_currentPath];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
self.navigationItem.leftBarButtonItem = ![_currentPath isEqualToString:@"/"] ? _backButton : nil;
else
self.navigationItem.leftBarButtonItem = ![_currentPath isEqualToString:@"/"] ? _backButton : _backToMenuButton;
self.navigationItem.leftBarButtonItem = ![_currentPath isEqualToString:@"/"] ? _backButton : _backToMenuButton;
}
#pragma mark - interface interaction
......
......@@ -26,8 +26,7 @@
{
[self.downloadButton setTitle:NSLocalizedString(@"BUTTON_DOWNLOAD",@"") forState:UIControlStateNormal];
_currentDownloads = [[NSMutableArray alloc] init];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
self.title = NSLocalizedString(@"DOWNLOAD_FROM_HTTP", @"");
[super viewDidLoad];
}
......
......@@ -123,8 +123,7 @@
if (!self.settingsViewController) {
self.settingsViewController = [[IASKAppSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
self.settingsController.viewController = self.settingsViewController;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
self.settingsViewController.navigationItem.leftBarButtonItem = [UIBarButtonItem themedBackButtonWithTarget:self.settingsViewController andSelector:@selector(dismiss:)];
self.settingsViewController.navigationItem.leftBarButtonItem = [UIBarButtonItem themedBackButtonWithTarget:self.settingsViewController andSelector:@selector(dismiss:)];
}
self.settingsViewController.modalPresentationStyle = UIModalPresentationFormSheet;
......@@ -164,24 +163,12 @@
- (void)_presentViewController:(UIViewController *)viewController
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
[navController loadTheme];
navController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:navController animated:YES];
if (viewController.navigationItem.rightBarButtonItem == nil) {
UIBarButtonItem *doneButton = [UIBarButtonItem themedDoneButtonWithTarget:self andSelector:@selector(_dismissModalViewController)];
viewController.navigationItem.rightBarButtonItem = doneButton;
}
} else {
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
[navController loadTheme];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
[navController loadTheme];
GHRevealViewController *ghVC = [(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController];
ghVC.contentViewController = navController;
[ghVC toggleSidebar:NO duration:kGHRevealSidebarDefaultAnimationDuration];
}
GHRevealViewController *ghVC = [(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController];
ghVC.contentViewController = navController;
[ghVC toggleSidebar:NO duration:kGHRevealSidebarDefaultAnimationDuration];
}
#pragma mark - shake to support
......
......@@ -36,9 +36,7 @@
[self.openButton setTitle:NSLocalizedString(@"BUTTON_OPEN", @"") forState:UIControlStateNormal];
[self.privateModeLabel setText:NSLocalizedString(@"PRIVATE_PLAYBACK_TOGGLE", @"")];
self.title = NSLocalizedString(@"OPEN_NETWORK", @"");
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
}
- (void)viewWillAppear:(BOOL)animated
......
......@@ -45,10 +45,7 @@
- (void)settingsViewControllerDidEnd:(IASKAppSettingsViewController*)sender
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
[[(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController] toggleSidebar:![(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController].sidebarShowing duration:kGHRevealSidebarDefaultAnimationDuration];
else
[self.viewController.navigationController dismissModalViewControllerAnimated:YES];
[[(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController] toggleSidebar:![(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController].sidebarShowing duration:kGHRevealSidebarDefaultAnimationDuration];
}
- (void)settingsViewController:(IASKAppSettingsViewController*)sender buttonTappedForSpecifier:(IASKSpecifier*)specifier {
......
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