Commit 68f68009 authored by Felix Paul Kühne's avatar Felix Paul Kühne

fix a couple of iOS 7 warnings

parent 7abf8962
......@@ -95,7 +95,7 @@
navigationBar.items = @[self.navigationItem];
navigationBar.barTintColor = [UIColor VLCOrangeTintColor];
navigationBar.tintColor = [UIColor whiteColor];
navigationBar.titleTextAttributes = @{ UITextAttributeTextColor : [UIColor whiteColor] };
navigationBar.titleTextAttributes = @{ NSForegroundColorAttributeName : [UIColor whiteColor] };
[view addSubview:navigationBar];
contentView = [[UIView alloc] initWithFrame:CGRectMake(0, NAVBAR_HEIGHT, view.bounds.size.width, view.bounds.size.height-NAVBAR_HEIGHT)];
......
......@@ -20,7 +20,8 @@
target:target
action:selector];
backButton.tintColor = [UIColor whiteColor];
[backButton setTitleTextAttributes:@{UITextAttributeTextShadowColor : [UIColor colorWithWhite:0. alpha:.37], UITextAttributeTextColor : [UIColor whiteColor]} forState:UIControlStateNormal];
NSShadow *shadow = [[NSShadow alloc] init];
[backButton setTitleTextAttributes:@{NSShadowAttributeName : shadow, NSForegroundColorAttributeName : [UIColor whiteColor]} forState:UIControlStateNormal];
[backButton setTitlePositionAdjustment:UIOffsetMake(3, 0) forBarMetrics:UIBarMetricsDefault];
return backButton;
}
......
......@@ -121,18 +121,19 @@ NSString *const VLCDropboxSessionWasAuthorized = @"VLCDropboxSessionWasAuthorize
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// enable crash preventer
void (^setupBlock)() = ^{
_playlistViewController = [[VLCPlaylistViewController alloc] init];
void (^setupBlock)() = ^{
_playlistViewController = [[VLCPlaylistViewController alloc] init];
UINavigationController *navCon = [[VLCNavigationController alloc] initWithRootViewController:_playlistViewController];
_revealController = [[GHRevealViewController alloc] initWithNibName:nil bundle:nil];
_revealController.wantsFullScreenLayout = YES;
_revealController.extendedLayoutIncludesOpaqueBars = YES;
_revealController.edgesForExtendedLayout = UIRectEdgeAll;
_menuViewController = [[VLCMenuTableViewController alloc] initWithNibName:nil bundle:nil];
_revealController.sidebarViewController = _menuViewController;
_revealController.contentViewController = navCon;
_playerDisplayController = [[VLCPlayerDisplayController alloc] init];
_playerDisplayController.childViewController = self.revealController;
_playerDisplayController = [[VLCPlayerDisplayController alloc] init];
_playerDisplayController.childViewController = self.revealController;
self.window.rootViewController = _playerDisplayController;
// necessary to avoid navbar blinking in VLCOpenNetworkStreamViewController & VLCDownloadViewController
......
......@@ -53,7 +53,7 @@
_progressBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:_progressView];
_numberOfFilesBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@"NUM_OF_FILES", nil), 0] style:UIBarButtonItemStylePlain target:nil action:nil];
[_numberOfFilesBarButtonItem setTitleTextAttributes:@{ UITextAttributeFont : [UIFont systemFontOfSize:11.] } forState:UIControlStateNormal];
[_numberOfFilesBarButtonItem setTitleTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:11.] } forState:UIControlStateNormal];
_activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
_activityIndicator.hidesWhenStopped = YES;
......
......@@ -142,7 +142,8 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
[super viewDidLoad];
CGRect rect;
self.wantsFullScreenLayout = YES;
self.extendedLayoutIncludesOpaqueBars = YES;
self.edgesForExtendedLayout = UIRectEdgeAll;
self.videoFilterView.hidden = YES;
_videoFiltersHidden = YES;
......@@ -1374,10 +1375,15 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
[mediaPlayer jumpBackward:1];
} else if (_currentPanType == VLCPanTypeVolume) {
MPMusicPlayerController *musicPlayer = [MPMusicPlayerController applicationMusicPlayer];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
// there is no replacement for .volume which we want to use since Apple's susggestion is to not use their overlays
// but switch to the volume slider exclusively. meh.
if (panDirectionY > 0)
musicPlayer.volume -= 0.01;
else
musicPlayer.volume += 0.01;
#pragma clang diagnostic pop
} else if (_currentPanType == VLCPanTypeBrightness) {
CGFloat brightness = [UIScreen mainScreen].brightness;
......
......@@ -29,7 +29,7 @@
UINavigationBar *navigationBar = self.navigationBar;
navigationBar.barTintColor = [UIColor VLCOrangeTintColor];
navigationBar.tintColor = [UIColor whiteColor];
navigationBar.titleTextAttributes = @{ UITextAttributeTextColor : [UIColor whiteColor] };
navigationBar.titleTextAttributes = @{ NSForegroundColorAttributeName : [UIColor whiteColor] };
_setup = YES;
}
......
......@@ -45,7 +45,7 @@
- (void)updateTime:(NSString *)time
{
[self.progressLabel setText:[NSString stringWithFormat:NSLocalizedString(@"REMAINING_TIME", nil), time]];
CGSize size = [self.progressLabel.text sizeWithFont:self.progressLabel.font];
CGSize size = [self.progressLabel.text sizeWithAttributes:self.progressLabel.font.fontDescriptor.fontAttributes];
[self.progressLabel setFrame:CGRectMake(self.progressLabel.frame.origin.x, self.progressLabel.frame.origin.y, size.width, size.height)];
}
......
......@@ -33,8 +33,6 @@
self.textLabel.shadowColor = [UIColor VLCDarkTextShadowColor];
self.textLabel.textColor = [UIColor whiteColor];
self.textLabel.adjustsFontSizeToFitWidth = YES;
if ([self.textLabel respondsToSelector:@selector(setAdjustsLetterSpacingToFitWidth:)])
self.textLabel.adjustsLetterSpacingToFitWidth = YES;
self.textLabel.minimumScaleFactor = 0.5f;
self.textLabel.lineBreakMode = NSLineBreakByTruncatingTail;
......
......@@ -103,7 +103,7 @@
- (CGSize)sizeThatFits:(CGSize)size
{
CGSize textSize = [self.text sizeWithFont:self.font];
CGSize textSize = [self.text sizeWithAttributes:self.font.fontDescriptor.fontAttributes];
textSize.width += 16.f; // take extra width into account for our custom drawing
return textSize;
}
......
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