Commit 0cda6037 authored by Carola Nitz's avatar Carola Nitz

VLCNetworkStreamViewcontroller: adopt Theme

parent 43700ae9
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9058" systemVersion="15B38b" 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="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<development version="6300" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9048"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCOpenNetworkStreamViewController">
......@@ -26,16 +29,14 @@
<subviews>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Enter any HTTP, RTSP, RTMP, MMS, FTP or UDP/RTP address to open the stream directly." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="27">
<rect key="frame" x="0.0" y="85" width="282" height="46"/>
<animations/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" 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" 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>
<button contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="i2a-FY-QGC">
<rect key="frame" x="0.0" y="43" width="282" 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="Vsx-fz-bZs"/>
</constraints>
......@@ -50,20 +51,17 @@
<subviews>
<switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="8">
<rect key="frame" x="20" y="10" width="51" height="31"/>
<animations/>
<color key="onTintColor" red="1" green="0.51764705879999995" blue="0.0" alpha="1" colorSpace="deviceRGB"/>
<color key="onTintColor" red="0.98948383331298828" green="0.43470591306686401" blue="0.032047603279352188" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</switch>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Private Playback" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9">
<rect key="frame" x="77" y="15.5" width="126.5" height="20.5"/>
<animations/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<rect key="frame" x="77" y="15.5" width="126" height="20.5"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<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>
</subviews>
<animations/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="8" firstAttribute="top" secondItem="19" secondAttribute="top" constant="10" id="2GS-NS-3e9"/>
<constraint firstAttribute="height" constant="51" id="Cm5-Z1-hUm"/>
......@@ -79,20 +77,17 @@
<subviews>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Scan Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ewx-Hn-7Lc" userLabel="Label - Scan Subtitle">
<rect key="frame" x="77" y="15.5" width="101.5" height="20.5"/>
<animations/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<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>
<switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="vn6-u6-LYP">
<rect key="frame" x="20" y="10" width="51" height="31"/>
<animations/>
<color key="onTintColor" red="1" green="0.51764705879999995" blue="0.0" alpha="1" colorSpace="deviceRGB"/>
<color key="onTintColor" red="0.98948383331298828" green="0.43470591306686401" blue="0.032047603279352188" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</switch>
</subviews>
<animations/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="Ewx-Hn-7Lc" firstAttribute="centerY" secondItem="Cuf-mI-ZuN" secondAttribute="centerY" id="438-cI-fcY"/>
<constraint firstAttribute="height" constant="51" id="4q4-k4-3aL"/>
......@@ -103,9 +98,8 @@
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" indicatorStyle="white" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="10">
<rect key="frame" x="0.0" y="237" width="282" height="145"/>
<animations/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<color key="separatorColor" white="0.0" alpha="0.60999999999999999" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="separatorColor" red="0.0" green="0.0" blue="0.0" alpha="0.60999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<outlet property="dataSource" destination="-1" id="18"/>
<outlet property="delegate" destination="-1" id="17"/>
......@@ -113,18 +107,16 @@
</tableView>
<textField clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="center" minimumFontSize="17" clearButtonMode="unlessEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Ucc-ui-OIc">
<rect key="frame" x="0.0" y="8" width="282" 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="wUp-0d-Tui"/>
</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>
</subviews>
<animations/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="19" secondAttribute="trailing" id="5U7-LM-ATZ"/>
<constraint firstItem="Ucc-ui-OIc" firstAttribute="leading" secondItem="1" secondAttribute="leading" id="5wR-1o-dR8"/>
......
......@@ -131,7 +131,7 @@ public let whitePalette = ColorPalette(isDark: false,
settingsCellBackground:UIColor(0xf9f9f7),
settingsSeparatorColor:.lightGray,
tabBarColor: UIColor(0x000000),
orangeUI: UIColor(0xee8400))
orangeUI: UIColor(0xff8800))
public let darkPalette = ColorPalette(isDark: true,
name: "Dark",
......@@ -147,4 +147,4 @@ public let darkPalette = ColorPalette(isDark: true,
settingsCellBackground:UIColor(0x3d3f40),
settingsSeparatorColor:.darkGray,
tabBarColor: UIColor(0xffffff),
orangeUI: UIColor(0xee8400))
orangeUI: UIColor(0xff8800))
//
// MoreTabBarDataSource.swift
// VLC-iOS
//
// Created by Carola Nitz on 1/31/18.
// Copyright © 2018 VideoLAN. All rights reserved.
//
import Foundation
......@@ -18,6 +18,7 @@
#import "VLCMenuTableViewController.h"
#import "VLCStreamingHistoryCell.h"
#import "UIDevice+VLC.h"
#import "VLC_iOS-Swift.h"
@interface VLCOpenNetworkStreamViewController () <UITableViewDataSource, UITableViewDelegate, UITextFieldDelegate, UIAlertViewDelegate, VLCStreamingHistoryCellMenuItemProtocol>
{
......@@ -65,6 +66,10 @@
name:NSUbiquitousKeyValueStoreDidChangeExternallyNotification
object:[NSUbiquitousKeyValueStore defaultStore]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(updateForTheme)
name:kVLCThemeDidChangeNotification
object:nil];
/* force store update */
NSUbiquitousKeyValueStore *ubiquitousKeyValueStore = [NSUbiquitousKeyValueStore defaultStore];
[ubiquitousKeyValueStore synchronize];
......@@ -106,10 +111,7 @@
[self.whatToOpenHelpLabel setText:NSLocalizedString(@"OPEN_NETWORK_HELP", nil)];
self.urlField.delegate = self;
self.urlField.keyboardType = UIKeyboardTypeURL;
self.historyTableView.backgroundColor = [UIColor VLCDarkBackgroundColor];
NSAttributedString *coloredAttributedPlaceholder = [[NSAttributedString alloc] initWithString:@"http://myserver.com/file.mkv" attributes:@{NSForegroundColorAttributeName: [UIColor VLCLightTextColor]}];
self.urlField.attributedPlaceholder = coloredAttributedPlaceholder;
self.edgesForExtendedLayout = UIRectEdgeNone;
// This will be called every time this VC is opened by the side menu controller
......@@ -122,6 +124,22 @@
UIMenuController *sharedMenuController = [UIMenuController sharedMenuController];
[sharedMenuController setMenuItems:@[renameItem]];
[sharedMenuController update];
[self updateForTheme];
}
- (void)updateForTheme
{
self.historyTableView.backgroundColor = PresentationTheme.current.colors.background;
self.view.backgroundColor = PresentationTheme.current.colors.background;
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.privateModeLabel.textColor = PresentationTheme.current.colors.lightTextColor;
self.ScanSubModeLabel.textColor = PresentationTheme.current.colors.lightTextColor;
self.whatToOpenHelpLabel.textColor = PresentationTheme.current.colors.lightTextColor;
self.openButton.backgroundColor = PresentationTheme.current.colors.orangeUI;
[self.historyTableView reloadData];
}
- (void)updatePasteboardTextInURLField
......@@ -279,7 +297,7 @@
NSString *possibleTitle = _recentURLTitles[[@(indexPath.row) stringValue]];
cell.detailTextLabel.text = content;
cell.textLabel.text = (possibleTitle != nil) ? possibleTitle : [content lastPathComponent];
cell.textLabel.text = possibleTitle ?: [content lastPathComponent];
return cell;
}
......@@ -288,7 +306,9 @@
- (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.cellBackgroundB : PresentationTheme.current.colors.cellBackgroundA;
cell.textLabel.textColor = PresentationTheme.current.colors.cellTextColor;
cell.detailTextLabel.textColor = PresentationTheme.current.colors.cellDetailTextColor;
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
......
......@@ -22,7 +22,7 @@ class VLCTabbarCooordinator: NSObject, VLCMediaViewControllerDelegate {
self.tabBarController = tabBarController
self.services = services
super.init()
NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: VLCThemeDidChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(updateTheme), name: VLCThemeDidChangeNotification, object: nil)
}
@objc public func start() {
......@@ -30,7 +30,7 @@ class VLCTabbarCooordinator: NSObject, VLCMediaViewControllerDelegate {
setupAppearance()
}
@objc func themeDidChange() {
@objc func updateTheme() {
tabBarController.tabBar.barTintColor = PresentationTheme.current.colors.tabBarColor
}
......
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