Commit 8cdc43db authored by Carola Nitz's avatar Carola Nitz

TrackSelctorTableViewCell: setShowsCurrentTrack should only be called for when...

TrackSelctorTableViewCell: setShowsCurrentTrack should only be called for when we have the current track
parent 87191105
......@@ -332,9 +332,7 @@
unsigned int profile = (unsigned int)[[[NSUserDefaults standardUserDefaults] objectForKey:kVLCSettingEqualizerProfile] integerValue];
if (profile == row)
[cell setShowsCurrentTrack:YES];
else
[cell setShowsCurrentTrack:NO];
[cell setShowsCurrentTrack];
return cell;
}
......
......@@ -14,6 +14,6 @@
@interface VLCTrackSelectorTableViewCell : UITableViewCell
- (void)setShowsCurrentTrack:(BOOL)value;
- (void)setShowsCurrentTrack;
@end
......@@ -14,15 +14,17 @@
@implementation VLCTrackSelectorTableViewCell
- (void)setShowsCurrentTrack:(BOOL)value
- (void)setShowsCurrentTrack
{
if (value) {
self.backgroundColor = [UIColor VLCLightTextColor];
self.textLabel.textColor = [UIColor VLCDarkBackgroundColor];
} else {
self.backgroundColor = [UIColor clearColor];
self.textLabel.textColor = [UIColor VLCLightTextColor];
}
self.backgroundColor = [UIColor VLCLightTextColor];
self.textLabel.textColor = [UIColor VLCDarkBackgroundColor];
}
- (void)prepareForReuse
{
[super prepareForReuse];
self.backgroundColor = [UIColor clearColor];
self.textLabel.textColor = [UIColor VLCLightTextColor];
}
@end
......@@ -148,7 +148,6 @@
NSInteger row = indexPath.row;
NSInteger section = indexPath.section;
VLCMediaPlayer *mediaPlayer = [VLCPlaybackController sharedInstance].mediaPlayer;
BOOL cellShowsCurrentTrack = NO;
if (_switchingTracksNotChapters) {
NSArray *indexArray;
......@@ -157,7 +156,7 @@
indexArray = mediaPlayer.audioTrackIndexes;
if ([indexArray indexOfObject:[NSNumber numberWithInt:mediaPlayer.currentAudioTrackIndex]] == row)
cellShowsCurrentTrack = YES;
[cell setShowsCurrentTrack];
NSArray *audioTrackNames = mediaPlayer.audioTrackNames;
if (row < audioTrackNames.count) {
......@@ -167,7 +166,7 @@
indexArray = mediaPlayer.videoSubTitlesIndexes;
if ([indexArray indexOfObject:[NSNumber numberWithInt:mediaPlayer.currentVideoSubTitleIndex]] == row)
cellShowsCurrentTrack = YES;
[cell setShowsCurrentTrack];
NSArray *videoSubtitlesNames = mediaPlayer.videoSubTitlesNames;
if (row < videoSubtitlesNames.count) {
......@@ -191,7 +190,7 @@
}
if (row == mediaPlayer.currentTitleIndex)
cellShowsCurrentTrack = YES;
[cell setShowsCurrentTrack];
} else {
NSArray *chapterDescriptions = [mediaPlayer chapterDescriptionsOfTitle:mediaPlayer.currentTitleIndex];
if (row < chapterDescriptions.count) {
......@@ -200,10 +199,9 @@
}
if (row == mediaPlayer.currentChapterIndex)
cellShowsCurrentTrack = YES;
[cell setShowsCurrentTrack];
}
}
[cell setShowsCurrentTrack:cellShowsCurrentTrack];
return cell;
}
......
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