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
723ef9fa
Unverified
Commit
723ef9fa
authored
Jun 09, 2016
by
M. Porooshani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Returned to new way to handle menu show/hide functionality
parent
cb15b04c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
14 deletions
+22
-14
Examples/Programmatic/App/App/AppMenuController.swift
+16
-0
Examples/Programmatic/App/App/ItemViewController.swift
+4
-6
Examples/Programmatic/App/App/RecipesViewController.swift
+2
-8
No files found.
Examples/Programmatic/App/App/AppMenuController.swift
View file @
723ef9fa
...
@@ -98,6 +98,22 @@ class AppMenuController: MenuController {
...
@@ -98,6 +98,22 @@ class AppMenuController: MenuController {
}
}
}
}
/// Shows the menuView.
func
showMenu
()
{
menuView
.
animate
(
MaterialAnimation
.
animationGroup
([
MaterialAnimation
.
rotate
(
rotation
:
3
),
MaterialAnimation
.
translateY
(
0
)
]))
}
/// Hides the menuView.
func
hideMenu
()
{
menuView
.
animate
(
MaterialAnimation
.
animationGroup
([
MaterialAnimation
.
rotate
(
rotation
:
3
),
MaterialAnimation
.
translateY
(
150
)
]))
}
/// Prepares the menuView.
/// Prepares the menuView.
private
func
prepareMenuView
()
{
private
func
prepareMenuView
()
{
var
image
:
UIImage
?
=
MaterialIcon
.
cm
.
add
var
image
:
UIImage
?
=
MaterialIcon
.
cm
.
add
...
...
Examples/Programmatic/App/App/ItemViewController.swift
View file @
723ef9fa
...
@@ -77,17 +77,15 @@ class ItemViewController: UIViewController {
...
@@ -77,17 +77,15 @@ class ItemViewController: UIViewController {
sideNavigationController
?
.
enabled
=
false
sideNavigationController
?
.
enabled
=
false
// Stops the scrollView contentInsets from being automatically adjusted.
// Stops the scrollView contentInsets from being automatically adjusted.
automaticallyAdjustsScrollViewInsets
=
false
automaticallyAdjustsScrollViewInsets
=
false
(
menuController
as?
AppMenuController
)?
.
hideMenu
()
}
}
override
func
viewDidAppear
(
animated
:
Bool
)
{
override
func
viewWillDisappear
(
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
super
.
viewWillDisappear
(
animated
)
(
menuController
as?
AppMenuController
)?
.
showMenu
()
// Access the navigationItem.backButton here.
// navigationItem.backButton
}
}
override
func
viewWillLayoutSubviews
()
{
override
func
viewWillLayoutSubviews
()
{
super
.
viewWillLayoutSubviews
()
super
.
viewWillLayoutSubviews
()
scrollView
.
frame
=
view
.
bounds
scrollView
.
frame
=
view
.
bounds
...
...
Examples/Programmatic/App/App/RecipesViewController.swift
View file @
723ef9fa
...
@@ -73,10 +73,7 @@ class RecipesViewController: UIViewController {
...
@@ -73,10 +73,7 @@ class RecipesViewController: UIViewController {
override
func
viewDidAppear
(
animated
:
Bool
)
{
override
func
viewDidAppear
(
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
super
.
viewDidAppear
(
animated
)
// Show the menuView.
// Show the menuView.
menuController
?
.
menuView
.
animate
(
MaterialAnimation
.
animationGroup
([
MaterialAnimation
.
rotate
(
rotation
:
3
),
MaterialAnimation
.
translateY
(
0
)
]))
}
}
override
func
viewWillDisappear
(
animated
:
Bool
)
{
override
func
viewWillDisappear
(
animated
:
Bool
)
{
...
@@ -84,10 +81,7 @@ class RecipesViewController: UIViewController {
...
@@ -84,10 +81,7 @@ class RecipesViewController: UIViewController {
// Disable the SideNavigation.
// Disable the SideNavigation.
// Hide the menuView.
// Hide the menuView.
menuController
?
.
menuView
.
animate
(
MaterialAnimation
.
animationGroup
([
MaterialAnimation
.
rotate
(
rotation
:
3
),
MaterialAnimation
.
translateY
(
150
)
]))
}
}
...
...
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