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
c08a143e
Commit
c08a143e
authored
Oct 06, 2018
by
Orkhan Alikhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made TextFields themeable
parent
b5908d83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletions
+22
-1
Sources/iOS/ErrorTextField.swift
+6
-0
Sources/iOS/TextField.swift
+16
-1
No files found.
Sources/iOS/ErrorTextField.swift
View file @
c08a143e
...
...
@@ -93,4 +93,10 @@ open class ErrorTextField: TextField {
super
.
layoutSubviews
()
layoutBottomLabel
(
label
:
errorLabel
,
verticalOffset
:
errorVerticalOffset
)
}
open
override
func
apply
(
theme
:
Theme
)
{
super
.
apply
(
theme
:
theme
)
errorColor
=
theme
.
error
}
}
Sources/iOS/TextField.swift
View file @
c08a143e
...
...
@@ -63,7 +63,7 @@ public protocol TextFieldDelegate: UITextFieldDelegate {
optional
func
textField
(
textField
:
TextField
,
didClear
text
:
String
?)
}
open
class
TextField
:
UITextField
{
open
class
TextField
:
UITextField
,
Themeable
{
/// Minimum TextField text height.
private
let
minimumTextHeight
:
CGFloat
=
32
...
...
@@ -459,6 +459,21 @@ open class TextField: UITextField {
prepareTargetHandlers
()
prepareTextAlignment
()
prepareRightView
()
applyCurrentTheme
()
}
open
func
apply
(
theme
:
Theme
)
{
placeholderActiveColor
=
theme
.
secondary
placeholderNormalColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.38
)
leftViewActiveColor
=
theme
.
secondary
leftViewNormalColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.38
)
dividerActiveColor
=
theme
.
secondary
dividerNormalColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.12
)
detailColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.38
)
textColor
=
theme
.
onSurface
.
withAlphaComponent
(
0.87
)
}
}
...
...
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