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
f47bdadf
Commit
f47bdadf
authored
Oct 11, 2018
by
Orkhan Alikhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing comments
parent
c7f75ba0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
5 deletions
+44
-5
Sources/iOS/BottomNavigationController.swift
+4
-0
Sources/iOS/Button.swift
+2
-2
Sources/iOS/Editor.swift
+4
-0
Sources/iOS/Material+UIColor.swift
+9
-3
Sources/iOS/NavigationBar.swift
+9
-0
Sources/iOS/Switch.swift
+4
-0
Sources/iOS/TextField.swift
+4
-0
Sources/iOS/TextView.swift
+4
-0
Sources/iOS/Toolbar.swift
+4
-0
No files found.
Sources/iOS/BottomNavigationController.swift
View file @
f47bdadf
...
@@ -171,6 +171,10 @@ open class BottomNavigationController: UITabBarController, Themeable {
...
@@ -171,6 +171,10 @@ open class BottomNavigationController: UITabBarController, Themeable {
applyCurrentTheme
()
applyCurrentTheme
()
}
}
/**
Applies the given theme.
- Parameter theme: A Theme.
*/
open
func
apply
(
theme
:
Theme
)
{
open
func
apply
(
theme
:
Theme
)
{
tabBar
.
tintColor
=
theme
.
secondary
tabBar
.
tintColor
=
theme
.
secondary
tabBar
.
barTintColor
=
theme
.
background
tabBar
.
barTintColor
=
theme
.
background
...
...
Sources/iOS/Button.swift
View file @
f47bdadf
...
@@ -285,9 +285,9 @@ open class Button: UIButton, Pulseable, PulseableLayer, Themeable {
...
@@ -285,9 +285,9 @@ open class Button: UIButton, Pulseable, PulseableLayer, Themeable {
}
}
/**
/**
Applies
given theme to the view
.
Applies
the given theme
.
- Parameter theme: A Theme.
- Parameter theme: A Theme.
*/
*/
open
func
apply
(
theme
:
Theme
)
{
}
open
func
apply
(
theme
:
Theme
)
{
}
}
}
...
...
Sources/iOS/Editor.swift
View file @
f47bdadf
...
@@ -190,6 +190,10 @@ open class Editor: View, Themeable {
...
@@ -190,6 +190,10 @@ open class Editor: View, Themeable {
layoutBottomLabel
(
label
:
detailLabel
,
verticalOffset
:
detailVerticalOffset
)
layoutBottomLabel
(
label
:
detailLabel
,
verticalOffset
:
detailVerticalOffset
)
}
}
/**
Applies the given theme.
- Parameter theme: A Theme.
*/
open
func
apply
(
theme
:
Theme
)
{
open
func
apply
(
theme
:
Theme
)
{
placeholderActiveColor
=
theme
.
secondary
placeholderActiveColor
=
theme
.
secondary
placeholderNormalColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.38
)
placeholderNormalColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.38
)
...
...
Sources/iOS/Material+UIColor.swift
View file @
f47bdadf
...
@@ -99,7 +99,11 @@ internal extension UIColor {
...
@@ -99,7 +99,11 @@ internal extension UIColor {
return
UIColor
(
red
:
newR
,
green
:
newG
,
blue
:
newB
,
alpha
:
newA
)
return
UIColor
(
red
:
newR
,
green
:
newG
,
blue
:
newB
,
alpha
:
newA
)
}
}
/**
Adjusts brightness of the color by given value.
- Parameter by value: A CGFloat value.
- Returns: Adjusted color.
*/
func
adjustingBrightness
(
by
value
:
CGFloat
)
->
UIColor
{
func
adjustingBrightness
(
by
value
:
CGFloat
)
->
UIColor
{
var
h
:
CGFloat
=
0
var
h
:
CGFloat
=
0
var
s
:
CGFloat
=
0
var
s
:
CGFloat
=
0
...
@@ -111,11 +115,13 @@ internal extension UIColor {
...
@@ -111,11 +115,13 @@ internal extension UIColor {
return
UIColor
(
hue
:
h
,
saturation
:
s
,
brightness
:
(
b
+
value
)
.
clamp
(
0
,
1
),
alpha
:
1
)
return
UIColor
(
hue
:
h
,
saturation
:
s
,
brightness
:
(
b
+
value
)
.
clamp
(
0
,
1
),
alpha
:
1
)
}
}
/// A lighter version of the color.
var
lighter
:
UIColor
{
var
lighter
:
UIColor
{
return
adjustingBrightness
(
by
:
0.
05
)
return
adjustingBrightness
(
by
:
0.
1
)
}
}
/// A darker version of the color.
var
darker
:
UIColor
{
var
darker
:
UIColor
{
return
adjustingBrightness
(
by
:
-
0.
05
)
return
adjustingBrightness
(
by
:
-
0.
1
)
}
}
}
}
Sources/iOS/NavigationBar.swift
View file @
f47bdadf
...
@@ -171,6 +171,10 @@ open class NavigationBar: UINavigationBar, Themeable {
...
@@ -171,6 +171,10 @@ open class NavigationBar: UINavigationBar, Themeable {
applyCurrentTheme
()
applyCurrentTheme
()
}
}
/**
Applies the given theme.
- Parameter theme: A Theme.
*/
open
func
apply
(
theme
:
Theme
)
{
open
func
apply
(
theme
:
Theme
)
{
backgroundColor
=
theme
.
primary
backgroundColor
=
theme
.
primary
items
?
.
forEach
{
items
?
.
forEach
{
...
@@ -178,6 +182,11 @@ open class NavigationBar: UINavigationBar, Themeable {
...
@@ -178,6 +182,11 @@ open class NavigationBar: UINavigationBar, Themeable {
}
}
}
}
/**
Applies the given theme to the navigation item.
- Parameter theme: A Theme.
- Parameter to item: A UINavigationItem.
*/
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
item
.
toolbar
.
backgroundColor
=
.
clear
...
...
Sources/iOS/Switch.swift
View file @
f47bdadf
...
@@ -327,6 +327,10 @@ open class Switch: UIControl, Themeable {
...
@@ -327,6 +327,10 @@ open class Switch: UIControl, Themeable {
applyCurrentTheme
()
applyCurrentTheme
()
}
}
/**
Applies the given theme.
- Parameter theme: A Theme.
*/
open
func
apply
(
theme
:
Theme
)
{
open
func
apply
(
theme
:
Theme
)
{
buttonOnColor
=
theme
.
secondary
buttonOnColor
=
theme
.
secondary
trackOnColor
=
theme
.
secondary
.
withAlphaComponent
(
0.60
)
trackOnColor
=
theme
.
secondary
.
withAlphaComponent
(
0.60
)
...
...
Sources/iOS/TextField.swift
View file @
f47bdadf
...
@@ -462,6 +462,10 @@ open class TextField: UITextField, Themeable {
...
@@ -462,6 +462,10 @@ open class TextField: UITextField, Themeable {
applyCurrentTheme
()
applyCurrentTheme
()
}
}
/**
Applies the given theme.
- Parameter theme: A Theme.
*/
open
func
apply
(
theme
:
Theme
)
{
open
func
apply
(
theme
:
Theme
)
{
placeholderActiveColor
=
theme
.
secondary
placeholderActiveColor
=
theme
.
secondary
placeholderNormalColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.38
)
placeholderNormalColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.38
)
...
...
Sources/iOS/TextView.swift
View file @
f47bdadf
...
@@ -356,6 +356,10 @@ open class TextView: UITextView, Themeable {
...
@@ -356,6 +356,10 @@ open class TextView: UITextView, Themeable {
fixTypingFont
()
fixTypingFont
()
}
}
/**
Applies the given theme.
- Parameter theme: A Theme.
*/
open
func
apply
(
theme
:
Theme
)
{
open
func
apply
(
theme
:
Theme
)
{
textColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.87
)
textColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.87
)
placeholderColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.38
)
placeholderColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.38
)
...
...
Sources/iOS/Toolbar.swift
View file @
f47bdadf
...
@@ -147,6 +147,10 @@ open class Toolbar: Bar, Themeable {
...
@@ -147,6 +147,10 @@ open class Toolbar: Bar, Themeable {
prepareDetailLabel
()
prepareDetailLabel
()
}
}
/**
Applies the given theme.
- Parameter theme: A Theme.
*/
open
func
apply
(
theme
:
Theme
)
{
open
func
apply
(
theme
:
Theme
)
{
backgroundColor
=
theme
.
primary
backgroundColor
=
theme
.
primary
(
leftViews
+
rightViews
+
centerViews
)
.
forEach
{
(
leftViews
+
rightViews
+
centerViews
)
.
forEach
{
...
...
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