소스 검색

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 "VLC-Swift.h"
+
 @implementation VLCNetworkListCell
 
 + (VLCNetworkListCell *)cellWithReuseIdentifier:(NSString *)ident
@@ -33,9 +35,20 @@
     self.subtitleLabel.text = @"";
     self.thumbnailView.contentMode = UIViewContentModeScaleAspectFit;
     self.downloadButton.hidden = YES;
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(themeDidChange)
+                                                 name:kVLCThemeDidChangeNotification object:nil];
     [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
 {
     self.titleLabel.hidden = self.subtitleLabel.hidden = titleLabelCentered;