Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc-ios
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carola
vlc-ios
Commits
39778c05
Commit
39778c05
authored
Jan 29, 2018
by
Carola Nitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SettingsViewController: Add toggle for DarkMode and first colorchanges to ViewControllers
parent
92e82ad0
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
239 additions
and
47 deletions
+239
-47
Resources/Settings.bundle/Root.inApp.plist
Resources/Settings.bundle/Root.inApp.plist
+16
-6
Resources/Settings.bundle/Root.plist
Resources/Settings.bundle/Root.plist
+10
-0
SharedSources/Coordinators/AppCoordinator.swift
SharedSources/Coordinators/AppCoordinator.swift
+9
-4
SharedSources/PresentationTheme.swift
SharedSources/PresentationTheme.swift
+121
-0
Sources/LocalNetworkConnectivity/VLCServerListViewController.m
...es/LocalNetworkConnectivity/VLCServerListViewController.m
+17
-12
Sources/MediaViewController.swift
Sources/MediaViewController.swift
+18
-13
Sources/VLCAppDelegate.m
Sources/VLCAppDelegate.m
+0
-1
Sources/VLCConstants.h
Sources/VLCConstants.h
+2
-0
Sources/VLCSettingsController.m
Sources/VLCSettingsController.m
+22
-0
Sources/VLCTabBarCoordinator.swift
Sources/VLCTabBarCoordinator.swift
+20
-11
VLC.xcodeproj/project.pbxproj
VLC.xcodeproj/project.pbxproj
+4
-0
No files found.
Resources/Settings.bundle/Root.inApp.plist
View file @
39778c05
...
...
@@ -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>
...
...
Resources/Settings.bundle/Root.plist
View file @
39778c05
...
...
@@ -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/>
...
...
SharedSources/Coordinators/AppCoordinator.swift
View file @
39778c05
...
...
@@ -8,10 +8,16 @@
import
Foundation
@objc
class
AppCoordinator
:
NSObject
,
VLCTabbarCooordinatorDelegate
{
var
childCoordinators
:
[
NSObject
]
=
[]
@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
...
...
@@ -19,8 +25,7 @@ import Foundation
}
@objc
public
func
start
()
{
let
tabbarCoordinator
=
VLCTabbarCooordinator
(
tabBarController
:
self
.
tabBarController
)
tabbarCoordinator
.
delegate
=
self
let
tabbarCoordinator
=
VLCTabbarCooordinator
(
tabBarController
:
self
.
tabBarController
,
services
:
services
)
tabbarCoordinator
.
start
()
childCoordinators
.
append
(
tabbarCoordinator
)
}
...
...
SharedSources/PresentationTheme.swift
0 → 100644
View file @
39778c05
/*****************************************************************************
* 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
let
VLCThemeDidChangeNotification
=
Notification
.
Name
(
"themeDidChangeNotfication"
)
public
final
class
ColorPalette
:
NSObject
{
@objc
public
let
isDark
:
Bool
@objc
public
let
name
:
String
@objc
public
let
background
:
UIColor
@objc
public
let
cellBackgroundA
:
UIColor
@objc
public
let
cellBackgroundB
:
UIColor
@objc
public
let
cellDetailTextColor
:
UIColor
@objc
public
let
cellTextColor
:
UIColor
@objc
public
let
sectionHeaderTextColor
:
UIColor
@objc
public
let
sectionHeaderTintColor
:
UIColor
@objc
public
let
settingsBackground
:
UIColor
@objc
public
let
settingsCellBackground
:
UIColor
@objc
public
let
settingsSeparatorColor
:
UIColor
@objc
public
let
tabBarColor
:
UIColor
@objc
public
let
orangeUI
:
UIColor
public
init
(
isDark
:
Bool
,
name
:
String
,
background
:
UIColor
,
cellBackgroundA
:
UIColor
,
cellBackgroundB
:
UIColor
,
cellDetailTextColor
:
UIColor
,
cellTextColor
:
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
.
sectionHeaderTextColor
=
sectionHeaderTextColor
self
.
sectionHeaderTintColor
=
sectionHeaderTintColor
self
.
settingsBackground
=
settingsBackground
self
.
settingsCellBackground
=
settingsCellBackground
self
.
settingsSeparatorColor
=
settingsSeparatorColor
self
.
tabBarColor
=
tabBarColor
self
.
orangeUI
=
orangeUI
}
}
public
class
PresentationTheme
:
NSObject
{
@objc
public
let
colors
:
ColorPalette
@objc
public
static
let
whiteTheme
=
PresentationTheme
(
colors
:
whitePalette
)
@objc
public
static
let
darkTheme
=
PresentationTheme
(
colors
:
darkPalette
)
public
init
(
colors
:
ColorPalette
)
{
self
.
colors
=
colors
}
@objc
static
var
current
:
PresentationTheme
=
{
let
darkTheme
=
UserDefaults
.
standard
.
bool
(
forKey
:
kVLCSettingAppTheme
)
return
darkTheme
?
PresentationTheme
.
darkTheme
:
PresentationTheme
.
whiteTheme
}()
{
didSet
{
NotificationCenter
.
default
.
post
(
name
:
VLCThemeDidChangeNotification
,
object
:
self
)
}
}
}
public
extension
UIColor
{
public
convenience
init
(
_
rgbValue
:
UInt32
,
_
alpha
:
CGFloat
=
1.0
)
{
let
red
=
((
CGFloat
)((
rgbValue
&
0xFF0000
)
>>
16
))
/
255.0
let
green
=
((
CGFloat
)((
rgbValue
&
0xFF00
)
>>
8
))
/
255.0
let
blue
=
((
CGFloat
)(
rgbValue
&
0xFF
))
/
255.0
self
.
init
(
red
:
red
,
green
:
green
,
blue
:
blue
,
alpha
:
1.0
)
}
}
public
let
whitePalette
=
ColorPalette
(
isDark
:
false
,
name
:
"Default"
,
background
:
UIColor
(
0xf9f9f7
),
cellBackgroundA
:
UIColor
(
0xf9f9f7
),
cellBackgroundB
:
UIColor
(
0xe5e5e3
),
cellDetailTextColor
:
.
lightGray
,
cellTextColor
:
UIColor
(
0x000000
),
sectionHeaderTextColor
:
UIColor
(
0xf9f9f7
),
sectionHeaderTintColor
:
UIColor
(
0xe5efe3
),
settingsBackground
:
UIColor
(
0xdcdcdc
),
settingsCellBackground
:
UIColor
(
0xf9f9f7
),
settingsSeparatorColor
:
.
lightGray
,
tabBarColor
:
UIColor
(
0x000000
),
orangeUI
:
UIColor
(
0xff8400
))
public
let
darkPalette
=
ColorPalette
(
isDark
:
true
,
name
:
"Dark"
,
background
:
UIColor
(
0x292b36
),
cellBackgroundA
:
UIColor
(
0x292b36
),
cellBackgroundB
:
UIColor
(
0x000000
),
cellDetailTextColor
:
.
lightGray
,
cellTextColor
:
UIColor
(
0xffffff
),
sectionHeaderTextColor
:
UIColor
(
0x828282
),
sectionHeaderTintColor
:
UIColor
(
0x3c3c3c
),
settingsBackground
:
UIColor
(
0x292b36
),
settingsCellBackground
:
UIColor
(
0x3d3f40
),
settingsSeparatorColor
:
.
darkGray
,
tabBarColor
:
UIColor
(
0xffffff
),
orangeUI
:
UIColor
(
0xff8400
))
Sources/LocalNetworkConnectivity/VLCServerListViewController.m
View file @
39778c05
...
...
@@ -36,6 +36,7 @@
#import "VLCLocalNetworkServiceBrowserSAP.h"
#import "VLCLocalNetworkServiceBrowserDSM.h"
#import "VLCLocalNetworkServiceBrowserBonjour.h"
#import "VLC_iOS-Swift.h"
@interface
VLCServerListViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
VLCLocalServerDiscoveryControllerDelegate
,
VLCNetworkLoginViewControllerDelegate
>
{
...
...
@@ -49,15 +50,11 @@
@implementation
VLCServerListViewController
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
void
)
loadView
{
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
themeDidChange
)
name
:
kVLCThemeDidChangeNotification
object
:
nil
];
_tableView
=
[[
UITableView
alloc
]
initWithFrame
:[
UIScreen
mainScreen
].
bounds
style
:
UITableViewStylePlain
];
_tableView
.
backgroundColor
=
[
UIColor
VLCDarkBackgroundColor
]
;
_tableView
.
backgroundColor
=
PresentationTheme
.
current
.
colors
.
background
;
_tableView
.
delegate
=
self
;
_tableView
.
dataSource
=
self
;
_tableView
.
indicatorStyle
=
UIScrollViewIndicatorStyleWhite
;
...
...
@@ -91,11 +88,11 @@
_discoveryController
.
delegate
=
self
;
self
.
tableView
.
rowHeight
=
[
VLCNetworkListCell
heightOfCell
];
self
.
tableView
.
separatorColor
=
[
UIColor
VLCDarkBackgroundColor
]
;
self
.
view
.
backgroundColor
=
[
UIColor
VLCDarkBackgroundColor
]
;
self
.
tableView
.
separatorColor
=
PresentationTheme
.
current
.
colors
.
background
;
self
.
view
.
backgroundColor
=
PresentationTheme
.
current
.
colors
.
background
;
_refreshControl
=
[[
UIRefreshControl
alloc
]
init
];
_refreshControl
.
backgroundColor
=
[
UIColor
VLCDarkBackgroundColor
]
;
_refreshControl
.
backgroundColor
=
PresentationTheme
.
current
.
colors
.
background
;
_refreshControl
.
tintColor
=
[
UIColor
whiteColor
];
[
_refreshControl
addTarget
:
self
action
:
@selector
(
handleRefresh
)
forControlEvents
:
UIControlEventValueChanged
];
[
self
.
tableView
addSubview
:
_refreshControl
];
...
...
@@ -137,18 +134,19 @@
-
(
void
)
tableView
:(
UITableView
*
)
tableView
willDisplayCell
:(
VLCNetworkListCell
*
)
cell
forRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
UIColor
*
color
=
(
indexPath
.
row
%
2
==
0
)?
[
UIColor
blackColor
]:
[
UIColor
VLCDarkBackgroundColor
]
;
UIColor
*
color
=
(
indexPath
.
row
%
2
==
0
)?
PresentationTheme
.
current
.
colors
.
cellBackgroundB
:
PresentationTheme
.
current
.
colors
.
cellBackgroundA
;
cell
.
backgroundColor
=
cell
.
titleLabel
.
backgroundColor
=
cell
.
folderTitleLabel
.
backgroundColor
=
cell
.
subtitleLabel
.
backgroundColor
=
color
;
cell
.
titleLabel
.
textColor
=
cell
.
folderTitleLabel
.
textColor
=
cell
.
subtitleLabel
.
textColor
=
cell
.
thumbnailView
.
tintColor
=
PresentationTheme
.
current
.
colors
.
cellTextColor
;
}
-
(
void
)
tableView
:(
UITableView
*
)
tableView
willDisplayHeaderView
:(
UIView
*
)
view
forSection
:(
NSInteger
)
section
{
// Text Color
UITableViewHeaderFooterView
*
header
=
(
UITableViewHeaderFooterView
*
)
view
;
[
header
.
textLabel
setTextColor
:[
UIColor
colorWithRed
:(
130
.
0
f
/
255
.
0
f
)
green
:(
130
.
0
f
/
255
.
0
f
)
blue
:(
130
.
0
f
/
255
.
0
f
)
alpha
:
1
.
0
f
]]
;
header
.
textLabel
.
textColor
=
PresentationTheme
.
current
.
colors
.
sectionHeaderTextColor
;
header
.
textLabel
.
font
=
[
UIFont
boldSystemFontOfSize
:([
UIFont
systemFontSize
]
*
0
.
8
f
)];
header
.
tintColor
=
[
UIColor
colorWithRed
:(
60
.
0
f
/
255
.
0
f
)
green
:(
60
.
0
f
/
255
.
0
f
)
blue
:
(
60
.
0
f
/
255
.
0
f
)
alpha
:
1
.
0
f
]
;
header
.
tintColor
=
PresentationTheme
.
current
.
colors
.
sectionHeaderTintColor
;
}
-
(
UITableViewCell
*
)
tableView
:(
UITableView
*
)
tableView
cellForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
...
...
@@ -217,6 +215,13 @@
[
self
.
navigationController
pushViewController
:
loginViewController
animated
:
YES
];
}
}
#pragma mark -
-
(
void
)
themeDidChange
{
_tableView
.
backgroundColor
=
PresentationTheme
.
current
.
colors
.
background
;
_tableView
.
separatorColor
=
PresentationTheme
.
current
.
colors
.
background
;
_refreshControl
.
backgroundColor
=
PresentationTheme
.
current
.
colors
.
background
;
}
-
(
void
)
_dismissLogin
{
...
...
Sources/MediaViewController.swift
View file @
39778c05
...
...
@@ -15,7 +15,7 @@ import Foundation
public
class
VLCMediaViewController
:
UICollectionViewController
,
UICollectionViewDelegateFlowLayout
,
UISearchResultsUpdating
,
UISearchControllerDelegate
{
private
var
mediaDataSource
:
VLCMediaDataSource
private
var
services
:
Services
private
let
cellPadding
:
CGFloat
=
5.0
private
var
searchController
:
UISearchController
?
private
let
searchDataSource
=
VLCLibrarySearchDisplayDataSource
()
...
...
@@ -24,17 +24,18 @@ public class VLCMediaViewController: UICollectionViewController, UICollectionVie
@available
(
iOS
11.0
,
*
)
lazy
var
dragAndDropManager
:
VLCDragAndDropManager
=
{
let
dragAndDropManager
=
VLCDragAndDropManager
()
dragAndDropManager
.
delegate
=
mediaDataSource
dragAndDropManager
.
delegate
=
services
.
mediaDataSource
return
dragAndDropManager
}()
public
convenience
init
(
mediaDataSource
:
VLCMediaDataSource
)
{
public
convenience
init
(
services
:
Services
)
{
self
.
init
(
collectionViewLayout
:
UICollectionViewFlowLayout
())
self
.
mediaDataSource
=
mediaDataSource
self
.
services
=
services
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
themeDidChange
)
,
name
:
VLCThemeDidChangeNotification
,
object
:
nil
)
}
public
override
init
(
collectionViewLayout
layout
:
UICollectionViewLayout
)
{
self
.
mediaDataSource
=
VLCMediaDataSource
()
self
.
services
=
Services
()
super
.
init
(
collectionViewLayout
:
layout
)
}
...
...
@@ -49,18 +50,22 @@ public class VLCMediaViewController: UICollectionViewController, UICollectionVie
setupSearchController
()
setupNavigationBar
()
_
=
(
MLMediaLibrary
.
sharedMediaLibrary
()
as
AnyObject
)
.
perform
(
#selector(
MLMediaLibrary.libraryDidAppear
)
)
mediaDataSource
.
updateContents
(
forSelection
:
nil
)
services
.
mediaDataSource
.
updateContents
(
forSelection
:
nil
)
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
2.0
)
{
self
.
mediaDataSource
.
addAllFolders
()
self
.
mediaDataSource
.
addRemainingFiles
()
self
.
services
.
mediaDataSource
.
addAllFolders
()
self
.
services
.
mediaDataSource
.
addRemainingFiles
()
self
.
collectionView
?
.
reloadData
()
}
}
@objc
func
themeDidChange
()
{
collectionView
?
.
backgroundColor
=
PresentationTheme
.
current
.
colors
.
background
}
func
setupCollectionView
(){
let
playlistnib
=
UINib
(
nibName
:
"VLCPlaylistCollectionViewCell"
,
bundle
:
nil
)
collectionView
?
.
register
(
playlistnib
,
forCellWithReuseIdentifier
:
VLCPlaylistCollectionViewCell
.
cellIdentifier
())
collectionView
?
.
backgroundColor
=
.
white
collectionView
?
.
backgroundColor
=
PresentationTheme
.
current
.
colors
.
background
collectionView
?
.
alwaysBounceVertical
=
true
if
#available(iOS 11.0, *)
{
collectionView
?
.
dragDelegate
=
dragAndDropManager
...
...
@@ -97,16 +102,16 @@ public class VLCMediaViewController: UICollectionViewController, UICollectionVie
}
//MARK: - CollectionViewDelegate & DataSource
override
public
func
collectionView
(
_
collectionView
:
UICollectionView
,
numberOfItemsInSection
section
:
Int
)
->
Int
{
return
Int
(
mediaDataSource
.
numberOfFiles
())
return
Int
(
services
.
mediaDataSource
.
numberOfFiles
())
}
override
public
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
delegate
?
.
videoViewControllerDidSelectMediaObject
(
VLCMediaViewController
:
self
,
mediaObject
:
mediaDataSource
.
object
(
at
:
UInt
(
indexPath
.
row
)))
delegate
?
.
videoViewControllerDidSelectMediaObject
(
VLCMediaViewController
:
self
,
mediaObject
:
services
.
mediaDataSource
.
object
(
at
:
UInt
(
indexPath
.
row
)))
}
override
public
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
if
let
playlistCell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
VLCPlaylistCollectionViewCell
.
cellIdentifier
(),
for
:
indexPath
)
as?
VLCPlaylistCollectionViewCell
{
playlistCell
.
mediaObject
=
mediaDataSource
.
object
(
at
:
UInt
(
indexPath
.
row
))
playlistCell
.
mediaObject
=
services
.
mediaDataSource
.
object
(
at
:
UInt
(
indexPath
.
row
))
return
playlistCell
}
return
UICollectionViewCell
()
...
...
@@ -140,7 +145,7 @@ public class VLCMediaViewController: UICollectionViewController, UICollectionVie
//MARK: - Search
public
func
updateSearchResults
(
for
searchController
:
UISearchController
)
{
searchDataSource
.
shouldReloadTable
(
forSearch
:
searchController
.
searchBar
.
text
,
searchableFiles
:
mediaDataSource
.
allObjects
())
searchDataSource
.
shouldReloadTable
(
forSearch
:
searchController
.
searchBar
.
text
,
searchableFiles
:
services
.
mediaDataSource
.
allObjects
())
collectionView
?
.
reloadData
()
}
...
...
Sources/VLCAppDelegate.m
View file @
39778c05
...
...
@@ -213,7 +213,6 @@ NSString *const VLCDropboxSessionWasAuthorized = @"VLCDropboxSessionWasAuthorize
[[
UINavigationBar
appearanceWhenContainedInInstancesOfClasses
:@[[
VLCPlaybackNavigationController
class
]]]
setPrefersLargeTitles
:
@NO
];
}
// For the edit selection indicators
[[
UITabBar
appearance
]
setTintColor
:
vlcOrange
];
[[
UITableView
appearance
]
setTintColor
:
vlcOrange
];
[[
UISegmentedControl
appearance
]
setTintColor
:
vlcOrange
];
[[
UISwitch
appearance
]
setOnTintColor
:
vlcOrange
];
...
...
Sources/VLCConstants.h
View file @
39778c05
...
...
@@ -16,6 +16,8 @@
#define kVLCSettingPasscodeOnKey @"PasscodeProtection"
#define kVLCSettingPasscodeAllowTouchID @"AllowTouchID"
#define kVLCSettingPasscodeAllowFaceID @"AllowFaceID"
#define kVLCThemeDidChangeNotification @"themeDidChangeNotfication"
#define kVLCSettingAppTheme @"darkMode"
#define kVLCAutomaticallyPlayNextItem @"AutomaticallyPlayNextItem"
#define kVLCSettingContinueAudioInBackgroundKey @"BackgroundAudioPlayback"
#define kVLCSettingStretchAudio @"audio-time-stretch"
...
...
Sources/VLCSettingsController.m
View file @
39778c05
...
...
@@ -40,6 +40,14 @@
self
.
delegate
=
self
;
self
.
showDoneButton
=
NO
;
self
.
showCreditsFooter
=
NO
;
[
self
themeDidChange
];
}
-
(
void
)
themeDidChange
{
self
.
view
.
backgroundColor
=
PresentationTheme
.
current
.
colors
.
settingsBackground
;
self
.
tableView
.
separatorColor
=
PresentationTheme
.
current
.
colors
.
settingsSeparatorColor
;
[
self
.
tableView
reloadData
];
}
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
...
...
@@ -92,6 +100,11 @@
[
self
updateForPasscode
:
nil
];
}
}
if
([
notification
.
object
isEqual
:
kVLCSettingAppTheme
])
{
BOOL
darkTheme
=
[[
notification
.
userInfo
objectForKey
:
kVLCSettingAppTheme
]
boolValue
];
PresentationTheme
.
current
=
darkTheme
?
PresentationTheme
.
darkTheme
:
PresentationTheme
.
whiteTheme
;
[
self
themeDidChange
];
}
}
-
(
void
)
updateUIAndCoreSpotlightForPasscodeSetting
:(
BOOL
)
passcodeOn
...
...
@@ -124,6 +137,15 @@
[
self
updateForPasscode
:
controller
.
passcode
];
}
-
(
UITableViewCell
*
)
tableView
:(
UITableView
*
)
tableView
cellForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
UITableViewCell
*
cell
=
[
super
tableView
:
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
backgroundColor
=
PresentationTheme
.
current
.
colors
.
settingsCellBackground
;
cell
.
textLabel
.
textColor
=
PresentationTheme
.
current
.
colors
.
cellTextColor
;
cell
.
detailTextLabel
.
textColor
=
PresentationTheme
.
current
.
colors
.
cellDetailTextColor
;
return
cell
;
}
-
(
void
)
updateForPasscode
:(
NSString
*
)
passcode
{
NSError
*
error
=
nil
;
...
...
Sources/VLCTabBarCoordinator.swift
View file @
39778c05
...
...
@@ -12,26 +12,35 @@
import
Foundation
protocol
VLCTabbarCooordinatorDelegate
{
}
class
VLCTabbarCooordinator
:
NSObject
,
VLCMediaViewControllerDelegate
{
private
var
childCoordinators
:
[
NSObject
]
=
[]
private
var
tabBarController
:
UITabBarController
var
delegate
:
VLCTabbarCooordinatorDelegate
?
private
var
services
:
Services
public
init
(
tabBarController
:
UITabBarController
)
{
public
init
(
tabBarController
:
UITabBarController
,
services
:
Services
)
{
self
.
tabBarController
=
tabBarController
self
.
services
=
services
super
.
init
()
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
themeDidChange
)
,
name
:
VLCThemeDidChangeNotification
,
object
:
nil
)
}
public
func
start
()
{
@objc
public
func
start
()
{
setupViewControllers
()
setupAppearance
()
}
@objc
func
themeDidChange
()
{
tabBarController
.
tabBar
.
barTintColor
=
PresentationTheme
.
current
.
colors
.
tabBarColor
}
func
setupAppearance
()
{
tabBarController
.
tabBar
.
tintColor
=
PresentationTheme
.
current
.
colors
.
orangeUI
tabBarController
.
tabBar
.
barTintColor
=
PresentationTheme
.
current
.
colors
.
tabBarColor
}
public
func
setupViewControllers
()
{
let
videoVC
=
VLCMediaViewController
(
collectionViewLayout
:
UICollectionViewFlowLayout
()
)
func
setupViewControllers
()
{
let
videoVC
=
VLCMediaViewController
(
services
:
services
)
//this should probably not be the delegate
videoVC
.
delegate
=
self
videoVC
.
title
=
NSLocalizedString
(
"Video"
,
comment
:
""
)
...
...
@@ -41,7 +50,7 @@ class VLCTabbarCooordinator: NSObject, VLCMediaViewControllerDelegate {
selectedImage
:
UIImage
(
named
:
"TVShowsIcon"
))
// Audio
let
audioVC
=
VLCMediaViewController
(
collectionViewLayout
:
UICollectionViewFlowLayout
()
)
let
audioVC
=
VLCMediaViewController
(
services
:
services
)
//this should probably not be the delegate
audioVC
.
delegate
=
self
audioVC
.
title
=
NSLocalizedString
(
"Audio"
,
comment
:
""
)
...
...
@@ -52,7 +61,7 @@ class VLCTabbarCooordinator: NSObject, VLCMediaViewControllerDelegate {
//Serverlist
let
serverVC
=
VLCServerListViewController
()
serverVC
.
title
=
NSLocalizedString
(
"LOCAL_NETWORK"
,
comment
:
""
)
;
serverVC
.
title
=
NSLocalizedString
(
"LOCAL_NETWORK"
,
comment
:
""
)
serverVC
.
tabBarItem
=
UITabBarItem
(
title
:
NSLocalizedString
(
"LOCAL_NETWORK"
,
comment
:
""
),
image
:
UIImage
(
named
:
"Local"
),
...
...
VLC.xcodeproj/project.pbxproj
View file @
39778c05
...
...
@@ -21,6 +21,7 @@
41273A3C1A955C4100A2EF77
/* VLCMigrationViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
41273A3A1A955C4100A2EF77
/* VLCMigrationViewController.m */
;
};
41273A3D1A955C4100A2EF77
/* VLCMigrationViewController.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
41273A3B1A955C4100A2EF77
/* VLCMigrationViewController.xib */
;
};
413EC987201A329D00BF412F
/* SortOption.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
413EC986201A329D00BF412F
/* SortOption.swift */
;
};
413EC98B201B4F2C00BF412F
/* PresentationTheme.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
413EC98A201B4F2B00BF412F
/* PresentationTheme.swift */
;
};
4144C4661A0ED6C700918C89
/* Reachability.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
7D3784E6183A99E1009EE944
/* Reachability.m */
;
};
4152F1621FEF19BD00F1908B
/* KeychainCoordinator.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4152F1611FEF19BD00F1908B
/* KeychainCoordinator.swift */
;
};
4152F1631FEF19BD00F1908B
/* KeychainCoordinator.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4152F1611FEF19BD00F1908B
/* KeychainCoordinator.swift */
;
};
...
...
@@ -751,6 +752,7 @@
41273A3A1A955C4100A2EF77
/* VLCMigrationViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
VLCMigrationViewController.m
;
path
=
Sources/VLCMigrationViewController.m
;
sourceTree
=
SOURCE_ROOT
;
};
41273A3B1A955C4100A2EF77
/* VLCMigrationViewController.xib */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.xib
;
name
=
VLCMigrationViewController.xib
;
path
=
Sources/VLCMigrationViewController.xib
;
sourceTree
=
SOURCE_ROOT
;
};
413EC986201A329D00BF412F
/* SortOption.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
SortOption.swift
;
path
=
SharedSources/Coordinators/SortOption.swift
;
sourceTree
=
SOURCE_ROOT
;
};
413EC98A201B4F2B00BF412F
/* PresentationTheme.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PresentationTheme.swift
;
sourceTree
=
"<group>"
;
};
4152F1611FEF19BD00F1908B
/* KeychainCoordinator.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
KeychainCoordinator.swift
;
path
=
Sources/KeychainCoordinator.swift
;
sourceTree
=
"<group>"
;
};
4171D34E18A2C19000A16EF9
/* VLCFolderCollectionViewFlowLayout.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
VLCFolderCollectionViewFlowLayout.h
;
path
=
Sources/VLCFolderCollectionViewFlowLayout.h
;
sourceTree
=
SOURCE_ROOT
;
};
4171D34F18A2C19000A16EF9
/* VLCFolderCollectionViewFlowLayout.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
VLCFolderCollectionViewFlowLayout.m
;
path
=
Sources/VLCFolderCollectionViewFlowLayout.m
;
sourceTree
=
SOURCE_ROOT
;
};
...
...
@@ -2314,6 +2316,7 @@
DD13A37A1BEE2FAA00A35554
/* VLCMaskView.m */
,
DD4089F31BF6556F0022745E
/* VLCFullWidthCollectionViewFlowLayout.h */
,
DD4089F41BF6556F0022745E
/* VLCFullWidthCollectionViewFlowLayout.m */
,
413EC98A201B4F2B00BF412F
/* PresentationTheme.swift */
,
);
name
=
"UI Elements"
;
sourceTree
=
"<group>"
;
...
...
@@ -3776,6 +3779,7 @@
41251ED01FD0CF7900099110
/* AppCoordinator.swift in Sources */
,
4184AA151A5492070063DF5A
/* VLCCloudStorageController.m in Sources */
,
9BE4D1CE183D76950006346C
/* VLCCloudStorageTableViewCell.m in Sources */
,
413EC98B201B4F2C00BF412F
/* PresentationTheme.swift in Sources */
,
41F5C07B1F42E567005EB9CB
/* VLCMediaDataSource.m in Sources */
,
DD1CB0321BB9E005006EDDE6
/* VLCMovieViewControlPanelView.m in Sources */
,
DDF908D01CF4CCAA00108B70
/* VLCNetworkLoginViewButtonCell.m in Sources */
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment