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
1c9f877d
Commit
1c9f877d
authored
Feb 02, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prepare for release 1.29.2
parent
877c3c37
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
66 additions
and
41 deletions
+66
-41
Examples/Material.xcworkspace/contents.xcworkspacedata
+1
-1
Examples/Programmatic/CaptureView/CaptureView/ViewController.swift
+1
-3
Examples/Programmatic/CardView/CardView/ViewController.swift
+2
-2
Examples/Programmatic/ImageCardView/ImageCardView/ViewController.swift
+2
-16
Examples/Programmatic/MaterialPulseView/MaterialPulseView/ViewController.swift
+1
-1
Examples/Programmatic/SideNavigationViewController/SideNavigationViewController.xcodeproj/project.pbxproj
+0
-6
Examples/Programmatic/SideNavigationViewController/SideNavigationViewController/LeftViewController.swift
+1
-0
Examples/Programmatic/SideNavigationViewController/SideNavigationViewController/RightViewController.swift
+5
-0
Material.xcodeproj/project.pbxproj
+6
-0
Sources/Material+UIImage+Color.swift
+43
-0
Sources/MaterialButton.swift
+1
-3
Sources/MaterialView.swift
+1
-3
Sources/TextField.swift
+1
-3
Sources/TextView.swift
+1
-3
No files found.
Examples/Material.xcworkspace/contents.xcworkspacedata
View file @
1c9f877d
...
...
@@ -2,7 +2,7 @@
<Workspace
version =
"1.0"
>
<FileRef
location =
"group:
/Users/danieldahan/Dropbox/CosmicMind/Technology/Repositories/Material
/Material.xcodeproj"
>
location =
"group:
..
/Material.xcodeproj"
>
</FileRef>
<Group
location =
"container:"
...
...
Examples/Programmatic/CaptureView/CaptureView/ViewController.swift
View file @
1c9f877d
...
...
@@ -112,9 +112,7 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
:name: captureViewDidUpdateRecordTimer
*/
func
captureViewDidUpdateRecordTimer
(
captureView
:
CaptureView
,
hours
:
Int
,
minutes
:
Int
,
seconds
:
Int
)
{
MaterialAnimation
.
animationDisabled
{
self
.
navigationBarView
.
titleLabel
!.
text
=
String
(
format
:
"%02i:%02i:%02i"
,
arguments
:
[
hours
,
minutes
,
seconds
])
}
navigationBarView
.
titleLabel
!.
text
=
String
(
format
:
"%02i:%02i:%02i"
,
arguments
:
[
hours
,
minutes
,
seconds
])
}
/**
...
...
Examples/Programmatic/CardView/CardView/ViewController.swift
View file @
1c9f877d
...
...
@@ -39,8 +39,8 @@ class ViewController: UIViewController {
// Examples of using CardView.
// Uncomment different examples and read
// the comments below.
//
prepareGeneralCardViewExample()
prepareCardViewWithoutPulseBackgroundImageExample
()
prepareGeneralCardViewExample
()
//
prepareCardViewWithoutPulseBackgroundImageExample()
// prepareCardViewWithAlteredAlignmentExample()
// prepareCardViewButtonBarExample()
}
...
...
Examples/Programmatic/ImageCardView/ImageCardView/ViewController.swift
View file @
1c9f877d
...
...
@@ -31,19 +31,6 @@
import
UIKit
import
Material
// helper method
public
extension
UIImage
{
class
func
imageWithColor
(
color
:
UIColor
,
size
:
CGSize
)
->
UIImage
{
let
rect
=
CGRectMake
(
0
,
0
,
size
.
width
,
size
.
height
)
UIGraphicsBeginImageContextWithOptions
(
size
,
false
,
0
)
color
.
setFill
()
UIRectFill
(
rect
)
let
image
:
UIImage
=
UIGraphicsGetImageFromCurrentImageContext
()
UIGraphicsEndImageContext
()
return
image
}
}
class
ViewController
:
UIViewController
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -52,8 +39,8 @@ class ViewController: UIViewController {
// Examples of using ImageCardView.
// Uncomment different examples and read
// the comments below.
//
prepareGeneralImageCardViewExample()
prepareImageCardViewWithoutDetailLabelAndDividerExample
()
prepareGeneralImageCardViewExample
()
//
prepareImageCardViewWithoutDetailLabelAndDividerExample()
}
/**
...
...
@@ -132,7 +119,6 @@ class ViewController: UIViewController {
titleLabel
.
textColor
=
MaterialColor
.
white
titleLabel
.
font
=
RobotoFont
.
regularWithSize
(
24
)
imageCardView
.
titleLabel
=
titleLabel
imageCardView
.
titleLabelInset
.
top
=
80
// Star button.
let
img1
:
UIImage
?
=
UIImage
(
named
:
"ic_star_grey_darken_2"
)
...
...
Examples/Programmatic/MaterialPulseView/MaterialPulseView/ViewController.swift
View file @
1c9f877d
...
...
@@ -65,7 +65,7 @@ class ViewController: UIViewController {
/// Prepares the MaterialPulseView animation example.
private
func
prepareMaterialPulseViewAnimationExample
()
{
let
pulseView
:
MaterialPulseView
=
MaterialPulseView
(
frame
:
CGRectMake
(
132
,
132
,
150
,
150
))
pulseView
.
image
=
UIImage
(
named
:
"
Focus
AppIcon"
)
pulseView
.
image
=
UIImage
(
named
:
"
GraphKit
AppIcon"
)
pulseView
.
shape
=
.
Square
pulseView
.
depth
=
.
Depth2
pulseView
.
cornerRadius
=
.
Radius3
...
...
Examples/Programmatic/SideNavigationViewController/SideNavigationViewController.xcodeproj/project.pbxproj
View file @
1c9f877d
...
...
@@ -13,8 +13,6 @@
9642FA251C1B50E700022BC6
/* LaunchScreen.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9642FA231C1B50E700022BC6
/* LaunchScreen.storyboard */
;
};
9642FA331C1B909700022BC6
/* LeftViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9642FA321C1B909700022BC6
/* LeftViewController.swift */
;
};
967585381C569AA9001E4268
/* RightViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
967585371C569AA9001E4268
/* RightViewController.swift */
;
};
96DBA7211C61103200844821
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96DBA7201C61103200844821
/* Material.framework */
;
};
96DBA7221C61103200844821
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96DBA7201C61103200844821
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
...
...
@@ -24,7 +22,6 @@
dstPath
=
""
;
dstSubfolderSpec
=
10
;
files
=
(
96DBA7221C61103200844821
/* Material.framework in Embed Frameworks */
,
);
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
...
...
@@ -40,7 +37,6 @@
9642FA261C1B50E700022BC6
/* Info.plist */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
9642FA321C1B909700022BC6
/* LeftViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
LeftViewController.swift
;
sourceTree
=
"<group>"
;
};
967585371C569AA9001E4268
/* RightViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
RightViewController.swift
;
sourceTree
=
"<group>"
;
};
96DBA7201C61103200844821
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -48,7 +44,6 @@
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
96DBA7211C61103200844821
/* Material.framework in Frameworks */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
@@ -58,7 +53,6 @@
9642FA0E1C1B50E700022BC6
=
{
isa
=
PBXGroup
;
children
=
(
96DBA7201C61103200844821
/* Material.framework */
,
9642FA191C1B50E700022BC6
/* SideNavigationViewController */
,
9642FA181C1B50E700022BC6
/* Products */
,
);
...
...
Examples/Programmatic/SideNavigationViewController/SideNavigationViewController/LeftViewController.swift
View file @
1c9f877d
...
...
@@ -153,6 +153,7 @@ extension LeftViewController: UITableViewDelegate {
return
64
}
/// Select item at row in tableView.
func
tableView
(
tableView
:
UITableView
,
didSelectRowAtIndexPath
indexPath
:
NSIndexPath
)
{
print
(
"Item selected"
)
}
...
...
Examples/Programmatic/SideNavigationViewController/SideNavigationViewController/RightViewController.swift
View file @
1c9f877d
...
...
@@ -125,4 +125,9 @@ extension RightViewController: UITableViewDelegate {
func
tableView
(
tableView
:
UITableView
,
heightForRowAtIndexPath
indexPath
:
NSIndexPath
)
->
CGFloat
{
return
64
}
/// Select item at row in tableView.
func
tableView
(
tableView
:
UITableView
,
didSelectRowAtIndexPath
indexPath
:
NSIndexPath
)
{
print
(
"Item selected"
)
}
}
Material.xcodeproj/project.pbxproj
View file @
1c9f877d
...
...
@@ -100,6 +100,7 @@
96D88C731C132ACC00B91418
/* MaterialAnimation.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D88BFF1C1328D800B91418
/* MaterialAnimation.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96D88C741C132ACC00B91418
/* MaterialBasicAnimation.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D88C001C1328D800B91418
/* MaterialBasicAnimation.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96D88C751C132AD500B91418
/* NavigationBarView.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D88C151C1328D800B91418
/* NavigationBarView.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96DBA7361C61198400844821
/* Material+UIImage+Color.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96DBA7351C61198400844821
/* Material+UIImage+Color.swift */
;
};
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
...
...
@@ -167,6 +168,7 @@
96D88C1B1C1328D800B91418
/* Roboto-Thin.ttf */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
path
=
"Roboto-Thin.ttf"
;
sourceTree
=
"<group>"
;
};
96D88C1C1C1328D800B91418
/* RobotoFont.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
RobotoFont.swift
;
sourceTree
=
"<group>"
;
};
96D88C1D1C1328D800B91418
/* SideNavigationViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
SideNavigationViewController.swift
;
sourceTree
=
"<group>"
;
};
96DBA7351C61198400844821
/* Material+UIImage+Color.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+Color.swift"
;
sourceTree
=
"<group>"
;
};
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -354,6 +356,7 @@
960B232B1C383EAA00E96216
/* Material+UIImage+PhotoLibrary.swift */
,
960B232C1C383EAA00E96216
/* Material+UIImage+Resize.swift */
,
960B232D1C383EAA00E96216
/* Material+UIImage+Size.swift */
,
96DBA7351C61198400844821
/* Material+UIImage+Color.swift */
,
);
name
=
Extensions
;
sourceTree
=
"<group>"
;
...
...
@@ -573,6 +576,7 @@
96D88C2F1C1328D800B91418
/* MaterialGravity.swift in Sources */
,
96D88C231C1328D800B91418
/* FlatButton.swift in Sources */
,
966F57B81C226D75009185B7
/* TextField.swift in Sources */
,
96DBA7361C61198400844821
/* Material+UIImage+Color.swift in Sources */
,
96D88C201C1328D800B91418
/* CapturePreviewView.swift in Sources */
,
96D88C3E1C1328D800B91418
/* NavigationBarView.swift in Sources */
,
96D88C221C1328D800B91418
/* FabButton.swift in Sources */
,
...
...
@@ -723,6 +727,7 @@
DYLIB_COMPATIBILITY_VERSION
=
1
;
DYLIB_CURRENT_VERSION
=
1
;
DYLIB_INSTALL_NAME_BASE
=
"@rpath"
;
FRAMEWORK_SEARCH_PATHS
=
""
;
INFOPLIST_FILE
=
Sources/Info.plist
;
INSTALL_PATH
=
"$(LOCAL_LIBRARY_DIR)/Frameworks"
;
IPHONEOS_DEPLOYMENT_TARGET
=
8.0
;
...
...
@@ -745,6 +750,7 @@
DYLIB_COMPATIBILITY_VERSION
=
1
;
DYLIB_CURRENT_VERSION
=
1
;
DYLIB_INSTALL_NAME_BASE
=
"@rpath"
;
FRAMEWORK_SEARCH_PATHS
=
""
;
INFOPLIST_FILE
=
Sources/Info.plist
;
INSTALL_PATH
=
"$(LOCAL_LIBRARY_DIR)/Frameworks"
;
IPHONEOS_DEPLOYMENT_TARGET
=
8.0
;
...
...
Sources/Material+UIImage+Color.swift
0 → 100644
View file @
1c9f877d
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import
UIKit
public
extension
UIImage
{
public
class
func
imageWithColor
(
color
:
UIColor
,
size
:
CGSize
)
->
UIImage
{
let
rect
=
CGRectMake
(
0
,
0
,
size
.
width
,
size
.
height
)
UIGraphicsBeginImageContextWithOptions
(
size
,
false
,
0
)
color
.
setFill
()
UIRectFill
(
rect
)
let
image
:
UIImage
=
UIGraphicsGetImageFromCurrentImageContext
()
UIGraphicsEndImageContext
()
return
image
}
}
Sources/MaterialButton.swift
View file @
1c9f877d
...
...
@@ -378,9 +378,7 @@ public class MaterialButton : UIButton {
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
MaterialAnimation
.
animationDisabled
{
[
unowned
self
]
in
self
.
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKey
:
b
.
keyPath
!
)
}
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKey
:
b
.
keyPath
!
)
}
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
...
...
Sources/MaterialView.swift
View file @
1c9f877d
...
...
@@ -385,9 +385,7 @@ public class MaterialView : UIView {
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
MaterialAnimation
.
animationDisabled
{
[
unowned
self
]
in
self
.
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKey
:
b
.
keyPath
!
)
}
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKey
:
b
.
keyPath
!
)
}
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
...
...
Sources/TextField.swift
View file @
1c9f877d
...
...
@@ -411,9 +411,7 @@ public class TextField : UITextField {
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
MaterialAnimation
.
animationDisabled
{
[
unowned
self
]
in
self
.
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKey
:
b
.
keyPath
!
)
}
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKey
:
b
.
keyPath
!
)
}
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
...
...
Sources/TextView.swift
View file @
1c9f877d
...
...
@@ -397,9 +397,7 @@ public class TextView: UITextView {
public
override
func
animationDidStop
(
anim
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
let
a
:
CAPropertyAnimation
=
anim
as?
CAPropertyAnimation
{
if
let
b
:
CABasicAnimation
=
a
as?
CABasicAnimation
{
MaterialAnimation
.
animationDisabled
{
[
unowned
self
]
in
self
.
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKey
:
b
.
keyPath
!
)
}
layer
.
setValue
(
nil
==
b
.
toValue
?
b
.
byValue
:
b
.
toValue
,
forKey
:
b
.
keyPath
!
)
}
(
delegate
as?
MaterialAnimationDelegate
)?
.
materialAnimationDidStop
?(
anim
,
finished
:
flag
)
layer
.
removeAnimationForKey
(
a
.
keyPath
!
)
...
...
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