Commit 4864f628 authored by Felix Paul Kühne's avatar Felix Paul Kühne

The future is now.

parent 1b69e82f
......@@ -17,7 +17,7 @@
style:UIBarButtonItemStyleBordered
target:target
action:selector];
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
doneButton.tintColor = [UIColor whiteColor];
else {
[doneButton setBackgroundImage:[UIImage imageNamed:@"doneButton"]
......@@ -38,7 +38,7 @@
style:UIBarButtonItemStyleBordered
target:target
action:selector];
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
backButton.tintColor = [UIColor whiteColor];
else {
[backButton setBackgroundImage:[[UIImage imageNamed:@"backButton"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 12, 0, 6)]
......@@ -56,7 +56,7 @@
+ (UIBarButtonItem *)themedRevealMenuButtonWithTarget:(id)target andSelector:(SEL)selector
{
UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"menuCone"] style:UIBarButtonItemStyleBordered target:target action:selector];
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
menuButton.tintColor = [UIColor whiteColor];
else {
[menuButton setBackgroundImage:[UIImage imageNamed:@"button"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
......
......@@ -14,7 +14,7 @@
- (void)loadTheme
{
UINavigationBar *navBar = self.navigationBar;
if (!SYSTEM_RUNS_IN_THE_FUTURE) {
if (!SYSTEM_RUNS_IOS7_OR_LATER) {
[navBar setBackgroundImage:[UIImage imageNamed:@"navBarBackground"]
forBarMetrics:UIBarMetricsDefault];
navBar.barStyle = UIBarStyleBlack;
......
......@@ -22,9 +22,9 @@
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#ifdef __IPHONE_7_0
#define SYSTEM_RUNS_IN_THE_FUTURE SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")
#define SYSTEM_RUNS_IOS7_OR_LATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")
#else
#define SYSTEM_RUNS_IN_THE_FUTURE NO
#define SYSTEM_RUNS_IOS7_OR_LATER NO
#endif
#ifndef NDEBUG
......
......@@ -21,7 +21,7 @@
self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"title"]];
UIBarButtonItem *contributeButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"BUTTON_CONTRIBUTE",@"") style:UIBarButtonItemStyleBordered target:self action:@selector(openContributePage:)];
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
contributeButton.tintColor = [UIColor whiteColor];
else {
[contributeButton setBackgroundImage:[UIImage imageNamed:@"button"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
......
......@@ -78,7 +78,7 @@
- (void)viewWillDisappear:(BOOL)animated
{
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
self.navigationController.navigationBar.translucent = YES;
[super viewWillDisappear:animated];
}
......
......@@ -77,7 +77,7 @@
self.view = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, kGHRevealSidebarWidth, CGRectGetHeight(self.view.bounds))];
[self.view addSubview:_tableView];
if (SYSTEM_RUNS_IN_THE_FUTURE) {
if (SYSTEM_RUNS_IOS7_OR_LATER) {
UIView *brandingBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, kGHRevealSidebarWidth, 64.0f)];
brandingBackgroundView.backgroundColor = [UIColor colorWithRed:0.1608 green:0.1608 blue:0.1608 alpha:1.0000];
[self.view addSubview:brandingBackgroundView];
......
......@@ -199,7 +199,7 @@
[self.aspectRatioButton setBackgroundImage:[UIImage imageNamed:@"ratioButton"] forState:UIControlStateNormal];
[self.aspectRatioButton setBackgroundImage:[UIImage imageNamed:@"ratioButtonHighlight"] forState:UIControlStateHighlighted];
[self.aspectRatioButton setImage:[UIImage imageNamed:@"ratioIcon"] forState:UIControlStateNormal];
if (SYSTEM_RUNS_IN_THE_FUTURE) {
if (SYSTEM_RUNS_IOS7_OR_LATER) {
self.backButton.tintColor = [UIColor colorWithRed:(190.0f/255.0f) green:(190.0f/255.0f) blue:(190.0f/255.0f) alpha:1.];
self.toolbar.tintColor = [UIColor whiteColor];
self.toolbar.barTintColor = [UIColor colorWithWhite:0.f alpha:1.f];
......@@ -271,7 +271,7 @@
[self.navigationController setNavigationBarHidden:YES animated:YES];
if (!SYSTEM_RUNS_IN_THE_FUTURE) {
if (!SYSTEM_RUNS_IOS7_OR_LATER) {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackTranslucent;
}
......@@ -448,7 +448,7 @@
_idleTimer = nil;
}
[self.navigationController setNavigationBarHidden:NO animated:YES];
if (!SYSTEM_RUNS_IN_THE_FUTURE)
if (!SYSTEM_RUNS_IOS7_OR_LATER)
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
[super viewWillDisappear:animated];
......
......@@ -74,7 +74,7 @@
- (IBAction)dismissWithAnimation:(id)sender
{
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
self.navigationController.navigationBar.translucent = YES;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
......@@ -85,7 +85,7 @@
- (IBAction)dismiss:(id)sender
{
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
self.navigationController.navigationBar.translucent = YES;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
......
......@@ -68,7 +68,7 @@
- (void)viewWillDisappear:(BOOL)animated
{
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
self.navigationController.navigationBar.translucent = YES;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
......
......@@ -18,7 +18,7 @@
+ (VLCPlaylistTableViewCell *)cellWithReuseIdentifier:(NSString *)ident
{
NSArray *nibContentArray;
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
nibContentArray = [[NSBundle mainBundle] loadNibNamed:@"VLCFuturePlaylistTableViewCell" owner:nil options:nil];
else
nibContentArray = [[NSBundle mainBundle] loadNibNamed:@"VLCPlaylistTableViewCell" owner:nil options:nil];
......@@ -122,7 +122,7 @@
+ (CGFloat)heightOfCell
{
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
return 90.;
return 80.;
......@@ -134,7 +134,7 @@
{
self.titleLabel.text = show.name;
NSUInteger count = show.episodes.count;
if (SYSTEM_RUNS_IN_THE_FUTURE) {
if (SYSTEM_RUNS_IOS7_OR_LATER) {
NSString *string = @"";
if (show.releaseYear)
string = [NSString stringWithFormat:@"%@ — ", show.releaseYear];
......@@ -152,7 +152,7 @@
{
MLFile *anyFileFromTrack = albumTrack.files.anyObject;
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@ — %@", albumTrack.artist, [NSString stringWithFormat:NSLocalizedString(@"LIBRARY_TRACK_N", @""), albumTrack.trackNumber.intValue], [VLCTime timeWithNumber:[anyFileFromTrack duration]]];
else {
self.artistNameLabel.text = albumTrack.artist;
......@@ -184,7 +184,7 @@
self.titleLabel.text = album.name;
MLAlbumTrack *anyTrack = [album.tracks anyObject];
NSUInteger count = album.tracks.count;
if (SYSTEM_RUNS_IN_THE_FUTURE) {
if (SYSTEM_RUNS_IOS7_OR_LATER) {
NSMutableString *string = [[NSMutableString alloc] init];
if (anyTrack) {
[string appendString:anyTrack.artist];
......@@ -205,7 +205,7 @@
- (void)_configureForMLFile:(MLFile *)mediaFile
{
if (mediaFile.isAlbumTrack) {
if (SYSTEM_RUNS_IN_THE_FUTURE) {
if (SYSTEM_RUNS_IOS7_OR_LATER) {
NSString *string = @"";
if (mediaFile.albumTrack.artist)
string = [NSString stringWithFormat:@"%@ — ", mediaFile.albumTrack.artist];
......@@ -240,7 +240,7 @@
{
CGFloat position = mediaItem.lastPosition.floatValue;
if (SYSTEM_RUNS_IN_THE_FUTURE) {
if (SYSTEM_RUNS_IOS7_OR_LATER) {
CGFloat duration = mediaItem.duration.floatValue;
if (position > .1f && position < .95f) {
[(UITextView*)self.mediaIsUnreadView setText:[NSString stringWithFormat:NSLocalizedString(@"LIBRARY_MINUTES_LEFT", @""), [[VLCTime timeWithInt:(duration * position - duration)] minuteStringValue]]];
......
......@@ -49,7 +49,7 @@
_tableView.dataSource = self;
self.view = _tableView;
if (SYSTEM_RUNS_IN_THE_FUTURE) {
if (SYSTEM_RUNS_IOS7_OR_LATER) {
UILongPressGestureRecognizer *gestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(tableViewLongTouchGestureAction:)];
[self.view addGestureRecognizer:gestureRecognizer];
}
......@@ -63,7 +63,7 @@
_collectionView.dataSource = self;
self.view = _collectionView;
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
[_collectionView registerNib:[UINib nibWithNibName:@"VLCFuturePlaylistCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:@"PlaylistCell"];
else
[_collectionView registerNib:[UINib nibWithNibName:@"VLCPlaylistCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:@"PlaylistCell"];
......@@ -101,7 +101,7 @@
self.navigationItem.leftBarButtonItem = _menuButton;
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
self.editButtonItem.tintColor = [UIColor whiteColor];
else {
[self.editButtonItem setBackgroundImage:[UIImage imageNamed:@"button"]
......@@ -144,7 +144,7 @@
[self updateViewContents];
[[MLMediaLibrary sharedMediaLibrary] performSelector:@selector(libraryDidAppear) withObject:nil afterDelay:1.];
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
}
......@@ -382,7 +382,7 @@
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
return CGSizeMake(334.0, 191.0);
return CGSizeMake(298.0, 220.0);
......@@ -390,21 +390,21 @@
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
return UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0);
return UIEdgeInsetsMake(0.0, 34.0, 0.0, 34.0);
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section
{
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
return 0.0;
return 10.0;
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section
{
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
return 0.0;
return 10.0;
}
......@@ -426,7 +426,7 @@
UIBarButtonItem *editButton = self.editButtonItem;
NSString *editImage = editing? @"doneButton": @"button";
NSString *editImageHighlight = editing? @"doneButtonHighlight": @"buttonHighlight";
if (SYSTEM_RUNS_IN_THE_FUTURE)
if (SYSTEM_RUNS_IOS7_OR_LATER)
editButton.tintColor = [UIColor whiteColor];
else {
[editButton setBackgroundImage:[UIImage imageNamed:editImage] forState:UIControlStateNormal
......
......@@ -26,7 +26,7 @@
{
CGRect returnValue = [super trackRectForBounds:bounds];
returnValue.origin.x = 5.;
if (!SYSTEM_RUNS_IN_THE_FUTURE)
if (!SYSTEM_RUNS_IOS7_OR_LATER)
returnValue.origin.y = 7.;
returnValue.size.width = bounds.size.width - 10.;
return returnValue;
......@@ -50,7 +50,7 @@
{
CGRect returnValue = [super trackRectForBounds:bounds];
returnValue.origin.x = 5.;
if (!SYSTEM_RUNS_IN_THE_FUTURE)
if (!SYSTEM_RUNS_IOS7_OR_LATER)
returnValue.origin.y = 7.;
returnValue.size.width = bounds.size.width - 10.;
return returnValue;
......
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