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
bfa2cd30
Commit
bfa2cd30
authored
Feb 07, 2016
by
danieldahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed MenuView for lighter-weighted MenuLayout approach
parent
1c8824e5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
78 deletions
+89
-78
Examples/Programmatic/MenuView/MenuView/ViewController.swift
+24
-15
Material.xcodeproj/project.pbxproj
+4
-4
Sources/MenuLayout.swift
+61
-59
No files found.
Examples/Programmatic/MenuView/MenuView/ViewController.swift
View file @
bfa2cd30
...
@@ -36,19 +36,19 @@ import UIKit
...
@@ -36,19 +36,19 @@ import UIKit
import
Material
import
Material
class
ViewController
:
UIViewController
{
class
ViewController
:
UIViewController
{
private
var
menuView
:
Menu
View
!
private
var
menuView
:
Menu
Layout
!
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
prepareView
()
prepareView
()
prepareMenu
View
Example
()
prepareMenu
Layout
Example
()
}
}
internal
func
handleOpenMenu
View
()
{
internal
func
handleOpenMenu
Layout
()
{
if
menuView
.
opened
{
if
menuView
.
opened
{
menuView
.
close
()
menuView
.
close
()
}
else
{
}
else
{
menuView
.
open
()
{
(
item
:
Menu
View
Item
)
in
menuView
.
open
()
{
(
item
:
Menu
Layout
Item
)
in
(
item
.
button
as?
MaterialButton
)?
.
pulse
()
(
item
.
button
as?
MaterialButton
)?
.
pulse
()
}
}
}
}
...
@@ -59,45 +59,54 @@ class ViewController: UIViewController {
...
@@ -59,45 +59,54 @@ class ViewController: UIViewController {
view
.
backgroundColor
=
MaterialColor
.
white
view
.
backgroundColor
=
MaterialColor
.
white
}
}
/// Prepares the MenuView example.
/// Prepares the MenuLayout example.
private
func
prepareMenuViewExample
()
{
private
func
prepareMenuLayoutExample
()
{
let
btn
:
FlatButton
=
FlatButton
(
frame
:
CGRectMake
(
100
,
100
,
100
,
100
))
btn
.
backgroundColor
=
MaterialColor
.
red
.
base
let
image
:
UIImage
?
=
UIImage
(
named
:
"ic_add_white"
)
let
image
:
UIImage
?
=
UIImage
(
named
:
"ic_add_white"
)
let
btn1
:
FabButton
=
FabButton
()
let
btn1
:
FabButton
=
FabButton
()
btn1
.
depth
=
.
None
btn1
.
depth
=
.
None
btn1
.
setImage
(
image
,
forState
:
.
Normal
)
btn1
.
setImage
(
image
,
forState
:
.
Normal
)
btn1
.
setImage
(
image
,
forState
:
.
Highlighted
)
btn1
.
setImage
(
image
,
forState
:
.
Highlighted
)
btn1
.
addTarget
(
self
,
action
:
"handleOpenMenuView"
,
forControlEvents
:
.
TouchUpInside
)
btn1
.
addTarget
(
self
,
action
:
"handleOpenMenuLayout"
,
forControlEvents
:
.
TouchUpInside
)
view
.
addSubview
(
btn1
)
let
btn2
:
FabButton
=
FabButton
()
let
btn2
:
FabButton
=
FabButton
()
btn2
.
depth
=
.
None
btn2
.
depth
=
.
None
btn2
.
backgroundColor
=
MaterialColor
.
blue
.
base
btn2
.
backgroundColor
=
MaterialColor
.
blue
.
base
btn2
.
setImage
(
image
,
forState
:
.
Normal
)
btn2
.
setImage
(
image
,
forState
:
.
Normal
)
btn2
.
setImage
(
image
,
forState
:
.
Highlighted
)
btn2
.
setImage
(
image
,
forState
:
.
Highlighted
)
view
.
addSubview
(
btn2
)
let
btn3
:
FabButton
=
FabButton
()
let
btn3
:
FabButton
=
FabButton
()
btn3
.
depth
=
.
None
btn3
.
depth
=
.
None
btn3
.
backgroundColor
=
MaterialColor
.
green
.
base
btn3
.
backgroundColor
=
MaterialColor
.
green
.
base
btn3
.
setImage
(
image
,
forState
:
.
Normal
)
btn3
.
setImage
(
image
,
forState
:
.
Normal
)
btn3
.
setImage
(
image
,
forState
:
.
Highlighted
)
btn3
.
setImage
(
image
,
forState
:
.
Highlighted
)
view
.
addSubview
(
btn3
)
let
btn4
:
FabButton
=
FabButton
()
let
btn4
:
FabButton
=
FabButton
()
btn4
.
depth
=
.
None
btn4
.
depth
=
.
None
btn4
.
backgroundColor
=
MaterialColor
.
yellow
.
base
btn4
.
backgroundColor
=
MaterialColor
.
yellow
.
base
btn4
.
setImage
(
image
,
forState
:
.
Normal
)
btn4
.
setImage
(
image
,
forState
:
.
Normal
)
btn4
.
setImage
(
image
,
forState
:
.
Highlighted
)
btn4
.
setImage
(
image
,
forState
:
.
Highlighted
)
view
.
addSubview
(
btn4
)
menuView
=
Menu
View
(
frame
:
view
.
bounds
)
menuView
=
Menu
Layout
(
)
// menuView.menuPosition = .BottomLef
t
menuView
.
menuPosition
=
.
TopRigh
t
// menuView.menuDirection = .Up
menuView
.
menuDirection
=
.
Left
menuView
.
baseSize
=
CGSizeMake
(
36
,
36
)
menuView
.
baseSize
=
CGSizeMake
(
36
,
36
)
menuView
.
itemSize
=
CGSizeMake
(
36
,
36
)
menuView
.
itemSize
=
CGSizeMake
(
36
,
36
)
view
.
addSubview
(
menuView
)
view
.
addSubview
(
btn
)
menuView
.
menuItems
=
[
menuView
.
menuItems
=
[
Menu
View
Item
(
button
:
btn1
),
Menu
Layout
Item
(
button
:
btn1
),
Menu
View
Item
(
button
:
btn2
),
Menu
Layout
Item
(
button
:
btn2
),
Menu
View
Item
(
button
:
btn3
),
Menu
Layout
Item
(
button
:
btn3
),
Menu
View
Item
(
button
:
btn4
)
Menu
Layout
Item
(
button
:
btn4
)
]
]
}
}
}
}
...
...
Material.xcodeproj/project.pbxproj
View file @
bfa2cd30
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
objects
=
{
objects
=
{
/* Begin PBXBuildFile section */
/* Begin PBXBuildFile section */
65FDC2EB1C66858A00103AC2
/* Menu
View.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
65FDC2EA1C66858A00103AC2
/* MenuView
.swift */
;
};
65FDC2EB1C66858A00103AC2
/* Menu
Layout.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
65FDC2EA1C66858A00103AC2
/* MenuLayout
.swift */
;
};
960B23271C383E5500E96216
/* Material+String.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23261C383E5500E96216
/* Material+String.swift */
;
};
960B23271C383E5500E96216
/* Material+String.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23261C383E5500E96216
/* Material+String.swift */
;
};
960B232E1C383EAA00E96216
/* Material+UIImage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23281C383EAA00E96216
/* Material+UIImage.swift */
;
};
960B232E1C383EAA00E96216
/* Material+UIImage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23281C383EAA00E96216
/* Material+UIImage.swift */
;
};
960B232F1C383EAA00E96216
/* Material+UIImage+Crop.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
;
};
960B232F1C383EAA00E96216
/* Material+UIImage+Crop.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
;
};
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
/* End PBXContainerItemProxy section */
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
/* Begin PBXFileReference section */
65FDC2EA1C66858A00103AC2
/* Menu
View.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MenuView
.swift
;
sourceTree
=
"<group>"
;
};
65FDC2EA1C66858A00103AC2
/* Menu
Layout.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MenuLayout
.swift
;
sourceTree
=
"<group>"
;
};
960B23261C383E5500E96216
/* Material+String.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+String.swift"
;
sourceTree
=
"<group>"
;
};
960B23261C383E5500E96216
/* Material+String.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+String.swift"
;
sourceTree
=
"<group>"
;
};
960B23281C383EAA00E96216
/* Material+UIImage.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage.swift"
;
sourceTree
=
"<group>"
;
};
960B23281C383EAA00E96216
/* Material+UIImage.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage.swift"
;
sourceTree
=
"<group>"
;
};
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+Crop.swift"
;
sourceTree
=
"<group>"
;
};
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+Crop.swift"
;
sourceTree
=
"<group>"
;
};
...
@@ -393,7 +393,7 @@
...
@@ -393,7 +393,7 @@
children
=
(
children
=
(
96D88C151C1328D800B91418
/* NavigationBarView.swift */
,
96D88C151C1328D800B91418
/* NavigationBarView.swift */
,
96D88C1D1C1328D800B91418
/* SideNavigationViewController.swift */
,
96D88C1D1C1328D800B91418
/* SideNavigationViewController.swift */
,
65FDC2EA1C66858A00103AC2
/* Menu
View
.swift */
,
65FDC2EA1C66858A00103AC2
/* Menu
Layout
.swift */
,
);
);
name
=
Navigation
;
name
=
Navigation
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -585,7 +585,7 @@
...
@@ -585,7 +585,7 @@
96D88C3E1C1328D800B91418
/* NavigationBarView.swift in Sources */
,
96D88C3E1C1328D800B91418
/* NavigationBarView.swift in Sources */
,
96D88C221C1328D800B91418
/* FabButton.swift in Sources */
,
96D88C221C1328D800B91418
/* FabButton.swift in Sources */
,
96D88C3F1C1328D800B91418
/* RaisedButton.swift in Sources */
,
96D88C3F1C1328D800B91418
/* RaisedButton.swift in Sources */
,
65FDC2EB1C66858A00103AC2
/* Menu
View
.swift in Sources */
,
65FDC2EB1C66858A00103AC2
/* Menu
Layout
.swift in Sources */
,
960B23311C383EAA00E96216
/* Material+UIImage+PhotoLibrary.swift in Sources */
,
960B23311C383EAA00E96216
/* Material+UIImage+PhotoLibrary.swift in Sources */
,
960B23321C383EAA00E96216
/* Material+UIImage+Resize.swift in Sources */
,
960B23321C383EAA00E96216
/* Material+UIImage+Resize.swift in Sources */
,
96D88C3C1C1328D800B91418
/* MaterialTransitionAnimation.swift in Sources */
,
96D88C3C1C1328D800B91418
/* MaterialTransitionAnimation.swift in Sources */
,
...
...
Sources/Menu
View
.swift
→
Sources/Menu
Layout
.swift
View file @
bfa2cd30
This diff is collapsed.
Click to expand it.
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