浏览代码

VLCNetworkListCell: Adapt to theme change

Soomin Lee 5 年之前
父节点
当前提交
b443a40118
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      Sources/LocalNetworkConnectivity/VLCNetworkListCell.m

+ 13 - 0
Sources/LocalNetworkConnectivity/VLCNetworkListCell.m

@@ -15,6 +15,8 @@
 
 
 #import "VLCStatusLabel.h"
 #import "VLCStatusLabel.h"
 
 
+#import "VLC-Swift.h"
+
 @implementation VLCNetworkListCell
 @implementation VLCNetworkListCell
 
 
 + (VLCNetworkListCell *)cellWithReuseIdentifier:(NSString *)ident
 + (VLCNetworkListCell *)cellWithReuseIdentifier:(NSString *)ident
@@ -33,9 +35,20 @@
     self.subtitleLabel.text = @"";
     self.subtitleLabel.text = @"";
     self.thumbnailView.contentMode = UIViewContentModeScaleAspectFit;
     self.thumbnailView.contentMode = UIViewContentModeScaleAspectFit;
     self.downloadButton.hidden = YES;
     self.downloadButton.hidden = YES;
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(themeDidChange)
+                                                 name:kVLCThemeDidChangeNotification object:nil];
     [super awakeFromNib];
     [super awakeFromNib];
 }
 }
 
 
+- (void)themeDidChange
+{
+    self.titleLabel.textColor = PresentationTheme.current.colors.cellTextColor;
+    self.titleLabel.backgroundColor = PresentationTheme.current.colors.background;
+    self.subtitleLabel.textColor = PresentationTheme.current.colors.cellDetailTextColor;
+    self.subtitleLabel.backgroundColor = PresentationTheme.current.colors.background;
+    self.backgroundColor = PresentationTheme.current.colors.background;
+}
+
 - (void)setTitleLabelCentered:(BOOL)titleLabelCentered
 - (void)setTitleLabelCentered:(BOOL)titleLabelCentered
 {
 {
     self.titleLabel.hidden = self.subtitleLabel.hidden = titleLabelCentered;
     self.titleLabel.hidden = self.subtitleLabel.hidden = titleLabelCentered;