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
8caf7fb1
Commit
8caf7fb1
authored
Aug 16, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated TextField accessibility settings and Material version to 2.9.4 for next release
parent
862927ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
29 deletions
+44
-29
Sources/Info.plist
+1
-1
Sources/iOS/SearchBarController.swift
+18
-3
Sources/iOS/TextField.swift
+25
-25
No files found.
Sources/Info.plist
View file @
8caf7fb1
...
...
@@ -15,7 +15,7 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
FMWK
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
2.9.
3
<
/string
>
<
string
>
2.9.
4
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
...
...
Sources/iOS/SearchBarController.swift
View file @
8caf7fb1
...
...
@@ -30,6 +30,12 @@
import
UIKit
@objc(SearchBarAlignment)
public
enum
SearchBarAlignment
:
Int
{
case
top
case
bottom
}
public
extension
UIViewController
{
/**
A convenience property that provides access to the SearchBarController.
...
...
@@ -46,6 +52,13 @@ open class SearchBarController: StatusBarController {
@IBInspectable
open
let
searchBar
=
SearchBar
()
/// The searchBar alignment.
open
var
searchBarAlignment
=
SearchBarAlignment
.
top
{
didSet
{
layoutSubviews
()
}
}
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
...
...
@@ -56,6 +69,8 @@ open class SearchBarController: StatusBarController {
switch
displayStyle
{
case
.
partial
:
let
h
=
y
+
searchBar
.
height
container
.
y
=
h
container
.
height
=
view
.
height
-
h
...
...
@@ -75,14 +90,14 @@ open class SearchBarController: StatusBarController {
}
}
extension
SearchBarController
{
fileprivate
extension
SearchBarController
{
/// Prepares the statusBar.
f
ileprivate
f
unc
prepareStatusBar
()
{
func
prepareStatusBar
()
{
shouldHideStatusBarOnRotation
=
false
}
/// Prepares the searchBar.
f
ileprivate
f
unc
prepareSearchBar
()
{
func
prepareSearchBar
()
{
searchBar
.
depthPreset
=
.
depth1
searchBar
.
zPosition
=
1000
view
.
addSubview
(
searchBar
)
...
...
Sources/iOS/TextField.swift
View file @
8caf7fb1
...
...
@@ -283,7 +283,7 @@ open class TextField: UITextField {
clearButtonMode
=
.
never
rightViewMode
=
.
whileEditing
rightView
=
clearIconButton
isClearIconButtonAutoHandled
=
isClearIconButtonAutoHandled
?
true
:
false
isClearIconButtonAutoHandled
=
{
isClearIconButtonAutoHandled
}()
layoutSubviews
()
}
...
...
@@ -330,7 +330,7 @@ open class TextField: UITextField {
clearButtonMode
=
.
never
rightViewMode
=
.
whileEditing
rightView
=
visibilityIconButton
isVisibilityIconButtonAutoHandled
=
isVisibilityIconButtonAutoHandled
?
true
:
false
isVisibilityIconButtonAutoHandled
=
{
isVisibilityIconButtonAutoHandled
}()
layoutSubviews
()
}
...
...
@@ -338,7 +338,7 @@ open class TextField: UITextField {
/// Enables the automatic handling of the visibilityIconButton.
@IBInspectable
open
var
isVisibilityIconButtonAutoHandled
:
Bool
=
true
{
open
var
isVisibilityIconButtonAutoHandled
=
true
{
didSet
{
visibilityIconButton
?
.
removeTarget
(
self
,
action
:
#selector(
handleVisibilityIconButton
)
,
for
:
.
touchUpInside
)
...
...
@@ -428,21 +428,21 @@ open class TextField: UITextField {
}
}
extension
TextField
{
fileprivate
extension
TextField
{
/// Prepares the divider.
f
ileprivate
f
unc
prepareDivider
()
{
func
prepareDivider
()
{
dividerColor
=
dividerNormalColor
}
/// Prepares the placeholderLabel.
f
ileprivate
f
unc
preparePlaceholderLabel
()
{
func
preparePlaceholderLabel
()
{
placeholderNormalColor
=
Color
.
darkText
.
others
placeholderLabel
.
backgroundColor
=
.
clear
addSubview
(
placeholderLabel
)
}
/// Prepares the detailLabel.
f
ileprivate
f
unc
prepareDetailLabel
()
{
func
prepareDetailLabel
()
{
detailLabel
.
font
=
RobotoFont
.
regular
(
with
:
12
)
detailLabel
.
numberOfLines
=
0
detailColor
=
Color
.
darkText
.
others
...
...
@@ -450,46 +450,46 @@ extension TextField {
}
/// Prepares the leftView.
f
ileprivate
f
unc
prepareLeftView
()
{
func
prepareLeftView
()
{
leftView
?
.
contentMode
=
.
left
leftViewMode
=
.
always
updateLeftViewColor
()
}
/// Prepares the target handlers.
f
ileprivate
f
unc
prepareTargetHandlers
()
{
func
prepareTargetHandlers
()
{
addTarget
(
self
,
action
:
#selector(
handleEditingDidBegin
)
,
for
:
.
editingDidBegin
)
addTarget
(
self
,
action
:
#selector(
handleEditingChanged
)
,
for
:
.
editingChanged
)
addTarget
(
self
,
action
:
#selector(
handleEditingDidEnd
)
,
for
:
.
editingDidEnd
)
}
/// Prepares the textAlignment.
f
ileprivate
f
unc
prepareTextAlignment
()
{
func
prepareTextAlignment
()
{
textAlignment
=
.
rightToLeft
==
Application
.
userInterfaceLayoutDirection
?
.
right
:
.
left
}
}
extension
TextField
{
fileprivate
extension
TextField
{
/// Updates the leftView tint color.
f
ileprivate
f
unc
updateLeftViewColor
()
{
func
updateLeftViewColor
()
{
leftView
?
.
tintColor
=
isEditing
?
leftViewActiveColor
:
leftViewNormalColor
}
/// Updates the placeholderLabel text color.
f
ileprivate
f
unc
updatePlaceholderLabelColor
()
{
func
updatePlaceholderLabelColor
()
{
tintColor
=
placeholderActiveColor
placeholderLabel
.
textColor
=
isEditing
?
placeholderActiveColor
:
placeholderNormalColor
}
/// Updates the detailLabel text color.
f
ileprivate
f
unc
updateDetailLabelColor
()
{
func
updateDetailLabelColor
()
{
detailLabel
.
textColor
=
detailColor
}
}
extension
TextField
{
fileprivate
extension
TextField
{
/// Layout the placeholderLabel.
f
ileprivate
f
unc
layoutPlaceholderLabel
()
{
func
layoutPlaceholderLabel
()
{
let
w
=
leftViewWidth
+
textInset
let
h
=
0
==
height
?
intrinsicContentSize
.
height
:
height
...
...
@@ -515,7 +515,7 @@ extension TextField {
}
/// Layout the detailLabel.
f
ileprivate
f
unc
layoutDetailLabel
()
{
func
layoutDetailLabel
()
{
let
c
=
dividerContentEdgeInsets
detailLabel
.
height
=
detailLabel
.
sizeThatFits
(
CGSize
(
width
:
width
,
height
:
.
greatestFiniteMagnitude
))
.
height
detailLabel
.
x
=
c
.
left
...
...
@@ -524,12 +524,12 @@ extension TextField {
}
/// Layout the a button.
f
ileprivate
f
unc
layoutButton
(
button
:
UIButton
?)
{
func
layoutButton
(
button
:
UIButton
?)
{
button
?
.
frame
=
CGRect
(
x
:
width
-
height
,
y
:
0
,
width
:
height
,
height
:
height
)
}
/// Layout the leftView.
f
ileprivate
f
unc
layoutLeftView
()
{
func
layoutLeftView
()
{
guard
let
v
=
leftView
else
{
return
}
...
...
@@ -540,10 +540,10 @@ extension TextField {
}
}
extension
TextField
{
fileprivate
extension
TextField
{
/// Handles the text editing did begin state.
@objc
f
ileprivate
f
unc
handleEditingDidBegin
()
{
func
handleEditingDidBegin
()
{
leftViewEditingBeginAnimation
()
placeholderEditingDidBeginAnimation
()
dividerEditingDidBeginAnimation
()
...
...
@@ -551,13 +551,13 @@ extension TextField {
// Live updates the textField text.
@objc
f
ileprivate
f
unc
handleEditingChanged
(
textField
:
UITextField
)
{
func
handleEditingChanged
(
textField
:
UITextField
)
{
(
delegate
as?
TextFieldDelegate
)?
.
textField
?(
textField
:
self
,
didChange
:
textField
.
text
)
}
/// Handles the text editing did end state.
@objc
f
ileprivate
f
unc
handleEditingDidEnd
()
{
func
handleEditingDidEnd
()
{
leftViewEditingEndAnimation
()
placeholderEditingDidEndAnimation
()
dividerEditingDidEndAnimation
()
...
...
@@ -565,7 +565,7 @@ extension TextField {
/// Handles the clearIconButton TouchUpInside event.
@objc
f
ileprivate
f
unc
handleClearIconButton
()
{
func
handleClearIconButton
()
{
guard
nil
==
delegate
?
.
textFieldShouldClear
||
true
==
delegate
?
.
textFieldShouldClear
?(
self
)
else
{
return
}
...
...
@@ -581,7 +581,7 @@ extension TextField {
/// Handles the visibilityIconButton TouchUpInside event.
@objc
f
ileprivate
f
unc
handleVisibilityIconButton
()
{
func
handleVisibilityIconButton
()
{
isSecureTextEntry
=
!
isSecureTextEntry
if
!
isSecureTextEntry
{
...
...
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