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
3c020dc8
Commit
3c020dc8
authored
Oct 10, 2018
by
Orkhan Alikhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made StatusBarController themeable
parent
f3398a3b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
Sources/iOS/Material+UIColor.swift
+20
-0
Sources/iOS/StatusBarController.swift
+6
-0
No files found.
Sources/iOS/Material+UIColor.swift
View file @
3c020dc8
...
@@ -98,4 +98,24 @@ internal extension UIColor {
...
@@ -98,4 +98,24 @@ internal extension UIColor {
return
UIColor
(
red
:
newR
,
green
:
newG
,
blue
:
newB
,
alpha
:
newA
)
return
UIColor
(
red
:
newR
,
green
:
newG
,
blue
:
newB
,
alpha
:
newA
)
}
}
func
adjustingBrightness
(
by
value
:
CGFloat
)
->
UIColor
{
var
h
:
CGFloat
=
0
var
s
:
CGFloat
=
0
var
b
:
CGFloat
=
0
var
a
:
CGFloat
=
0
getHue
(
&
h
,
saturation
:
&
s
,
brightness
:
&
b
,
alpha
:
&
a
)
return
UIColor
(
hue
:
h
,
saturation
:
s
,
brightness
:
(
b
+
value
)
.
clamp
(
0
,
1
),
alpha
:
1
)
}
var
lighter
:
UIColor
{
return
adjustingBrightness
(
by
:
0.05
)
}
var
darker
:
UIColor
{
return
adjustingBrightness
(
by
:
-
0.05
)
}
}
}
Sources/iOS/StatusBarController.swift
View file @
3c020dc8
...
@@ -120,6 +120,12 @@ open class StatusBarController: TransitionController {
...
@@ -120,6 +120,12 @@ open class StatusBarController: TransitionController {
super
.
prepare
()
super
.
prepare
()
prepareStatusBar
()
prepareStatusBar
()
}
}
open
override
func
apply
(
theme
:
Theme
)
{
super
.
apply
(
theme
:
theme
)
statusBar
.
backgroundColor
=
theme
.
primary
.
darker
}
}
}
fileprivate
extension
StatusBarController
{
fileprivate
extension
StatusBarController
{
...
...
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