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
3bf5457b
Commit
3bf5457b
authored
Apr 13, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates to establish a clean environment
parent
b1c2ce77
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
25 additions
and
42 deletions
+25
-42
Examples/Programmatic/TextField/TextField.xcodeproj/project.pbxproj
+0
-6
Examples/Programmatic/TextField/TextField/ViewController.swift
+2
-6
Examples/Storyboards/TextField/TextField/ViewController.swift
+1
-1
Sources/iOS/MaterialButton.swift
+0
-1
Sources/iOS/MaterialCollectionViewCell.swift
+0
-1
Sources/iOS/MaterialTableViewCell.swift
+0
-1
Sources/iOS/MaterialTextView.swift
+0
-1
Sources/iOS/MaterialView.swift
+0
-1
Sources/iOS/SearchBar.swift
+7
-8
Sources/iOS/TextField.swift
+15
-15
Sources/iOS/TextView.swift
+0
-1
No files found.
Examples/Programmatic/TextField/TextField.xcodeproj/project.pbxproj
View file @
3bf5457b
...
...
@@ -11,8 +11,6 @@
966F57A31C226BAA009185B7
/* ViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
966F57A21C226BAA009185B7
/* ViewController.swift */
;
};
966F57A81C226BAA009185B7
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
966F57A71C226BAA009185B7
/* Assets.xcassets */
;
};
966F57AB1C226BAA009185B7
/* LaunchScreen.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
966F57A91C226BAA009185B7
/* LaunchScreen.storyboard */
;
};
96977E271CBE9CC4000BEFC4
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96977E261CBE9CC4000BEFC4
/* Material.framework */
;
};
96977E281CBE9CC4000BEFC4
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96977E261CBE9CC4000BEFC4
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
...
...
@@ -22,7 +20,6 @@
dstPath
=
""
;
dstSubfolderSpec
=
10
;
files
=
(
96977E281CBE9CC4000BEFC4
/* Material.framework in Embed Frameworks */
,
);
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
...
...
@@ -36,7 +33,6 @@
966F57A71C226BAA009185B7
/* Assets.xcassets */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
folder.assetcatalog
;
path
=
Assets.xcassets
;
sourceTree
=
"<group>"
;
};
966F57AA1C226BAA009185B7
/* Base */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file.storyboard
;
name
=
Base
;
path
=
Base.lproj/LaunchScreen.storyboard
;
sourceTree
=
"<group>"
;
};
966F57AC1C226BAA009185B7
/* Info.plist */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
96977E261CBE9CC4000BEFC4
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-bshwisidfobstlbomegqyybbrygh/Build/Products/Debug-iphonesimulator/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -44,7 +40,6 @@
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
96977E271CBE9CC4000BEFC4
/* Material.framework in Frameworks */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
@@ -54,7 +49,6 @@
966F57941C226BAA009185B7
=
{
isa
=
PBXGroup
;
children
=
(
96977E261CBE9CC4000BEFC4
/* Material.framework */
,
966F579F1C226BAA009185B7
/* TextField */
,
966F579E1C226BAA009185B7
/* Products */
,
);
...
...
Examples/Programmatic/TextField/TextField/ViewController.swift
View file @
3bf5457b
...
...
@@ -65,9 +65,9 @@ class ViewController: UIViewController, TextFieldDelegate {
let
w
:
CGFloat
=
300
let
x
:
CGFloat
=
(
MaterialDevice
.
width
-
w
)
/
2
let
textField
:
TextField
=
TextField
(
frame
:
CGRectMake
(
x
,
200
,
w
,
24
))
textField
.
delegate
=
self
textField
.
placeholder
=
"Email"
textField
.
delegate
=
self
/*
Used to display the error message, which is displayed when
the user presses the 'return' key.
...
...
@@ -76,10 +76,6 @@ class ViewController: UIViewController, TextFieldDelegate {
textField
.
detailLabel
!.
text
=
"Email is incorrect."
textField
.
detailLabel
!.
font
=
RobotoFont
.
regularWithSize
(
12
)
textField
.
detailLabelActiveColor
=
MaterialColor
.
red
.
accent3
textField
.
lineLayerThickness
=
3
textField
.
lineLayerActiveThickness
=
5
// textField.detailLabelAutoHideEnabled = false // Uncomment this line to have manual hiding.
view
.
addSubview
(
textField
)
...
...
Examples/Storyboards/TextField/TextField/ViewController.swift
View file @
3bf5457b
...
...
@@ -61,8 +61,8 @@ class ViewController: UIViewController, TextFieldDelegate {
/// Prepares the email TextField.
private
func
prepareEmailField
()
{
emailField
.
delegate
=
self
emailField
.
placeholder
=
"Email"
emailField
.
delegate
=
self
/*
Used to display the error message, which is displayed when
...
...
Sources/iOS/MaterialButton.swift
View file @
3bf5457b
...
...
@@ -339,7 +339,6 @@ public class MaterialButton : UIButton {
self
.
init
(
frame
:
CGRectNull
)
}
/// Overriding the layout callback for sublayers.
public
override
func
layoutSublayersOfLayer
(
layer
:
CALayer
)
{
super
.
layoutSublayersOfLayer
(
layer
)
if
self
.
layer
==
layer
{
...
...
Sources/iOS/MaterialCollectionViewCell.swift
View file @
3bf5457b
...
...
@@ -444,7 +444,6 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
self
.
init
(
frame
:
CGRectNull
)
}
/// Overriding the layout callback for sublayers.
public
override
func
layoutSublayersOfLayer
(
layer
:
CALayer
)
{
super
.
layoutSublayersOfLayer
(
layer
)
if
self
.
layer
==
layer
{
...
...
Sources/iOS/MaterialTableViewCell.swift
View file @
3bf5457b
...
...
@@ -295,7 +295,6 @@ public class MaterialTableViewCell : UITableViewCell {
prepareView
()
}
/// Overriding the layout callback for sublayers.
public
override
func
layoutSublayersOfLayer
(
layer
:
CALayer
)
{
super
.
layoutSublayersOfLayer
(
layer
)
if
self
.
layer
==
layer
{
...
...
Sources/iOS/MaterialTextView.swift
View file @
3bf5457b
...
...
@@ -303,7 +303,6 @@ public class MaterialTextView: UITextView {
removeNotificationHandlers
()
}
/// Overriding the layout callback for sublayers.
public
override
func
layoutSublayersOfLayer
(
layer
:
CALayer
)
{
super
.
layoutSublayersOfLayer
(
layer
)
if
self
.
layer
==
layer
{
...
...
Sources/iOS/MaterialView.swift
View file @
3bf5457b
...
...
@@ -386,7 +386,6 @@ public class MaterialView : UIView {
self
.
init
(
frame
:
CGRectNull
)
}
/// Overriding the layout callback for sublayers.
public
override
func
layoutSublayersOfLayer
(
layer
:
CALayer
)
{
super
.
layoutSublayersOfLayer
(
layer
)
if
self
.
layer
==
layer
{
...
...
Sources/iOS/SearchBar.swift
View file @
3bf5457b
...
...
@@ -95,17 +95,10 @@ public class SearchBar : StatusBarView {
if
willRenderView
{
contentView
.
grid
.
views
?
.
append
(
textField
)
contentView
.
grid
.
reloadLayout
()
reloadView
()
layoutClearButton
()
}
}
/// Reloads the view.
public
func
reloadView
()
{
/// Align the clearButton.
let
h
:
CGFloat
=
textField
.
frame
.
height
clearButton
.
frame
=
CGRectMake
(
textField
.
frame
.
width
-
h
,
0
,
h
,
h
)
}
/// Prepares the contentView.
public
override
func
prepareContentView
()
{
super
.
prepareContentView
()
...
...
@@ -146,4 +139,10 @@ public class SearchBar : StatusBarView {
textField
.
rightViewMode
=
.
WhileEditing
textField
.
rightView
=
clearButton
}
/// Layout the clearButton.
private
func
layoutClearButton
()
{
let
h
:
CGFloat
=
textField
.
frame
.
height
clearButton
.
frame
=
CGRectMake
(
textField
.
frame
.
width
-
h
,
0
,
h
,
h
)
}
}
Sources/iOS/TextField.swift
View file @
3bf5457b
...
...
@@ -358,9 +358,7 @@ public class TextField : UITextField {
*/
@IBInspectable
public
var
detailLabelAutoHideEnabled
:
Bool
=
true
/**
:name: detailLabelHidden
*/
/// A boolean that indicates to hide or not hide the detailLabel.
@IBInspectable
public
var
detailLabelHidden
:
Bool
=
true
{
didSet
{
if
detailLabelHidden
{
...
...
@@ -418,7 +416,11 @@ public class TextField : UITextField {
self
.
init
(
frame
:
CGRectNull
)
}
/// Overriding the layout callback for sublayers.
public
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
layoutClearButton
()
}
public
override
func
layoutSublayersOfLayer
(
layer
:
CALayer
)
{
super
.
layoutSublayersOfLayer
(
layer
)
if
self
.
layer
==
layer
{
...
...
@@ -489,34 +491,25 @@ public class TextField : UITextField {
when subclassing.
*/
public
func
prepareView
()
{
backgroundColor
=
MaterialColor
.
white
masksToBounds
=
false
font
=
RobotoFont
.
regularWithSize
(
16
)
backgroundColor
=
MaterialColor
.
white
textColor
=
MaterialColor
.
darkText
.
primary
borderStyle
=
.
None
font
=
RobotoFont
.
regularWithSize
(
16
)
prepareClearButton
()
prepareTitleLabel
()
prepareLineLayer
()
reloadView
()
addTarget
(
self
,
action
:
#selector(
textFieldDidBegin
)
,
forControlEvents
:
.
EditingDidBegin
)
addTarget
(
self
,
action
:
#selector(
textFieldDidChange
)
,
forControlEvents
:
.
EditingChanged
)
addTarget
(
self
,
action
:
#selector(
textFieldDidEnd
)
,
forControlEvents
:
.
EditingDidEnd
)
addTarget
(
self
,
action
:
#selector(
textFieldValueChanged
)
,
forControlEvents
:
.
ValueChanged
)
}
/// Reloads the view.
public
func
reloadView
()
{
// clearButton.frame = CGRectMake(width - height, 0, height, height)
}
/// Clears the textField text.
internal
func
handleClearButton
()
{
if
false
==
delegate
?
.
textFieldShouldClear
?(
self
)
{
return
}
text
=
""
sendActionsForControlEvents
(
.
ValueChanged
)
}
/// Ahdnler when text value changed.
...
...
@@ -624,6 +617,13 @@ public class TextField : UITextField {
rightView
=
clearButton
}
/// Layout the clearButton.
private
func
layoutClearButton
()
{
if
0
<
width
&&
0
<
height
{
clearButton
.
frame
=
CGRectMake
(
width
-
height
,
0
,
height
,
height
)
}
}
/// Shows and animates the titleLabel property.
private
func
showTitleLabel
()
{
if
titleLabel
.
hidden
{
...
...
Sources/iOS/TextView.swift
View file @
3bf5457b
...
...
@@ -145,7 +145,6 @@ public class TextView: MaterialView {
super
.
init
(
frame
:
CGRectNull
)
}
/// Overriding the layout callback for sublayers.
public
override
func
layoutSublayersOfLayer
(
layer
:
CALayer
)
{
super
.
layoutSublayersOfLayer
(
layer
)
if
self
.
layer
==
layer
{
...
...
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