Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
d9dfb66c
Unverified
Commit
d9dfb66c
authored
Oct 19, 2018
by
Daniel Jonathan
Committed by
GitHub
Oct 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1174 from OrkhanAlikhanov/theme-global-disable
Added disabling theming globally and per-class
parents
e26faf0c
a7dba80a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
Sources/iOS/NavigationBar.swift
+1
-1
Sources/iOS/Theme.swift
+16
-1
No files found.
Sources/iOS/NavigationBar.swift
View file @
d9dfb66c
...
@@ -189,7 +189,6 @@ open class NavigationBar: UINavigationBar, Themeable {
...
@@ -189,7 +189,6 @@ open class NavigationBar: UINavigationBar, Themeable {
*/
*/
private
func
apply
(
theme
:
Theme
,
to
item
:
UINavigationItem
)
{
private
func
apply
(
theme
:
Theme
,
to
item
:
UINavigationItem
)
{
Theme
.
apply
(
theme
:
theme
,
to
:
item
.
toolbar
)
Theme
.
apply
(
theme
:
theme
,
to
:
item
.
toolbar
)
item
.
toolbar
.
backgroundColor
=
.
clear
}
}
}
}
...
@@ -208,6 +207,7 @@ internal extension NavigationBar {
...
@@ -208,6 +207,7 @@ internal extension NavigationBar {
}
}
let
toolbar
=
item
.
toolbar
let
toolbar
=
item
.
toolbar
toolbar
.
backgroundColor
=
.
clear
toolbar
.
interimSpace
=
interimSpace
toolbar
.
interimSpace
=
interimSpace
toolbar
.
contentEdgeInsets
=
contentEdgeInsets
toolbar
.
contentEdgeInsets
=
contentEdgeInsets
...
...
Sources/iOS/Theme.swift
View file @
d9dfb66c
...
@@ -74,6 +74,9 @@ public struct Theme: Hashable {
...
@@ -74,6 +74,9 @@ public struct Theme: Hashable {
/// Text and iconography color to be used on error color.
/// Text and iconography color to be used on error color.
public
var
onError
=
Color
.
white
public
var
onError
=
Color
.
white
/// A boolean indicating if theming is enabled globally.
public
static
var
isEnabled
=
true
/// An initializer.
/// An initializer.
public
init
()
{
}
public
init
()
{
}
}
}
...
@@ -172,10 +175,22 @@ public extension Theme {
...
@@ -172,10 +175,22 @@ public extension Theme {
private
var
IsThemingEnabledKey
:
UInt8
=
0
private
var
IsThemingEnabledKey
:
UInt8
=
0
public
extension
Themeable
where
Self
:
NSObject
{
public
extension
Themeable
where
Self
:
NSObject
{
/// A class-wide boolean indicating if theming is enabled.
static
var
isThemingEnabled
:
Bool
{
get
{
return
Theme
.
isEnabled
&&
AssociatedObject
.
get
(
base
:
self
,
key
:
&
IsThemingEnabledKey
)
{
true
}
}
set
(
value
)
{
AssociatedObject
.
set
(
base
:
self
,
key
:
&
IsThemingEnabledKey
,
value
:
value
)
}
}
/// A boolean indicating if theming is enabled.
/// A boolean indicating if theming is enabled.
var
isThemingEnabled
:
Bool
{
var
isThemingEnabled
:
Bool
{
get
{
get
{
return
AssociatedObject
.
get
(
base
:
self
,
key
:
&
IsThemingEnabledKey
)
{
return
type
(
of
:
self
)
.
isThemingEnabled
&&
AssociatedObject
.
get
(
base
:
self
,
key
:
&
IsThemingEnabledKey
)
{
true
true
}
}
}
}
...
...
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