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
bb852d76
Commit
bb852d76
authored
Feb 07, 2016
by
danieldahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed MenuView to MenuLayout
parent
fdf87ffa
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
30 additions
and
24 deletions
+30
-24
Examples/Material.xcworkspace/contents.xcworkspacedata
+2
-2
Examples/Programmatic/MenuLayout/MenuLayout.xcodeproj/project.pbxproj
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+1
-1
Examples/Programmatic/MenuLayout/MenuLayout/AppDelegate.swift
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Contents.json
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-29.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-29@2x-1.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-29@2x.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-29@3x.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-40.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-40@2x-1.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-40@2x.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-40@3x.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-60@2x.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-60@3x.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-76.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-76@2x.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/AppIcon.appiconset/Material-Icon-83.5@2x.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/Contents.json
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/ic_add_white.imageset/Contents.json
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/ic_add_white.imageset/ic_add_white.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/ic_add_white.imageset/ic_add_white_2x.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Assets.xcassets/ic_add_white.imageset/ic_add_white_3x.png
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Base.lproj/LaunchScreen.storyboard
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/Info.plist
+0
-0
Examples/Programmatic/MenuLayout/MenuLayout/ViewController.swift
+7
-6
Material.xcodeproj/project.pbxproj
+1
-1
Sources/CardView.swift
+1
-1
Sources/FabButton.swift
+2
-1
Sources/ImageCardView.swift
+1
-1
Sources/MenuLayout.swift
+12
-8
Sources/NavigationBarView.swift
+1
-1
Sources/RaisedButton.swift
+1
-1
Sources/SideNavigationViewController.swift
+1
-1
No files found.
Examples/Material.xcworkspace/contents.xcworkspacedata
View file @
bb852d76
...
...
@@ -58,9 +58,9 @@
</Group>
<Group
location =
"container:"
name =
"Menu
View
"
>
name =
"Menu
Layout
"
>
<FileRef
location =
"group:Programmatic/Menu
View/MenuView
.xcodeproj"
>
location =
"group:Programmatic/Menu
Layout/MenuLayout
.xcodeproj"
>
</FileRef>
</Group>
<Group
...
...
Examples/Programmatic/Menu
View/MenuView
.xcodeproj/project.pbxproj
→
Examples/Programmatic/Menu
Layout/MenuLayout
.xcodeproj/project.pbxproj
View file @
bb852d76
This diff is collapsed.
Click to expand it.
Examples/Programmatic/Menu
View/MenuView
.xcodeproj/project.xcworkspace/contents.xcworkspacedata
→
Examples/Programmatic/Menu
Layout/MenuLayout
.xcodeproj/project.xcworkspace/contents.xcworkspacedata
View file @
bb852d76
...
...
@@ -2,6 +2,6 @@
<Workspace
version =
"1.0"
>
<FileRef
location =
"self:Menu
View
.xcodeproj"
>
location =
"self:Menu
Layout
.xcodeproj"
>
</FileRef>
</Workspace>
Examples/Programmatic/Menu
View/MenuView
/AppDelegate.swift
→
Examples/Programmatic/Menu
Layout/MenuLayout
/AppDelegate.swift
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Contents.json
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Contents.json
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-29.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-29.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-29@2x-1.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-29@2x-1.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-29@2x.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-29@2x.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-29@3x.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-29@3x.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-40.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-40.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-40@2x-1.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-40@2x-1.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-40@2x.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-40@2x.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-40@3x.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-40@3x.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-60@2x.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-60@2x.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-60@3x.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-60@3x.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-76.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-76.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-76@2x.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-76@2x.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/AppIcon.appiconset/Material-Icon-83.5@2x.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/AppIcon.appiconset/Material-Icon-83.5@2x.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/Contents.json
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/Contents.json
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/ic_add_white.imageset/Contents.json
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/ic_add_white.imageset/Contents.json
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/ic_add_white.imageset/ic_add_white.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/ic_add_white.imageset/ic_add_white.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/ic_add_white.imageset/ic_add_white_2x.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/ic_add_white.imageset/ic_add_white_2x.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Assets.xcassets/ic_add_white.imageset/ic_add_white_3x.png
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Assets.xcassets/ic_add_white.imageset/ic_add_white_3x.png
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Base.lproj/LaunchScreen.storyboard
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Base.lproj/LaunchScreen.storyboard
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/Info.plist
→
Examples/Programmatic/Menu
Layout/MenuLayout
/Info.plist
View file @
bb852d76
File moved
Examples/Programmatic/Menu
View/MenuView
/ViewController.swift
→
Examples/Programmatic/Menu
Layout/MenuLayout
/ViewController.swift
View file @
bb852d76
...
...
@@ -59,6 +59,7 @@ class ViewController: UIViewController {
if
menuLayout
.
opened
{
menuLayout
.
close
()
}
else
{
// (menuLayout.items?.first?.button as? MaterialButton)?.animate(MaterialAnimation.rotate(1))
menuLayout
.
open
()
{
(
item
:
MenuLayoutItem
)
in
(
item
.
button
as?
MaterialButton
)?
.
pulse
()
}
...
...
@@ -78,36 +79,36 @@ class ViewController: UIViewController {
let
image
:
UIImage
?
=
UIImage
(
named
:
"ic_add_white"
)
let
btn1
:
FabButton
=
FabButton
()
btn1
.
depth
=
.
None
btn1
.
depth
=
.
Depth1
btn1
.
setImage
(
image
,
forState
:
.
Normal
)
btn1
.
setImage
(
image
,
forState
:
.
Highlighted
)
btn1
.
addTarget
(
self
,
action
:
"handleOpenMenuLayout"
,
forControlEvents
:
.
TouchUpInside
)
view
.
addSubview
(
btn1
)
let
btn2
:
FabButton
=
FabButton
()
btn2
.
depth
=
.
None
btn2
.
depth
=
.
Depth1
btn2
.
backgroundColor
=
MaterialColor
.
blue
.
base
btn2
.
setImage
(
image
,
forState
:
.
Normal
)
btn2
.
setImage
(
image
,
forState
:
.
Highlighted
)
view
.
addSubview
(
btn2
)
let
btn3
:
FabButton
=
FabButton
()
btn3
.
depth
=
.
None
btn3
.
depth
=
.
Depth1
btn3
.
backgroundColor
=
MaterialColor
.
green
.
base
btn3
.
setImage
(
image
,
forState
:
.
Normal
)
btn3
.
setImage
(
image
,
forState
:
.
Highlighted
)
view
.
addSubview
(
btn3
)
let
btn4
:
FabButton
=
FabButton
()
btn4
.
depth
=
.
None
btn4
.
depth
=
.
Depth1
btn4
.
backgroundColor
=
MaterialColor
.
yellow
.
base
btn4
.
setImage
(
image
,
forState
:
.
Normal
)
btn4
.
setImage
(
image
,
forState
:
.
Highlighted
)
view
.
addSubview
(
btn4
)
menuLayout
=
MenuLayout
()
menuLayout
.
baseSize
=
CGSizeMake
(
48
,
48
)
menuLayout
.
itemSize
=
CGSizeMake
(
36
,
36
)
menuLayout
.
baseSize
=
CGSizeMake
(
56
,
56
)
menuLayout
.
itemSize
=
CGSizeMake
(
48
,
48
)
menuLayout
.
items
=
[
MenuLayoutItem
(
button
:
btn1
),
...
...
Material.xcodeproj/project.pbxproj
View file @
bb852d76
...
...
@@ -391,9 +391,9 @@
96D88C541C132A7700B91418
/* Navigation */
=
{
isa
=
PBXGroup
;
children
=
(
65FDC2EA1C66858A00103AC2
/* MenuLayout.swift */
,
96D88C151C1328D800B91418
/* NavigationBarView.swift */
,
96D88C1D1C1328D800B91418
/* SideNavigationViewController.swift */
,
65FDC2EA1C66858A00103AC2
/* MenuLayout.swift */
,
);
name
=
Navigation
;
sourceTree
=
"<group>"
;
...
...
Sources/CardView.swift
View file @
bb852d76
...
...
@@ -407,7 +407,7 @@ public class CardView : MaterialPulseView {
public
override
func
prepareView
()
{
super
.
prepareView
()
pulseColor
=
MaterialColor
.
blueGrey
.
lighten4
depth
=
.
Depth
2
depth
=
.
Depth
1
dividerColor
=
MaterialColor
.
blueGrey
.
lighten5
}
...
...
Sources/FabButton.swift
View file @
bb852d76
...
...
@@ -41,7 +41,7 @@ public class FabButton : MaterialButton {
public
override
func
prepareView
()
{
super
.
prepareView
()
backgroundColor
=
MaterialColor
.
red
.
darken1
depth
=
.
Depth
2
depth
=
.
Depth
1
shape
=
.
Circle
}
}
\ No newline at end of file
Sources/ImageCardView.swift
View file @
bb852d76
...
...
@@ -544,7 +544,7 @@ public class ImageCardView : MaterialPulseView {
public
override
func
prepareView
()
{
super
.
prepareView
()
pulseColor
=
MaterialColor
.
blueGrey
.
lighten4
depth
=
.
Depth
2
depth
=
.
Depth
1
dividerColor
=
MaterialColor
.
blueGrey
.
lighten5
}
...
...
Sources/MenuLayout.swift
View file @
bb852d76
...
...
@@ -64,6 +64,9 @@ public class MenuLayout {
/// A Boolean that indicates if the menu is open or not.
public
private(set)
var
opened
:
Bool
=
false
/// Animation duration.
public
var
duration
:
Double
=
0.07
/// The position of the menu.
public
var
position
:
MenuLayoutPosition
=
.
BottomRight
{
didSet
{
...
...
@@ -90,6 +93,7 @@ public class MenuLayout {
}
public
func
reloadLayout
()
{
opened
=
false
switch
position
{
case
.
TopLeft
:
layoutTopLeft
()
...
...
@@ -137,7 +141,7 @@ public class MenuLayout {
}
let
item
:
MenuLayoutItem
=
v
[
i
]
item
.
button
.
hidden
=
false
UIView
.
animateWithDuration
(
Double
(
i
)
*
0.15
,
UIView
.
animateWithDuration
(
Double
(
i
)
*
duration
,
animations
:
{
[
unowned
self
]
in
item
.
button
.
alpha
=
1
item
.
button
.
frame
.
origin
.
y
=
base
!.
button
.
frame
.
origin
.
y
-
CGFloat
(
i
)
*
self
.
itemSize
.
height
-
CGFloat
(
i
)
*
16
...
...
@@ -154,7 +158,7 @@ public class MenuLayout {
if
let
v
:
Array
<
MenuLayoutItem
>
=
items
{
for
var
i
:
Int
=
1
,
l
:
Int
=
v
.
count
;
i
<
l
;
++
i
{
let
item
:
MenuLayoutItem
=
v
[
i
]
UIView
.
animateWithDuration
(
0.15
,
UIView
.
animateWithDuration
(
Double
(
i
)
*
duration
,
animations
:
{
[
unowned
self
]
in
item
.
button
.
alpha
=
0
item
.
button
.
frame
.
origin
.
y
=
self
.
height
-
item
.
button
.
bounds
.
height
-
16
...
...
@@ -177,7 +181,7 @@ public class MenuLayout {
}
let
item
:
MenuLayoutItem
=
v
[
i
]
item
.
button
.
hidden
=
false
UIView
.
animateWithDuration
(
Double
(
i
)
*
0.15
,
UIView
.
animateWithDuration
(
Double
(
i
)
*
duration
,
animations
:
{
[
unowned
self
]
in
item
.
button
.
alpha
=
1
item
.
button
.
frame
.
origin
.
y
=
base
!.
button
.
frame
.
origin
.
y
+
self
.
baseSize
.
height
+
CGFloat
(
i
-
1
)
*
self
.
itemSize
.
height
+
CGFloat
(
i
)
*
16
...
...
@@ -194,7 +198,7 @@ public class MenuLayout {
if
let
v
:
Array
<
MenuLayoutItem
>
=
items
{
for
var
i
:
Int
=
1
,
l
:
Int
=
v
.
count
;
i
<
l
;
++
i
{
let
item
:
MenuLayoutItem
=
v
[
i
]
UIView
.
animateWithDuration
(
0.15
,
UIView
.
animateWithDuration
(
Double
(
i
)
*
duration
,
animations
:
{
item
.
button
.
alpha
=
0
item
.
button
.
frame
.
origin
.
y
=
16
...
...
@@ -217,7 +221,7 @@ public class MenuLayout {
}
let
item
:
MenuLayoutItem
=
v
[
i
]
item
.
button
.
hidden
=
false
UIView
.
animateWithDuration
(
Double
(
i
)
*
0.15
,
UIView
.
animateWithDuration
(
Double
(
i
)
*
duration
,
animations
:
{
[
unowned
self
]
in
item
.
button
.
alpha
=
1
item
.
button
.
frame
.
origin
.
x
=
base
!.
button
.
frame
.
origin
.
x
-
CGFloat
(
i
)
*
self
.
itemSize
.
width
-
CGFloat
(
i
)
*
16
...
...
@@ -234,7 +238,7 @@ public class MenuLayout {
if
let
v
:
Array
<
MenuLayoutItem
>
=
items
{
for
var
i
:
Int
=
1
,
l
:
Int
=
v
.
count
;
i
<
l
;
++
i
{
let
item
:
MenuLayoutItem
=
v
[
i
]
UIView
.
animateWithDuration
(
0.15
,
UIView
.
animateWithDuration
(
Double
(
i
)
*
duration
,
animations
:
{
[
unowned
self
]
in
item
.
button
.
alpha
=
0
item
.
button
.
frame
.
origin
.
x
=
self
.
width
-
item
.
button
.
bounds
.
width
-
16
...
...
@@ -257,7 +261,7 @@ public class MenuLayout {
}
let
item
:
MenuLayoutItem
=
v
[
i
]
item
.
button
.
hidden
=
false
UIView
.
animateWithDuration
(
Double
(
i
)
*
0.15
,
UIView
.
animateWithDuration
(
Double
(
i
)
*
duration
,
animations
:
{
[
unowned
self
]
in
item
.
button
.
alpha
=
1
item
.
button
.
frame
.
origin
.
x
=
base
!.
button
.
frame
.
origin
.
x
+
self
.
baseSize
.
width
+
CGFloat
(
i
-
1
)
*
self
.
itemSize
.
width
+
CGFloat
(
i
)
*
16
...
...
@@ -274,7 +278,7 @@ public class MenuLayout {
if
let
v
:
Array
<
MenuLayoutItem
>
=
items
{
for
var
i
:
Int
=
1
,
l
:
Int
=
v
.
count
;
i
<
l
;
++
i
{
let
item
:
MenuLayoutItem
=
v
[
i
]
UIView
.
animateWithDuration
(
0.15
,
UIView
.
animateWithDuration
(
Double
(
i
)
*
duration
,
animations
:
{
item
.
button
.
alpha
=
0
item
.
button
.
frame
.
origin
.
x
=
16
...
...
Sources/NavigationBarView.swift
View file @
bb852d76
...
...
@@ -332,7 +332,7 @@ public class NavigationBarView : MaterialView {
*/
public
override
func
prepareView
()
{
super
.
prepareView
()
depth
=
.
Depth
2
depth
=
.
Depth
1
}
/**
...
...
Sources/RaisedButton.swift
View file @
bb852d76
...
...
@@ -42,7 +42,7 @@ public class RaisedButton : MaterialButton {
super
.
prepareView
()
setTitleColor
(
MaterialColor
.
white
,
forState
:
.
Normal
)
backgroundColor
=
MaterialColor
.
blue
.
accent3
depth
=
.
Depth
2
depth
=
.
Depth
1
cornerRadius
=
.
Radius1
contentInsetPreset
=
.
WideRectangle3
}
...
...
Sources/SideNavigationViewController.swift
View file @
bb852d76
...
...
@@ -234,7 +234,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
A MaterialDepth property that is used to set the depth of the
leftView when opened.
*/
public
var
depth
:
MaterialDepth
=
.
Depth
2
public
var
depth
:
MaterialDepth
=
.
Depth
1
/**
A MaterialView property that is used to hide and reveal the
...
...
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