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
f0d2b907
Commit
f0d2b907
authored
Oct 21, 2018
by
Orkhan Alikhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved hard-coded RobotoFont to Theme.font
parent
0b1d7707
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
38 additions
and
13 deletions
+38
-13
Sources/iOS/DialogView.swift
+2
-2
Sources/iOS/Editor.swift
+1
-1
Sources/iOS/ErrorTextField.swift
+1
-1
Sources/iOS/FABMenu.swift
+1
-1
Sources/iOS/Font.swift
+22
-1
Sources/iOS/SearchBar.swift
+1
-1
Sources/iOS/Snackbar.swift
+1
-1
Sources/iOS/TextField.swift
+2
-2
Sources/iOS/TextView.swift
+1
-1
Sources/iOS/Theme.swift
+3
-0
Sources/iOS/Toolbar.swift
+2
-2
Sources/iOS/ViewController.swift
+1
-0
No files found.
Sources/iOS/DialogView.swift
View file @
f0d2b907
...
...
@@ -233,7 +233,7 @@ private extension DialogView {
/// Prepares titleTitle.
func
prepareTitleLabel
()
{
titleArea
.
addSubview
(
titleLabel
)
titleLabel
.
font
=
RobotoF
ont
.
bold
(
with
:
20
)
titleLabel
.
font
=
Theme
.
f
ont
.
bold
(
with
:
20
)
titleLabel
.
textColor
=
Color
.
darkText
.
primary
titleLabel
.
numberOfLines
=
0
}
...
...
@@ -250,7 +250,7 @@ private extension DialogView {
func
prepareButtons
()
{
[
positiveButton
,
negativeButton
,
neutralButton
]
.
forEach
{
buttonArea
.
addSubview
(
$0
)
$0
.
titleLabel
?
.
font
=
RobotoF
ont
.
medium
(
with
:
14
)
$0
.
titleLabel
?
.
font
=
Theme
.
f
ont
.
medium
(
with
:
14
)
$0
.
contentEdgeInsets
=
Constants
.
button
.
insets
$0
.
cornerRadiusPreset
=
.
cornerRadius1
}
...
...
Sources/iOS/Editor.swift
View file @
f0d2b907
...
...
@@ -251,7 +251,7 @@ private extension Editor {
/// Prepares the detailLabel.
func
prepareDetailLabel
()
{
detailLabel
.
font
=
RobotoF
ont
.
regular
(
with
:
12
)
detailLabel
.
font
=
Theme
.
f
ont
.
regular
(
with
:
12
)
detailLabel
.
numberOfLines
=
0
detailColor
=
Color
.
darkText
.
others
addSubview
(
detailLabel
)
...
...
Sources/iOS/ErrorTextField.swift
View file @
f0d2b907
...
...
@@ -83,7 +83,7 @@ open class ErrorTextField: TextField {
/// Prepares the errorLabel.
func
prepareErrorLabel
()
{
errorLabel
.
font
=
RobotoF
ont
.
regular
(
with
:
12
)
errorLabel
.
font
=
Theme
.
f
ont
.
regular
(
with
:
12
)
errorLabel
.
numberOfLines
=
0
errorColor
=
{
errorColor
}()
// call didSet
addSubview
(
errorLabel
)
...
...
Sources/iOS/FABMenu.swift
View file @
f0d2b907
...
...
@@ -129,7 +129,7 @@ extension FABMenuItem {
/// Prepares the titleLabel.
fileprivate
func
prepareTitleLabel
()
{
titleLabel
.
font
=
RobotoF
ont
.
regular
(
with
:
14
)
titleLabel
.
font
=
Theme
.
f
ont
.
regular
(
with
:
14
)
titleLabel
.
textAlignment
=
.
center
titleLabel
.
backgroundColor
=
.
white
titleLabel
.
depthPreset
=
fabButton
.
depthPreset
...
...
Sources/iOS/Font.swift
View file @
f0d2b907
...
...
@@ -30,7 +30,28 @@
import
UIKit
public
protocol
FontType
{}
public
protocol
FontType
{
/**
Regular with size font.
- Parameter with size: A CGFLoat for the font size.
- Returns: A UIFont.
*/
static
func
regular
(
with
size
:
CGFloat
)
->
UIFont
/**
Medium with size font.
- Parameter with size: A CGFLoat for the font size.
- Returns: A UIFont.
*/
static
func
medium
(
with
size
:
CGFloat
)
->
UIFont
/**
Bold with size font.
- Parameter with size: A CGFLoat for the font size.
- Returns: A UIFont.
*/
static
func
bold
(
with
size
:
CGFloat
)
->
UIFont
}
public
struct
Font
{
/// Size of font.
...
...
Sources/iOS/SearchBar.swift
View file @
f0d2b907
...
...
@@ -213,7 +213,7 @@ fileprivate extension SearchBar {
/// Prepares the textField.
func
prepareTextField
()
{
textField
.
contentScaleFactor
=
Screen
.
scale
textField
.
font
=
RobotoF
ont
.
regular
(
with
:
17
)
textField
.
font
=
Theme
.
f
ont
.
regular
(
with
:
17
)
textField
.
backgroundColor
=
Color
.
clear
textField
.
clearButtonMode
=
.
whileEditing
textField
.
addTarget
(
self
,
action
:
#selector(
handleEditingChanged(textField:)
)
,
for
:
.
editingChanged
)
...
...
Sources/iOS/Snackbar.swift
View file @
f0d2b907
...
...
@@ -104,7 +104,7 @@ open class Snackbar: Bar {
/// Prepares the textLabel.
private
func
prepareTextLabel
()
{
textLabel
.
contentScaleFactor
=
Screen
.
scale
textLabel
.
font
=
RobotoF
ont
.
medium
(
with
:
14
)
textLabel
.
font
=
Theme
.
f
ont
.
medium
(
with
:
14
)
textLabel
.
textAlignment
=
.
left
textLabel
.
textColor
=
.
white
textLabel
.
numberOfLines
=
0
...
...
Sources/iOS/TextField.swift
View file @
f0d2b907
...
...
@@ -450,7 +450,7 @@ open class TextField: UITextField, Themeable {
borderStyle
=
.
none
backgroundColor
=
nil
contentScaleFactor
=
Screen
.
scale
font
=
RobotoF
ont
.
regular
(
with
:
16
)
font
=
Theme
.
f
ont
.
regular
(
with
:
16
)
textColor
=
Color
.
darkText
.
primary
prepareDivider
()
...
...
@@ -496,7 +496,7 @@ fileprivate extension TextField {
/// Prepares the detailLabel.
func
prepareDetailLabel
()
{
detailLabel
.
font
=
RobotoF
ont
.
regular
(
with
:
12
)
detailLabel
.
font
=
Theme
.
f
ont
.
regular
(
with
:
12
)
detailLabel
.
numberOfLines
=
0
detailColor
=
Color
.
darkText
.
others
addSubview
(
detailLabel
)
...
...
Sources/iOS/TextView.swift
View file @
f0d2b907
...
...
@@ -283,7 +283,7 @@ open class TextView: UITextView, Themeable {
contentScaleFactor
=
Screen
.
scale
textContainerInset
=
.
zero
backgroundColor
=
nil
font
=
RobotoF
ont
.
regular
(
with
:
16
)
font
=
Theme
.
f
ont
.
regular
(
with
:
16
)
textColor
=
Color
.
darkText
.
primary
prepareNotificationHandlers
()
...
...
Sources/iOS/Theme.swift
View file @
f0d2b907
...
...
@@ -77,6 +77,9 @@ public struct Theme: Hashable {
/// A boolean indicating if theming is enabled globally.
public
static
var
isEnabled
=
true
/// Global font for app.
public
static
var
font
:
FontType
.
Type
=
RobotoFont
.
self
/// An initializer.
public
init
()
{
}
}
...
...
Sources/iOS/Toolbar.swift
View file @
f0d2b907
...
...
@@ -184,7 +184,7 @@ private extension Toolbar {
func
prepareTitleLabel
()
{
titleLabel
.
textAlignment
=
.
center
titleLabel
.
contentScaleFactor
=
Screen
.
scale
titleLabel
.
font
=
RobotoF
ont
.
medium
(
with
:
17
)
titleLabel
.
font
=
Theme
.
f
ont
.
medium
(
with
:
17
)
titleLabel
.
textColor
=
Color
.
darkText
.
primary
titleLabelTextAlignmentObserver
=
titleLabel
.
observe
(
\
.
textAlignment
)
{
[
weak
self
]
titleLabel
,
_
in
self
?
.
contentViewAlignment
=
.
center
==
titleLabel
.
textAlignment
?
.
center
:
.
full
...
...
@@ -195,7 +195,7 @@ private extension Toolbar {
func
prepareDetailLabel
()
{
detailLabel
.
textAlignment
=
.
center
detailLabel
.
contentScaleFactor
=
Screen
.
scale
detailLabel
.
font
=
RobotoF
ont
.
regular
(
with
:
12
)
detailLabel
.
font
=
Theme
.
f
ont
.
regular
(
with
:
12
)
detailLabel
.
textColor
=
Color
.
darkText
.
secondary
}
...
...
Sources/iOS/ViewController.swift
View file @
f0d2b907
...
...
@@ -45,6 +45,7 @@ open class ViewController: UIViewController, Themeable {
*/
open
func
prepare
()
{
view
.
clipsToBounds
=
true
view
.
backgroundColor
=
.
white
view
.
contentScaleFactor
=
Screen
.
scale
applyCurrentTheme
()
}
...
...
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