Commit 1f034b70 authored by Carola Nitz's avatar Carola Nitz

newUI: Introduction of the new UI

Move from the sidemenu to use the tabbarcontroller, removed the MenuRevealButton
Add the MediaViewController and adjust the architecture in the VLCDisplayController
Created a subclass for the  view of the VLCDisplayController to let touches go through
Have only one instance of the Playbackcontroller that is going to be part of the tabbarcontroller
Changed the code that is currently calculating the miniviews position. This still needs fixing in case you turn the phone
Add sort button still need to implement functionality
Add Presentationtheme and darkmode. Move Appearance code into own class
Move the Wificell into the VLCServerListViewController
parent 09882ee8
......@@ -60,11 +60,6 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mediaPlayerChanged) name:VLCPlaybackControllerPlaybackMetadataDidChange object:nil];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
+ (BOOL)shouldBeVisibleForPlaybackController:(VLCPlaybackController *)vpc
{
return [vpc numberOfChaptersForCurrentTitle] > 1;
......
......@@ -39,11 +39,6 @@
object:nil];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)viewWillAppear:(BOOL)animated
{
if ([UIScreen mainScreen].traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
......
......@@ -60,11 +60,6 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mediaPlayerChanged) name:VLCPlaybackControllerPlaybackMetadataDidChange object:nil];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
......
......@@ -181,7 +181,6 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
[fileManager removeItemAtPath:tempSubsDirPath error:nil];
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (BOOL)canBecomeFirstResponder
......
......@@ -53,11 +53,6 @@
[self performSelector:@selector(updateDropbox) withObject:nil afterDelay:0.1];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (NSString *)title
{
return NSLocalizedString(@"CLOUD_SERVICES", nil);
......
<html>
<head>
</head>
<body style="background-color: #1f1f1f">
<body style="background-color: BACKGROUNDCOLOR">
<style type="text/css">
h3 {color: #aaaaaa}
h5 {text-decoration: plain; color: #aaaaaa}
A:link {text-decoration: underline; color: #aaaaaa}
A:visited {text-decoration: none; color: #aaaaaa}
A:active {text-decoration: none; color: #aaaaaa}
h3 {color: TEXTCOLOR}
h5 {text-decoration: plain; color: TEXTCOLOR}
a:link {text-decoration: underline; color: TEXTCOLOR}
a:visited {text-decoration: none; color: TEXTCOLOR}
a:active {text-decoration: none; color: TEXTCOLOR}
body { font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300; }
</style>
<div style="text-align:left; border:solid transparent 1px; padding:0.5em 1em 0.5em 1em; overflow:auto; font-size:10pt; font-family:Helvetica; color:#aaaaaa"; A:link {text-decoration: underline; color:#aaaaaa}>
<div style="text-align:left; border:solid transparent 1px; padding:0.5em 1em 0.5em 1em; overflow:auto; font-size:10pt; font-family:Helvetica; color:TEXTCOLOR"; A:link {text-decoration: underline; color:TEXTCOLOR}>
<p align="center">
<table cellspacing="0" cellpadding="0">
<tr>
......
......@@ -5,12 +5,22 @@
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>SETTINGS_GENERIC_TITLE</string>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>SETTINGS_GENERIC_TITLE</string>
</dict>
<dict>
<key>DefaultValue</key>
<string>NO</string>
<key>Key</key>
<string>darkMode</string>
<key>Title</key>
<string>SETTINGS_DARKTHEME</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<string>NO</string>
<key>Key</key>
......
......@@ -10,6 +10,16 @@
<key>Title</key>
<string>SETTINGS_GENERIC_TITLE</string>
</dict>
<dict>
<key>DefaultValue</key>
<true/>
<key>Key</key>
<string>SETTINGS_USE_DARKTHEME</string>
<key>Title</key>
<string>SETTINGS_APPTHEME</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<true/>
......
B/* A single strings file, whose title is specified in your preferences schema. The strings files provide the localized content to display to the user for each of your preferences. */
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="14092" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="ipad9_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14081.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="PlaylistCell" id="2" customClass="VLCPlaylistCollectionViewCell">
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="VLCPlaylistCollectionViewCell" id="2" customClass="VLCPlaylistCollectionViewCell">
<rect key="frame" x="0.0" y="0.0" width="341" height="190"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
......@@ -54,7 +57,7 @@
<size key="shadowOffset" width="0.0" height="0.0"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Meta Data" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lP6-D2-Oef">
<rect key="frame" x="141" y="8" width="59" height="15"/>
<rect key="frame" x="141.5" y="8" width="58.5" height="14.5"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="1" green="1" blue="1" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
......
<?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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14092" 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="13772"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14081.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="10" reuseIdentifier="PlaylistCell" rowHeight="191" id="3" customClass="VLCPlaylistTableViewCell">
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="10" reuseIdentifier="VLCPlaylistTableViewCell" rowHeight="191" id="3" customClass="VLCPlaylistTableViewCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="90"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="3" id="pEL-yt-P8r">
......@@ -47,7 +50,7 @@
<size key="shadowOffset" width="0.0" height="0.0"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Meta Data" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3xi-uj-aAV">
<rect key="frame" x="131" y="8" width="59" height="15"/>
<rect key="frame" x="131.5" y="8" width="58.5" height="14.5"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="1" green="1" blue="1" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
......
......@@ -37,4 +37,5 @@ NSLocalizedString(@"Passcodes did not match. Try again.", nil);
NSLocalizedString(@"1 Failed Passcode Attempt", nil);
NSLocalizedString(@"%d Failed Passcode Attempts", nil);
NSLocalizedString(@"Next", nil);
NSLocalizedString(@"DOWNLOAD_FROM_HTTP", nil);
}
......@@ -77,8 +77,7 @@
"OPEN_NETWORK" = "Open Network Stream";
"NETWORK_TITLE" = "Network Stream";
"OPEN_NETWORK_HELP" = "Enter any HTTP, RTSP, RTMP, MMS, FTP or UDP/RTP address to open the stream directly.";
"ABOUT_APP" = "About VLC for iOS";
"OPEN_VLC_MENU" = "Open VLC sidebar menu";
"ABOUT_APP" = "About";
"HTTP_UPLOAD_SERVER_OFF" = "Inactive Server";
"HTTP_UPLOAD_NO_CONNECTIVITY" = "No active WiFi connection";
"OPEN_STREAM_OR_DOWNLOAD" = "Would you like to download or play this URL?";
......@@ -340,3 +339,6 @@
/* New strings */
"PROTOCOL_NOT_SELECTED" = "Protocol not selected";
"Settings" = "Settings";
/* New strings */
"FILE_NOT_SUPPORTED_LONG" = "FILE_NOT_SUPPORTED_LONG";
......@@ -37,11 +37,6 @@
return self;
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)viewDidLoad {
[super viewDidLoad];
......
......@@ -25,11 +25,6 @@
@implementation VLCDropboxCollectionViewController
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)viewDidLoad {
[super viewDidLoad];
......
/*****************************************************************************
* AppCoordinator.swift
* VLC for iOS
*****************************************************************************
* Copyright (c) 2018 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # gmail.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
import Foundation
@objc(VLCService)
public class Services:NSObject {
@objc let mediaDataSource = VLCMediaDataSource()
}
@objc class AppCoordinator : NSObject {
var childCoordinators: [NSObject] = []
private var tabBarController:UITabBarController
private var services = Services()
@objc public init(tabBarController: UITabBarController) {
self.tabBarController = tabBarController
super.init()
}
@objc public func start() {
let tabbarCoordinator = VLCTabbarCooordinator(tabBarController: self.tabBarController, services:services)
tabbarCoordinator.start()
childCoordinators.append(tabbarCoordinator)
}
}
/*****************************************************************************
* SortOption.swift
* VLC for iOS
*****************************************************************************
* Copyright (c) 2018 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # gmail.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
public enum SortOption:String {
case alphabetically = "Name"
case insertonDate = "Date"
case size = "Size"
var localizedDescription: String {
return NSLocalizedString(self.rawValue, comment: "")
}
}
/*****************************************************************************
* MediaDataSource.swift
* VLC for iOS
*****************************************************************************
* Copyright (c) 2018 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # gmail.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
public class MediaDataSourceAndDelegate:NSObject, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
private let cellPadding:CGFloat = 5.0
private var services: Services
public weak var delegate: UICollectionViewDelegate?
public convenience init(services:Services) {
self.init()
self.services = services
}
public override init() {
self.services = Services()
super.init()
}
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return Int(services.mediaDataSource.numberOfFiles())
}
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
if let playlistCell = collectionView.dequeueReusableCell(withReuseIdentifier: VLCPlaylistCollectionViewCell.cellIdentifier(), for: indexPath) as? VLCPlaylistCollectionViewCell {
playlistCell.mediaObject = services.mediaDataSource.object(at: UInt(indexPath.row))
return playlistCell
}
return UICollectionViewCell()
}
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
delegate?.collectionView!(collectionView, didSelectItemAt: indexPath)
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let numberOfCells:CGFloat = collectionView.traitCollection.horizontalSizeClass == .regular ? 3.0 : 2.0
let aspectRatio:CGFloat = 10.0 / 16.0
// We have the number of cells and we always have numberofCells + 1 padding spaces. -pad-[Cell]-pad-[Cell]-pad-
// we then have the entire padding, we divide the entire padding by the number of Cells to know how much needs to be substracted from ech cell
// since this might be an uneven number we ceil
var cellWidth = collectionView.bounds.size.width / numberOfCells
cellWidth = cellWidth - ceil(((numberOfCells + 1) * cellPadding) / numberOfCells)
return CGSize(width:cellWidth, height:cellWidth * aspectRatio)
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsetsMake(cellPadding, cellPadding, cellPadding, cellPadding);
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return cellPadding
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return cellPadding
}
}
/*****************************************************************************
* PresentationTheme.swift
* VLC for iOS
*****************************************************************************
* Copyright (c) 2018 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <caro # videolan.org>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
import Foundation
extension Notification.Name {
static let VLCThemeDidChangeNotification = Notification.Name("themeDidChangeNotfication")
}
@objcMembers public class ColorPalette : NSObject {
public let isDark: Bool
public let name: String
public let background:UIColor
public let cellBackgroundA:UIColor
public let cellBackgroundB:UIColor
public let cellDetailTextColor:UIColor
public let cellTextColor:UIColor
public let lightTextColor:UIColor
public let sectionHeaderTextColor:UIColor
public let sectionHeaderTintColor:UIColor
public let settingsBackground:UIColor
public let settingsCellBackground:UIColor
public let settingsSeparatorColor:UIColor
public let tabBarColor:UIColor
public let orangeUI:UIColor
public init(isDark: Bool,
name: String,
background:UIColor,
cellBackgroundA:UIColor,
cellBackgroundB:UIColor,
cellDetailTextColor:UIColor,
cellTextColor:UIColor,
lightTextColor:UIColor,
sectionHeaderTextColor:UIColor,
sectionHeaderTintColor:UIColor,
settingsBackground:UIColor,
settingsCellBackground:UIColor,
settingsSeparatorColor:UIColor,
tabBarColor:UIColor,
orangeUI:UIColor) {
self.isDark = isDark
self.name = name
self.background = background
self.cellBackgroundA = cellBackgroundA
self.cellBackgroundB = cellBackgroundB
self.cellDetailTextColor = cellDetailTextColor
self.cellTextColor = cellTextColor
self.lightTextColor = lightTextColor
self.sectionHeaderTextColor = sectionHeaderTextColor
self.sectionHeaderTintColor = sectionHeaderTintColor
self.settingsBackground = settingsBackground
self.settingsCellBackground = settingsCellBackground
self.settingsSeparatorColor = settingsSeparatorColor
self.tabBarColor = tabBarColor
self.orangeUI = orangeUI
}
}
@objcMembers public class PresentationTheme : NSObject {
public static let brightTheme = PresentationTheme(colors: brightPalette)
public static let darkTheme = PresentationTheme(colors: darkPalette)
static var current: PresentationTheme = {
let isDarkTheme = UserDefaults.standard.bool(forKey: kVLCSettingAppTheme)
return isDarkTheme ? PresentationTheme.darkTheme : PresentationTheme.brightTheme
}()
{
didSet {
NotificationCenter.default.post(name: .VLCThemeDidChangeNotification, object: self)
AppearanceManager.setupAppearance(theme: self.current)
}
}
public init(colors: ColorPalette) {
self.colors = colors
}
public let colors: ColorPalette
}
@objc public extension UIColor {
public convenience init(_ rgbValue:UInt32, _ alpha:CGFloat = 1.0) {
let r = CGFloat((rgbValue & 0xFF0000) >> 16)/255.0
let g = CGFloat((rgbValue & 0xFF00) >> 8)/255.0
let b = CGFloat(rgbValue & 0xFF)/255.0
self.init(red: r, green: g, blue: b, alpha: 1.0)
}
private func toHex(alpha: Bool = false) -> String? {
guard let components = cgColor.components, components.count >= 3 else {
assertionFailure()
return nil
}
let r = Float(components[0])
let g = Float(components[1])
let b = Float(components[2])
var a = Float(1.0)
if components.count == 4 {
a = Float(components[3])
}
if alpha {
return String(format: "#%02lX%02lX%02lX%02lX", lroundf(r * 255), lroundf(g * 255), lroundf(b * 255), lroundf(a * 255))
} else {
return String(format: "#%02lX%02lX%02lX", lroundf(r * 255), lroundf(g * 255), lroundf(b * 255))
}
}
var toHex: String? {
return toHex()
}
}
let brightPalette = ColorPalette(isDark: false,
name: "Default",
background: UIColor(0xf9f9f7),
cellBackgroundA: UIColor(0xf9f9f7),
cellBackgroundB: UIColor(0xe5e5e3),
cellDetailTextColor: UIColor(0xd3d3d3),
cellTextColor: UIColor(0x000000),
lightTextColor: UIColor(0x888888),
sectionHeaderTextColor: UIColor(0xf9f9f7),
sectionHeaderTintColor: UIColor(0xe5efe3),
settingsBackground: UIColor(0xdcdcdc),
settingsCellBackground: UIColor(0xf9f9f7),
settingsSeparatorColor: UIColor(0xd3d3d3),
tabBarColor: UIColor(0xffffff),
orangeUI: UIColor(0xff8800))
let darkPalette = ColorPalette(isDark: true,
name: "Dark",
background: UIColor(0x292b36),
cellBackgroundA: UIColor(0x292b36),
cellBackgroundB: UIColor(0x000000),
cellDetailTextColor: UIColor(0xd3d3d3),
cellTextColor: UIColor(0xffffff),
lightTextColor: UIColor(0xb8b8b8),
sectionHeaderTextColor: UIColor(0x828282),
sectionHeaderTintColor: UIColor(0x3c3c3c),
settingsBackground: UIColor(0x292b36),
settingsCellBackground: UIColor(0x3d3f40),
settingsSeparatorColor: UIColor(0xa9a9a9),
tabBarColor: UIColor(0xffffff),
orangeUI: UIColor(0xff8800))
......@@ -24,9 +24,6 @@
serviceType:@"_http._tcp."
domain:@""];
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (VLCSharedLibraryParser *)httpParser {
if (!_httpParser) {
......
......@@ -69,8 +69,6 @@
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[_reachability stopNotifier];
[self stopDiscovery];
}
......
......@@ -15,11 +15,6 @@
@implementation VLCPlayerControlWebSocket
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)didOpen
{
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
......
/*****************************************************************************
* AppearanceManager.swift
* VLC for iOS
*****************************************************************************
* Copyright (c) 2018 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # gmail.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
import UIKit
@objc(VLCApperanceManager)
class AppearanceManager:NSObject
{
@objc class func setupAppearance(theme:PresentationTheme = PresentationTheme.current)
{
// Change the keyboard for UISearchBar
UITextField.appearance().keyboardAppearance = theme == PresentationTheme.darkTheme ? .dark : .light
// For the cursor
UITextField.appearance().tintColor = theme.colors.orangeUI
// Don't override the 'Cancel' button color in the search bar with the previous UITextField call. Use the default blue color
let attributes = [NSAttributedStringKey.foregroundColor: UIColor.white]
UIBarButtonItem.appearance(whenContainedInInstancesOf: [UISearchBar.self]).setTitleTextAttributes(attributes, for: .normal)
UINavigationBar.appearance().barTintColor = theme.colors.orangeUI
UINavigationBar.appearance(whenContainedInInstancesOf: [VLCPlaybackNavigationController.self]).barTintColor = nil
UINavigationBar.appearance().tintColor = .white
UINavigationBar.appearance().titleTextAttributes = attributes
if #available(iOS 11.0, *) {
UINavigationBar.appearance().prefersLargeTitles = true
UINavigationBar.appearance(whenContainedInInstancesOf:[VLCPlaybackNavigationController.self]).prefersLargeTitles = false
UINavigationBar.appearance().largeTitleTextAttributes = [NSAttributedStringKey.foregroundColor : UIColor.white]
}
// For the edit selection indicators
UITableView.appearance().tintColor = theme.colors.orangeUI
UISegmentedControl.appearance().tintColor = theme.colors.orangeUI
UISwitch.appearance().onTintColor = theme.colors.orangeUI
UISearchBar.appearance().barTintColor = .white
UITabBar.appearance().tintColor = theme.colors.orangeUI
//customization of MoreViewController
//Since there is no clean way to customize the Morecontroller appearance we're getting the class
if let moreListControllerClass = NSClassFromString("UIMoreListController") as? UIAppearanceContainer.Type {
UITableViewCell.appearance(whenContainedInInstancesOf: [moreListControllerClass.self]).backgroundColor = theme.colors.cellBackgroundA
UITableViewCell.appearance(whenContainedInInstancesOf: [moreListControllerClass.self]).textLabel?.textColor = theme.colors.cellTextColor
UITableView.appearance(whenContainedInInstancesOf: [moreListControllerClass.self]).backgroundColor = theme.colors.background
UITableView.appearance(whenContainedInInstancesOf: [moreListControllerClass.self]).separatorColor = .lightGray
UILabel.appearance(whenContainedInInstancesOf: [moreListControllerClass.self]).textColor = theme.colors.cellTextColor
}
}
}
/*****************************************************************************
* RemoteNetworkDataSource.swift
* VLC for iOS
*****************************************************************************
* Copyright (c) 2018 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
import Foundation
@objc(VLCRemoteNetworkDataSource)
public class RemoteNetworkDataSource:NSObject, UITableViewDataSource {
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if let wifiCell = tableView.dequeueReusableCell(withIdentifier: VLCWiFiUploadTableViewCell.cellIdentifier()) {
return wifiCell
}
return UITableViewCell()
}
}
......@@ -92,8 +92,7 @@ NSString *VLCNetworkListCellIdentifier = @"VLCNetworkListCellIdentifier";
}
self.definesPresentationContext = YES;
self.navigationItem.rightBarButtonItems = @[[UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(menuButtonAction:)],
[UIBarButtonItem themedPlayAllButtonWithTarget:self andSelector:@selector(playAllAction:)]];
self.navigationItem.rightBarButtonItems = @[[UIBarButtonItem themedPlayAllButtonWithTarget:self andSelector:@selector(playAllAction:)]];
_searchData = [[NSMutableArray alloc] init];