Browse Source

Fix colour used on menus when dark appearance is active (Fix #109)

This addresses an issue that affects VLCPlaybackInfoTVCollectionViewCell
when tvOS is using the Dark appearance by properly defining colours that
shows the different UI states of the aforementioned item.

Signed-off-by: Carola Nitz <nitz.carola@googlemail.com>
Victor Gama 7 years ago
parent
commit
47819ba8e3

+ 5 - 5
Apple-TV/Playback/Playback Info/VLCPlaybackInfoTVCollectionViewCell.m

@@ -11,7 +11,9 @@
 
 #import "VLCPlaybackInfoTVCollectionViewCell.h"
 
-@implementation VLCPlaybackInfoTVCollectionViewCell
+@implementation VLCPlaybackInfoTVCollectionViewCell {
+    UIColor *textColor;
+}
 
 + (NSString *)identifier
 {
@@ -39,10 +41,8 @@
     [super prepareForReuse];
     self.selectionMarkerVisible = NO;
     self.titleLabel.text = nil;
-
-    UIColor *textColor;
     if ([UIScreen mainScreen].traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
-        textColor = [UIColor VLCLightTextColor];
+        textColor = [UIColor VLCDarkFadedTextColor];
     } else {
         textColor = [UIColor VLCDarkTextColor];
     }
@@ -54,7 +54,7 @@
 {
     [super didUpdateFocusInContext:context withAnimationCoordinator:coordinator];
     [coordinator addCoordinatedAnimations:^{
-        self.titleLabel.textColor = self.focused ? [UIColor whiteColor] : [UIColor darkGrayColor];
+        self.titleLabel.textColor = self.focused ? [UIColor whiteColor] : textColor;
     } completion:nil];
 }
 

+ 1 - 0
Sources/UIColor+Presets.h

@@ -17,6 +17,7 @@
 + (UIColor *)VLCDarkBackgroundColor;
 + (UIColor *)VLCTransparentDarkBackgroundColor;
 + (UIColor *)VLCLightTextColor;
++ (UIColor *)VLCDarkFadedTextColor;
 + (UIColor *)VLCDarkTextColor;
 + (UIColor *)VLCDarkTextShadowColor;
 + (UIColor *)VLCOrangeTintColor;

+ 4 - 0
Sources/UIColor+Presets.m

@@ -29,6 +29,10 @@
     return [UIColor colorWithWhite:.72 alpha:1.];
 }
 
++ (UIColor *)VLCDarkFadedTextColor {
+    return [UIColor colorWithRed:0.33 green:0.33 blue:0.33 alpha:1.0];
+}
+
 + (UIColor *)VLCDarkTextColor
 {
     return [UIColor colorWithWhite:.28 alpha:1.];