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
3724bbd3
Unverified
Commit
3724bbd3
authored
Jan 03, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: API updates to SpringMotion and FABMenu direction properties
parent
f1616f4e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
11 deletions
+20
-11
Sources/iOS/FABMenu.swift
+8
-8
Sources/iOS/FABMenuController.swift
+9
-0
Sources/iOS/SpringMotion.swift
+3
-3
No files found.
Sources/iOS/FABMenu.swift
View file @
3724bbd3
...
@@ -175,9 +175,9 @@ open class FABMenu: View {
...
@@ -175,9 +175,9 @@ open class FABMenu: View {
/// A reference to the SpringMotion object.
/// A reference to the SpringMotion object.
internal
let
spring
=
SpringMotion
()
internal
let
spring
=
SpringMotion
()
open
var
d
irection
:
FABMenuDirection
{
open
var
fabMenuD
irection
:
FABMenuDirection
{
get
{
get
{
switch
spring
.
d
irection
{
switch
spring
.
springD
irection
{
case
.
up
:
case
.
up
:
return
.
up
return
.
up
case
.
down
:
case
.
down
:
...
@@ -191,13 +191,13 @@ open class FABMenu: View {
...
@@ -191,13 +191,13 @@ open class FABMenu: View {
set
(
value
)
{
set
(
value
)
{
switch
value
{
switch
value
{
case
.
up
:
case
.
up
:
spring
.
d
irection
=
.
up
spring
.
springD
irection
=
.
up
case
.
down
:
case
.
down
:
spring
.
d
irection
=
.
down
spring
.
springD
irection
=
.
down
case
.
left
:
case
.
left
:
spring
.
d
irection
=
.
left
spring
.
springD
irection
=
.
left
case
.
right
:
case
.
right
:
spring
.
d
irection
=
.
right
spring
.
springD
irection
=
.
right
}
}
layoutSubviews
()
layoutSubviews
()
...
@@ -313,7 +313,7 @@ extension FABMenu {
...
@@ -313,7 +313,7 @@ extension FABMenu {
- Parameter animations: An animation block to execute on each view's animation.
- Parameter animations: An animation block to execute on each view's animation.
- Parameter completion: A completion block to execute on each view's animation.
- Parameter completion: A completion block to execute on each view's animation.
*/
*/
fileprivate
func
open
(
duration
:
TimeInterval
=
0.15
,
delay
:
TimeInterval
=
0
,
usingSpringWithDamping
:
CGFloat
=
0.5
,
initialSpringVelocity
:
CGFloat
=
0
,
options
:
UIViewAnimationOptions
=
[],
animations
:
((
UIView
)
->
Void
)?
=
nil
,
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
open
func
open
(
duration
:
TimeInterval
=
0.15
,
delay
:
TimeInterval
=
0
,
usingSpringWithDamping
:
CGFloat
=
0.5
,
initialSpringVelocity
:
CGFloat
=
0
,
options
:
UIViewAnimationOptions
=
[],
animations
:
((
UIView
)
->
Void
)?
=
nil
,
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
delegate
?
.
fabMenuWillOpen
?(
fabMenu
:
self
)
delegate
?
.
fabMenuWillOpen
?(
fabMenu
:
self
)
spring
.
expand
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
)
{
[
weak
self
,
completion
=
completion
]
(
view
)
in
spring
.
expand
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
)
{
[
weak
self
,
completion
=
completion
]
(
view
)
in
...
@@ -341,7 +341,7 @@ extension FABMenu {
...
@@ -341,7 +341,7 @@ extension FABMenu {
- Parameter animations: An animation block to execute on each view's animation.
- Parameter animations: An animation block to execute on each view's animation.
- Parameter completion: A completion block to execute on each view's animation.
- Parameter completion: A completion block to execute on each view's animation.
*/
*/
fileprivate
func
close
(
duration
:
TimeInterval
=
0.15
,
delay
:
TimeInterval
=
0
,
usingSpringWithDamping
:
CGFloat
=
0.5
,
initialSpringVelocity
:
CGFloat
=
0
,
options
:
UIViewAnimationOptions
=
[],
animations
:
((
UIView
)
->
Void
)?
=
nil
,
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
open
func
close
(
duration
:
TimeInterval
=
0.15
,
delay
:
TimeInterval
=
0
,
usingSpringWithDamping
:
CGFloat
=
0.5
,
initialSpringVelocity
:
CGFloat
=
0
,
options
:
UIViewAnimationOptions
=
[],
animations
:
((
UIView
)
->
Void
)?
=
nil
,
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
delegate
?
.
fabMenuWillClose
?(
fabMenu
:
self
)
delegate
?
.
fabMenuWillClose
?(
fabMenu
:
self
)
spring
.
contract
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
)
{
[
weak
self
,
completion
=
completion
]
(
view
)
in
spring
.
contract
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
)
{
[
weak
self
,
completion
=
completion
]
(
view
)
in
...
...
Sources/iOS/FABMenuController.swift
View file @
3724bbd3
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
import
UIKit
import
UIKit
public
enum
FABMenuBacking
{
public
enum
FABMenuBacking
{
case
none
case
fade
case
fade
case
blur
case
blur
}
}
...
@@ -130,6 +131,10 @@ extension FABMenuController {
...
@@ -130,6 +131,10 @@ extension FABMenuController {
/// Hides the blurView.
/// Hides the blurView.
fileprivate
func
hideBlurView
()
{
fileprivate
func
hideBlurView
()
{
guard
.
blur
==
fabMenuBacking
else
{
return
}
guard
fabMenu
.
isOpened
,
fabMenu
.
isEnabled
else
{
guard
fabMenu
.
isOpened
,
fabMenu
.
isEnabled
else
{
return
return
}
}
...
@@ -155,6 +160,10 @@ extension FABMenuController {
...
@@ -155,6 +160,10 @@ extension FABMenuController {
/// Hides the fade.
/// Hides the fade.
fileprivate
func
hideFade
()
{
fileprivate
func
hideFade
()
{
guard
.
fade
==
fabMenuBacking
else
{
return
}
guard
fabMenu
.
isOpened
,
fabMenu
.
isEnabled
else
{
guard
fabMenu
.
isOpened
,
fabMenu
.
isEnabled
else
{
return
return
}
}
...
...
Sources/iOS/SpringMotion.swift
View file @
3724bbd3
...
@@ -40,7 +40,7 @@ public enum SpringDirection: Int {
...
@@ -40,7 +40,7 @@ public enum SpringDirection: Int {
open
class
SpringMotion
{
open
class
SpringMotion
{
/// A SpringDirection value.
/// A SpringDirection value.
open
var
d
irection
=
SpringDirection
.
up
open
var
springD
irection
=
SpringDirection
.
up
/// A Boolean that indicates if the menu is open or not.
/// A Boolean that indicates if the menu is open or not.
open
var
isOpened
=
false
open
var
isOpened
=
false
...
@@ -140,7 +140,7 @@ extension SpringMotion {
...
@@ -140,7 +140,7 @@ extension SpringMotion {
disable
()
disable
()
switch
d
irection
{
switch
springD
irection
{
case
.
up
:
case
.
up
:
expandUp
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
,
completion
:
completion
)
expandUp
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
,
completion
:
completion
)
case
.
down
:
case
.
down
:
...
@@ -169,7 +169,7 @@ extension SpringMotion {
...
@@ -169,7 +169,7 @@ extension SpringMotion {
disable
()
disable
()
switch
d
irection
{
switch
springD
irection
{
case
.
up
:
case
.
up
:
contractUp
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
,
completion
:
completion
)
contractUp
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
,
completion
:
completion
)
case
.
down
:
case
.
down
:
...
...
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