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
Hide 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
...
...
@@ -97,6 +97,22 @@ class AppMenuController: MenuController {
openMenu
()
}
}
/// 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.
private
func
prepareMenuView
()
{
...
...
Examples/Programmatic/App/App/ItemViewController.swift
View file @
723ef9fa
...
...
@@ -77,16 +77,14 @@ class ItemViewController: UIViewController {
sideNavigationController
?
.
enabled
=
false
// Stops the scrollView contentInsets from being automatically adjusted.
automaticallyAdjustsScrollViewInsets
=
false
(
menuController
as?
AppMenuController
)?
.
hideMenu
()
}
override
func
viewDidAppear
(
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
// Access the navigationItem.backButton here.
// navigationItem.backButton
override
func
viewWillDisappear
(
animated
:
Bool
)
{
super
.
viewWillDisappear
(
animated
)
(
menuController
as?
AppMenuController
)?
.
showMenu
()
}
override
func
viewWillLayoutSubviews
()
{
super
.
viewWillLayoutSubviews
()
...
...
Examples/Programmatic/App/App/RecipesViewController.swift
View file @
723ef9fa
...
...
@@ -73,10 +73,7 @@ class RecipesViewController: UIViewController {
override
func
viewDidAppear
(
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
// Show the menuView.
menuController
?
.
menuView
.
animate
(
MaterialAnimation
.
animationGroup
([
MaterialAnimation
.
rotate
(
rotation
:
3
),
MaterialAnimation
.
translateY
(
0
)
]))
}
override
func
viewWillDisappear
(
animated
:
Bool
)
{
...
...
@@ -84,10 +81,7 @@ class RecipesViewController: UIViewController {
// Disable the SideNavigation.
// 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