Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Carola
vlc-ios
Commits
a2684822
Commit
a2684822
authored
Feb 02, 2018
by
Carola Nitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TabBarController: adopt the MoreViewcontroller for the theme
parent
1b6fde8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
Sources/AppearanceManager.swift
Sources/AppearanceManager.swift
+54
-0
No files found.
Sources/AppearanceManager.swift
0 → 100644
View file @
a2684822
/*****************************************************************************
* 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.
*****************************************************************************/
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
}
// 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
}
}
}
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