Commit 59becbf7 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Skin back button correctly everywhere

parent bad3ae21
...@@ -23,9 +23,10 @@ ...@@ -23,9 +23,10 @@
[contributeButton setBackgroundImage:[UIImage imageNamed:@"button"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; [contributeButton setBackgroundImage:[UIImage imageNamed:@"button"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[contributeButton setBackgroundImage:[UIImage imageNamed:@"buttonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault]; [contributeButton setBackgroundImage:[UIImage imageNamed:@"buttonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
self.navigationItem.rightBarButtonItem = contributeButton; self.navigationItem.rightBarButtonItem = contributeButton;
else self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(goBack:)];
} else
self.navigationItem.leftBarButtonItem = contributeButton; self.navigationItem.leftBarButtonItem = contributeButton;
NSMutableString *htmlContent = [NSMutableString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"About Contents" ofType:@"html"] encoding:NSUTF8StringEncoding error:nil]; NSMutableString *htmlContent = [NSMutableString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"About Contents" ofType:@"html"] encoding:NSUTF8StringEncoding error:nil];
...@@ -36,6 +37,11 @@ ...@@ -36,6 +37,11 @@
self.webView.delegate = self; self.webView.delegate = self;
} }
- (IBAction)goBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{ {
NSURL *requestURL = request.URL; NSURL *requestURL = request.URL;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#import "VLCHTTPDownloadViewController.h" #import "VLCHTTPDownloadViewController.h"
#import "VLCHTTPFileDownloader.h" #import "VLCHTTPFileDownloader.h"
#import "UIBarButtonItem+Theme.h"
@interface VLCHTTPDownloadViewController () @interface VLCHTTPDownloadViewController ()
{ {
...@@ -24,6 +25,8 @@ ...@@ -24,6 +25,8 @@
{ {
[self.downloadButton setTitle:NSLocalizedString(@"BUTTON_DOWNLOAD",@"") forState:UIControlStateNormal]; [self.downloadButton setTitle:NSLocalizedString(@"BUTTON_DOWNLOAD",@"") forState:UIControlStateNormal];
_currentDownloads = [[NSMutableArray alloc] init]; _currentDownloads = [[NSMutableArray alloc] init];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(goBack:)];
[super viewDidLoad]; [super viewDidLoad];
} }
...@@ -44,6 +47,11 @@ ...@@ -44,6 +47,11 @@
} }
#pragma mark - UI interaction #pragma mark - UI interaction
- (IBAction)goBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)downloadAction:(id)sender - (IBAction)downloadAction:(id)sender
{ {
if ([self.urlField.text length] > 0) { if ([self.urlField.text length] > 0) {
......
...@@ -136,6 +136,8 @@ ...@@ -136,6 +136,8 @@
if (!self.settingsViewController) { if (!self.settingsViewController) {
self.settingsViewController = [[IASKAppSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped]; self.settingsViewController = [[IASKAppSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
self.settingsController.viewController = self.settingsViewController; self.settingsController.viewController = self.settingsViewController;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
self.settingsViewController.navigationItem.leftBarButtonItem = [UIBarButtonItem themedBackButtonWithTarget:self.settingsViewController andSelector:@selector(dismiss:)];
} }
self.settingsViewController.modalPresentationStyle = UIModalPresentationFormSheet; self.settingsViewController.modalPresentationStyle = UIModalPresentationFormSheet;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import "VLCOpenNetworkStreamViewController.h" #import "VLCOpenNetworkStreamViewController.h"
#import "VLCAppDelegate.h" #import "VLCAppDelegate.h"
#import "VLCPlaylistViewController.h" #import "VLCPlaylistViewController.h"
#import "UIBarButtonItem+Theme.h"
@interface VLCOpenNetworkStreamViewController () @interface VLCOpenNetworkStreamViewController ()
{ {
...@@ -34,6 +35,9 @@ ...@@ -34,6 +35,9 @@
[super viewDidLoad]; [super viewDidLoad];
[self.openButton setTitle:NSLocalizedString(@"BUTTON_OPEN", @"") forState:UIControlStateNormal]; [self.openButton setTitle:NSLocalizedString(@"BUTTON_OPEN", @"") forState:UIControlStateNormal];
[self.privateModeLabel setText:NSLocalizedString(@"PRIVATE_PLAYBACK_TOGGLE", @"")]; [self.privateModeLabel setText:NSLocalizedString(@"PRIVATE_PLAYBACK_TOGGLE", @"")];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(goBack:)];
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
...@@ -71,6 +75,11 @@ ...@@ -71,6 +75,11 @@
} }
#pragma mark - UI interaction #pragma mark - UI interaction
- (IBAction)goBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)openButtonAction:(id)sender - (IBAction)openButtonAction:(id)sender
{ {
if ([self.urlField.text length] > 0) { if ([self.urlField.text length] > 0) {
......
...@@ -45,7 +45,10 @@ ...@@ -45,7 +45,10 @@
- (void)settingsViewControllerDidEnd:(IASKAppSettingsViewController*)sender - (void)settingsViewControllerDidEnd:(IASKAppSettingsViewController*)sender
{ {
[self.viewController.navigationController dismissModalViewControllerAnimated:YES]; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
[self.viewController.navigationController popViewControllerAnimated:YES];
else
[self.viewController.navigationController dismissModalViewControllerAnimated:YES];
} }
- (void)settingsViewController:(IASKAppSettingsViewController*)sender buttonTappedForSpecifier:(IASKSpecifier*)specifier { - (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