Commit 43700ae9 authored by Carola Nitz's avatar Carola Nitz

VLCDownloadViewController: adopt Themecolors

parent 202bf9df
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9058" systemVersion="15B30a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9048"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCDownloadViewController">
......@@ -29,30 +33,27 @@
<subviews>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Enter any HTTP address to download the file to your $DEVICE." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="95">
<rect key="frame" x="0.0" y="87" width="320" height="38"/>
<animations/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="38" id="vRA-2f-jer"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.74659199620000005" green="0.74659199620000005" blue="0.74659199620000005" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.74659199620000005" green="0.74659199620000005" blue="0.74659199620000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<textField clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="center" minimumFontSize="17" clearButtonMode="unlessEditing" translatesAutoresizingMaskIntoConstraints="NO" id="yZ7-sQ-cbO">
<rect key="frame" x="0.0" y="8" width="320" height="31"/>
<animations/>
<color key="backgroundColor" red="0.28627450980000002" green="0.28627450980000002" blue="0.28627450980000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.28627450980000002" green="0.28627450980000002" blue="0.28627450980000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="31" id="BrP-Ow-0Rv"/>
</constraints>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardAppearance="alert"/>
</textField>
<button contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="EPu-Ev-iiG">
<rect key="frame" x="0.0" y="43" width="320" height="40"/>
<animations/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="paf-BZ-9vp"/>
</constraints>
......@@ -67,34 +68,31 @@
<subviews>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Current Download.mpg" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="84">
<rect key="frame" x="11" y="11" width="150" height="17"/>
<animations/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.71999999999999997" alpha="1" colorSpace="calibratedWhite"/>
<color key="textColor" red="0.72000002861022949" green="0.72000002861022949" blue="0.72000002861022949" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<progressView contentMode="scaleToFill" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="85">
<rect key="frame" x="11" y="73" width="298" height="2"/>
<animations/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="2" id="Jeu-jw-vzk"/>
</constraints>
</progressView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="86">
<rect key="frame" x="283" y="8" width="29" height="31"/>
<animations/>
<rect key="frame" x="290" y="8" width="22" height="22"/>
<constraints>
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="31" id="VHL-kj-SOm"/>
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="29" id="zTY-if-NSJ"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="flatDeleteButton.png">
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<state key="highlighted">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="cancelDownload:" destination="-1" eventType="touchUpInside" id="90"/>
......@@ -102,39 +100,35 @@
</button>
<activityIndicatorView hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" fixedFrame="YES" hidesWhenStopped="YES" style="whiteLarge" translatesAutoresizingMaskIntoConstraints="NO" id="91">
<rect key="frame" x="0.0" y="-129" width="37" height="37"/>
<animations/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="calibratedRGB"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</activityIndicatorView>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="0 Kb/s" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="97">
<rect key="frame" x="11" y="48" width="42" height="17"/>
<animations/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" name="secondarySelectedControlColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" red="0.79277843236923218" green="0.79277843236923218" blue="0.79277843236923218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="00:00:00" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="98">
<rect key="frame" x="248.5" y="48" width="60.5" height="17"/>
<animations/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" name="secondarySelectedControlColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" red="0.79277843236923218" green="0.79277843236923218" blue="0.79277843236923218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="0%" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="99">
<rect key="frame" x="150" y="48" width="20" height="17"/>
<animations/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="0Fp-ES-zmf"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" name="secondarySelectedControlColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" red="0.79277843236923218" green="0.79277843236923218" blue="0.79277843236923218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="85" secondAttribute="bottom" constant="15" id="1Ms-oP-nb3"/>
<constraint firstItem="85" firstAttribute="top" secondItem="98" secondAttribute="bottom" constant="8" id="5m8-CM-by5"/>
......@@ -155,19 +149,17 @@
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsVerticalScrollIndicator="NO" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="69">
<rect key="frame" x="0.0" y="223" width="320" height="160"/>
<animations/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="calibratedRGB"/>
<color key="separatorColor" white="0.0" alpha="0.60999999999999999" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="sectionIndexBackgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="calibratedRGB"/>
<color key="sectionIndexTrackingBackgroundColor" red="0.30689102410000002" green="0.30688184499999999" blue="0.3068870306" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="separatorColor" red="0.0" green="0.0" blue="0.0" alpha="0.60999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
<color key="sectionIndexBackgroundColor" red="0.1052877679" green="0.1052846164" blue="0.1052864045" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="sectionIndexTrackingBackgroundColor" red="0.30689102410000002" green="0.30688184499999999" blue="0.3068870306" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<outlet property="dataSource" destination="-1" id="93"/>
<outlet property="delegate" destination="-1" id="94"/>
</connections>
</tableView>
</subviews>
<animations/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="yZ7-sQ-cbO" secondAttribute="trailing" id="6xO-qL-QAy"/>
<constraint firstItem="yZ7-sQ-cbO" firstAttribute="leading" secondItem="1" secondAttribute="leading" id="Dnj-BX-p5y"/>
......
......@@ -22,6 +22,7 @@ public final class ColorPalette : NSObject {
@objc public let cellBackgroundB:UIColor
@objc public let cellDetailTextColor:UIColor
@objc public let cellTextColor:UIColor
@objc public let lightTextColor:UIColor
@objc public let sectionHeaderTextColor:UIColor
@objc public let sectionHeaderTintColor:UIColor
@objc public let settingsBackground:UIColor
......@@ -37,6 +38,7 @@ public final class ColorPalette : NSObject {
cellBackgroundB:UIColor,
cellDetailTextColor:UIColor,
cellTextColor:UIColor,
lightTextColor:UIColor,
sectionHeaderTextColor:UIColor,
sectionHeaderTintColor:UIColor,
settingsBackground:UIColor,
......@@ -51,6 +53,7 @@ public final class ColorPalette : NSObject {
self.cellBackgroundB = cellBackgroundB
self.cellDetailTextColor = cellDetailTextColor
self.cellTextColor = cellTextColor
self.lightTextColor = lightTextColor
self.sectionHeaderTextColor = sectionHeaderTextColor
self.sectionHeaderTintColor = sectionHeaderTintColor
self.settingsBackground = settingsBackground
......@@ -121,13 +124,14 @@ public let whitePalette = ColorPalette(isDark: false,
cellBackgroundB: UIColor(0xe5e5e3),
cellDetailTextColor: .lightGray,
cellTextColor: UIColor(0x000000),
lightTextColor: UIColor(0x888888),
sectionHeaderTextColor: UIColor(0xf9f9f7),
sectionHeaderTintColor: UIColor(0xe5efe3),
settingsBackground:UIColor(0xdcdcdc),
settingsCellBackground:UIColor(0xf9f9f7),
settingsSeparatorColor:.lightGray,
tabBarColor: UIColor(0x000000),
orangeUI: UIColor(0xff8400))
orangeUI: UIColor(0xee8400))
public let darkPalette = ColorPalette(isDark: true,
name: "Dark",
......@@ -136,10 +140,11 @@ public let darkPalette = ColorPalette(isDark: true,
cellBackgroundB: UIColor(0x000000),
cellDetailTextColor: .lightGray,
cellTextColor:UIColor(0xffffff),
lightTextColor: UIColor(0xb8b8b8),
sectionHeaderTextColor: UIColor(0x828282),
sectionHeaderTintColor:UIColor(0x3c3c3c),
settingsBackground:UIColor(0x292b36),
settingsCellBackground:UIColor(0x3d3f40),
settingsSeparatorColor:.darkGray,
tabBarColor: UIColor(0xffffff),
orangeUI: UIColor(0xff8400))
orangeUI: UIColor(0xee8400))
......@@ -18,6 +18,7 @@
#import "WhiteRaccoon.h"
#import "NSString+SupportedMedia.h"
#import "VLCHTTPFileDownloader.h"
#import "VLC_iOS-Swift.h"
typedef NS_ENUM(NSUInteger, VLCDownloadScheme) {
VLCDownloadSchemeNone,
......@@ -63,6 +64,7 @@ typedef NS_ENUM(NSUInteger, VLCDownloadScheme) {
if (self){
_currentDownloads = [[NSMutableArray alloc] init];
_currentDownloadFilename = [[NSMutableArray alloc] init];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateForTheme) name:kVLCThemeDidChangeNotification object:nil];
}
return self;
}
......@@ -71,18 +73,16 @@ typedef NS_ENUM(NSUInteger, VLCDownloadScheme) {
{
[super viewDidLoad];
NSAttributedString *coloredAttributedPlaceholder = [[NSAttributedString alloc] initWithString:@"http://myserver.com/file.mkv" attributes:@{NSForegroundColorAttributeName: [UIColor VLCLightTextColor]}];
self.urlField.attributedPlaceholder = coloredAttributedPlaceholder;
[self.downloadButton setTitle:NSLocalizedString(@"BUTTON_DOWNLOAD", nil) forState:UIControlStateNormal];
self.whatToDownloadHelpLabel.text = [NSString stringWithFormat:NSLocalizedString(@"DOWNLOAD_FROM_HTTP_HELP", nil), [[UIDevice currentDevice] model]];
self.urlField.delegate = self;
self.urlField.keyboardType = UIKeyboardTypeURL;
self.progressContainer.hidden = YES;
self.downloadsTable.backgroundColor = [UIColor VLCDarkBackgroundColor];
self.downloadsTable.hidden = YES;
self.whatToDownloadHelpLabel.backgroundColor = [UIColor clearColor];
self.edgesForExtendedLayout = UIRectEdgeNone;
[self updateForTheme];
}
- (void)viewWillAppear:(BOOL)animated
......@@ -98,6 +98,24 @@ typedef NS_ENUM(NSUInteger, VLCDownloadScheme) {
[super viewWillAppear:animated];
}
- (void)updateForTheme
{
NSAttributedString *coloredAttributedPlaceholder = [[NSAttributedString alloc] initWithString:@"http://myserver.com/file.mkv" attributes:@{NSForegroundColorAttributeName: PresentationTheme.current.colors.lightTextColor}];
self.urlField.attributedPlaceholder = coloredAttributedPlaceholder;
self.urlField.backgroundColor = PresentationTheme.current.colors.cellBackgroundB;
self.urlField.textColor = PresentationTheme.current.colors.cellTextColor;
self.downloadsTable.backgroundColor = PresentationTheme.current.colors.background;
self.view.backgroundColor = PresentationTheme.current.colors.background;
self.downloadButton.backgroundColor = PresentationTheme.current.colors.orangeUI;
self.whatToDownloadHelpLabel.textColor = PresentationTheme.current.colors.lightTextColor;
self.progressContainer.backgroundColor = PresentationTheme.current.colors.cellBackgroundB;
self.currentDownloadLabel.textColor = PresentationTheme.current.colors.cellBackgroundB;
self.progressPercent.textColor = PresentationTheme.current.colors.cellBackgroundB;
self.speedRate.textColor = PresentationTheme.current.colors.cellBackgroundB;
self.timeDL.textColor = PresentationTheme.current.colors.cellTextColor;
[self.downloadsTable reloadData];
}
- (void)viewWillDisappear:(BOOL)animated
{
[self.view endEditing:YES];
......@@ -382,8 +400,8 @@ typedef NS_ENUM(NSUInteger, VLCDownloadScheme) {
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
cell.textLabel.textColor = [UIColor whiteColor];
cell.detailTextLabel.textColor = [UIColor VLCLightTextColor];
cell.textLabel.textColor = PresentationTheme.current.colors.cellTextColor;
cell.detailTextLabel.textColor = PresentationTheme.current.colors.cellDetailTextColor;
}
NSInteger row = indexPath.row;
......@@ -401,7 +419,7 @@ typedef NS_ENUM(NSUInteger, VLCDownloadScheme) {
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.backgroundColor = (indexPath.row % 2 == 0)? [UIColor blackColor]: [UIColor VLCDarkBackgroundColor];
cell.backgroundColor = (indexPath.row % 2 == 0)? PresentationTheme.current.colors.cellBackgroundA : PresentationTheme.current.colors.cellBackgroundB;
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
......
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