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
4bbba637
Unverified
Commit
4bbba637
authored
Jun 25, 2018
by
Daniel Dahan
Committed by
GitHub
Jun 25, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'development' into extensions
parents
8577de35
ed33c435
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
135 deletions
+92
-135
Material.xcodeproj/project.pbxproj
+4
-7
Sources/iOS/FABMenu.swift
+88
-128
No files found.
Material.xcodeproj/project.pbxproj
View file @
4bbba637
...
...
@@ -8,8 +8,6 @@
/* Begin PBXBuildFile section */
961154CC1F32A7B100A78D74
/* ChipBar.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961154CB1F32A7B100A78D74
/* ChipBar.swift */
;
};
961409B11E43D15C00E7BA99
/* FABMenu.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96A183621E0C6CE200083C30
/* FABMenu.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
961409B21E43D15C00E7BA99
/* FABMenuController.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96A183641E0C6DD400083C30
/* FABMenuController.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
961527B91F3A509900E8B2AC
/* ChipBarController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961527B81F3A509900E8B2AC
/* ChipBarController.swift */
;
};
9617B07D1DFCA8CF00410F8F
/* Application.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961E6BDE1DDA2A95004E6C93
/* Application.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9617B07E1DFCA8CF00410F8F
/* Card.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB75D1CB40DC500C806FE
/* Card.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
...
@@ -115,8 +113,8 @@
9697F7C31D8F2572004741EC
/* DynamicFontType.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9628645E1D540AF300690B69
/* DynamicFontType.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9697F7CB1D8F2573004741EC
/* Snackbar.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963FBEFC1D669510008F8512
/* Snackbar.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9697F7CC1D8F2573004741EC
/* SnackbarController.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961EFC571D738FF600E84652
/* SnackbarController.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96
A183631E0C6CE200083C30
/* FABMenu.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96A183621E0C6CE200083C30
/* FABMenu
.swift */
;
};
96
A183651E0C6DD400083C30
/* FABMenuController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96A183641E0C6DD400083C30
/* FABMenuController
.swift */
;
};
96
B8D22C20CF82D2008BD149
/* FABMenuController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96A183641E0C6DD400083C30
/* FABMenuController
.swift */
;
};
96
B8D22D20CF82D5008BD149
/* FABMenu.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96A183621E0C6CE200083C30
/* FABMenu
.swift */
;
};
96BCB7F31CB40DE900C806FE
/* Roboto-Bold.ttf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7EE1CB40DE900C806FE
/* Roboto-Bold.ttf */
;
};
96BCB7F51CB40DE900C806FE
/* Roboto-Light.ttf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7EF1CB40DE900C806FE
/* Roboto-Light.ttf */
;
};
96BCB7F71CB40DE900C806FE
/* Roboto-Medium.ttf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7F01CB40DE900C806FE
/* Roboto-Medium.ttf */
;
};
...
...
@@ -848,8 +846,6 @@
96328B9B1E05C24E009A4C90
/* CollectionViewController.swift in Headers */
,
96328B9E1E05C24E009A4C90
/* TableView.swift in Headers */
,
96328B9F1E05C24E009A4C90
/* TableViewController.swift in Headers */
,
961409B11E43D15C00E7BA99
/* FABMenu.swift in Headers */
,
961409B21E43D15C00E7BA99
/* FABMenuController.swift in Headers */
,
96BFC16F1E63C10A0075DE1F
/* SpringAnimation.swift in Headers */
,
9685D5AF1F0F04CB00AFEB79
/* CardCollectionViewCell.swift in Headers */
,
9685D5B01F0F04CB00AFEB79
/* CardCollectionViewController.swift in Headers */
,
...
...
@@ -969,7 +965,6 @@
965E810A1DD4D5C800D61E4B
/* Font.swift in Sources */
,
965E810B1DD4D5C800D61E4B
/* RobotoFont.swift in Sources */
,
965E810C1DD4D5C800D61E4B
/* DynamicFontType.swift in Sources */
,
96A183651E0C6DD400083C30
/* FABMenuController.swift in Sources */
,
965E81101DD4D5C800D61E4B
/* NavigationBar.swift in Sources */
,
965E81111DD4D5C800D61E4B
/* NavigationController.swift in Sources */
,
965E81121DD4D5C800D61E4B
/* NavigationItem.swift in Sources */
,
...
...
@@ -990,6 +985,7 @@
965E81211DD4D5C800D61E4B
/* TextStorage.swift in Sources */
,
965E81221DD4D5C800D61E4B
/* TextView.swift in Sources */
,
965E80E71DD4C55200D61E4B
/* Material+UIView.swift in Sources */
,
96B8D22D20CF82D5008BD149
/* FABMenu.swift in Sources */
,
965E80E81DD4C55200D61E4B
/* Material+CALayer.swift in Sources */
,
965E80E91DD4C55200D61E4B
/* Material+String.swift in Sources */
,
9DE84D731FF0252600586C8B
/* BaseButtonGroup.swift in Sources */
,
...
...
@@ -1045,6 +1041,7 @@
965E80E01DD4C50600D61E4B
/* Shape.swift in Sources */
,
965E80E11DD4C50600D61E4B
/* Offset.swift in Sources */
,
965E80E21DD4C50600D61E4B
/* View.swift in Sources */
,
96B8D22C20CF82D2008BD149
/* FABMenuController.swift in Sources */
,
96328B7A1E020A41009A4C90
/* CollectionViewController.swift in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
...
...
Sources/iOS/FABMenu.swift
View file @
4bbba637
...
...
@@ -138,59 +138,59 @@ extension FABMenuItem {
}
@objc(FABMenuDelegate)
public
protocol
FABMenuDelegate
{
/**
A delegation method that is executed to determine whether fabMenu should open.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuShouldOpen
(
fabMenu
:
FABMenu
)
->
Bool
/**
A delegation method that is execited when the fabMenu will open.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuWillOpen
(
fabMenu
:
FABMenu
)
/**
A delegation method that is execited when the fabMenu did open.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuDidOpen
(
fabMenu
:
FABMenu
)
/**
A delegation method that is executed to determine whether fabMenu should close.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuShouldClose
(
fabMenu
:
FABMenu
)
->
Bool
/**
A delegation method that is execited when the fabMenu will close.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuWillClose
(
fabMenu
:
FABMenu
)
/**
A delegation method that is execited when the fabMenu did close.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuDidClose
(
fabMenu
:
FABMenu
)
/**
A delegation method that is executed when the user taps while
the menu is opened.
- Parameter fabMenu: A FABMenu.
- Parameter tappedAt point: A CGPoint.
- Parameter isOutside: A boolean indicating whether the tap
was outside the menu button area.
*/
@objc
optional
func
fabMenu
(
fabMenu
:
FABMenu
,
tappedAt
point
:
CGPoint
,
isOutside
:
Bool
)
public
protocol
FABMenuDelegate
{
/**
A delegation method that is executed to determine whether fabMenu should open.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuShouldOpen
(
fabMenu
:
FABMenu
)
->
Bool
/**
A delegation method that is execited when the fabMenu will open.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuWillOpen
(
fabMenu
:
FABMenu
)
/**
A delegation method that is execited when the fabMenu did open.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuDidOpen
(
fabMenu
:
FABMenu
)
/**
A delegation method that is executed to determine whether fabMenu should close.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuShouldClose
(
fabMenu
:
FABMenu
)
->
Bool
/**
A delegation method that is execited when the fabMenu will close.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuWillClose
(
fabMenu
:
FABMenu
)
/**
A delegation method that is execited when the fabMenu did close.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuDidClose
(
fabMenu
:
FABMenu
)
/**
A delegation method that is executed when the user taps while
the menu is opened.
- Parameter fabMenu: A FABMenu.
- Parameter tappedAt point: A CGPoint.
- Parameter isOutside: A boolean indicating whether the tap
was outside the menu button area.
*/
@objc
optional
func
fabMenu
(
fabMenu
:
FABMenu
,
tappedAt
point
:
CGPoint
,
isOutside
:
Bool
)
}
@objc(FABMenu)
...
...
@@ -372,50 +372,29 @@ extension FABMenu {
- Parameter completion: A completion block to execute on each view's animation.
*/
open
func
open
(
isTriggeredByUserInteraction
:
Bool
,
duration
:
TimeInterval
=
0.15
,
delay
:
TimeInterval
=
0
,
usingSpringWithDamping
:
CGFloat
=
0.5
,
initialSpringVelocity
:
CGFloat
=
0
,
options
:
UIViewAnimationOptions
=
[],
animations
:
((
UIView
)
->
Void
)?
=
nil
,
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
if
delegate
?
.
fabMenuShouldOpen
?(
fabMenu
:
self
)
==
false
{
return
}
handleOpenCallback
?()
if
isTriggeredByUserInteraction
{
delegate
?
.
fabMenuWillOpen
?(
fabMenu
:
self
)
}
}
/**
Open the Menu component with animation options.
- Parameter isTriggeredByUserInteraction: A boolean indicating whether the
state was changed by a user interaction, true if yes, false otherwise.
- Parameter duration: The time for each view's animation.
- Parameter delay: A delay time for each view's animation.
- Parameter usingSpringWithDamping: A damping ratio for the animation.
- Parameter initialSpringVelocity: The initial velocity for the animation.
- Parameter options: Options to pass to the 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.
*/
public
func
open
(
isTriggeredByUserInteraction
:
Bool
,
duration
:
TimeInterval
=
0.15
,
delay
:
TimeInterval
=
0
,
usingSpringWithDamping
:
CGFloat
=
0.5
,
initialSpringVelocity
:
CGFloat
=
0
,
options
:
UIViewAnimationOptions
=
[],
animations
:
((
UIView
)
->
Void
)?
=
nil
,
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
if
delegate
?
.
fabMenuShouldOpen
?(
fabMenu
:
self
)
==
false
{
return
}
handleOpenCallback
?()
if
isTriggeredByUserInteraction
{
delegate
?
.
fabMenuWillOpen
?(
fabMenu
:
self
)
}
spring
.
expand
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
)
{
[
weak
self
,
isTriggeredByUserInteraction
=
isTriggeredByUserInteraction
,
completion
=
completion
]
(
view
)
in
guard
let
`
self
`
=
self
else
{
return
}
(
view
as?
FABMenuItem
)?
.
showTitleLabel
()
if
isTriggeredByUserInteraction
&&
view
==
self
.
fabMenuItems
.
last
{
self
.
delegate
?
.
fabMenuDidOpen
?(
fabMenu
:
self
)
}
completion
?(
view
)
self
.
handleCompletionCallback
?(
view
)
}
spring
.
expand
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
)
{
[
weak
self
,
isTriggeredByUserInteraction
=
isTriggeredByUserInteraction
,
completion
=
completion
]
(
view
)
in
guard
let
`
self
`
=
self
else
{
return
}
(
view
as?
FABMenuItem
)?
.
showTitleLabel
()
if
isTriggeredByUserInteraction
&&
view
==
self
.
fabMenuItems
.
last
{
self
.
delegate
?
.
fabMenuDidOpen
?(
fabMenu
:
self
)
}
completion
?(
view
)
self
.
handleCompletionCallback
?(
view
)
}
}
...
...
@@ -446,49 +425,30 @@ extension FABMenu {
- Parameter completion: A completion block to execute on each view's animation.
*/
open
func
close
(
isTriggeredByUserInteraction
:
Bool
,
duration
:
TimeInterval
=
0.15
,
delay
:
TimeInterval
=
0
,
usingSpringWithDamping
:
CGFloat
=
0.5
,
initialSpringVelocity
:
CGFloat
=
0
,
options
:
UIViewAnimationOptions
=
[],
animations
:
((
UIView
)
->
Void
)?
=
nil
,
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
if
delegate
?
.
fabMenuShouldClose
?(
fabMenu
:
self
)
==
false
{
return
}
handleCloseCallback
?()
if
isTriggeredByUserInteraction
{
delegate
?
.
fabMenuWillClose
?(
fabMenu
:
self
)
}
/**
Close the Menu component with animation options.
- Parameter isTriggeredByUserInteraction: A boolean indicating whether the
state was changed by a user interaction, true if yes, false otherwise.
- Parameter duration: The time for each view's animation.
- Parameter delay: A delay time for each view's animation.
- Parameter usingSpringWithDamping: A damping ratio for the animation.
- Parameter initialSpringVelocity: The initial velocity for the animation.
- Parameter options: Options to pass to the 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.
*/
open
func
close
(
isTriggeredByUserInteraction
:
Bool
,
duration
:
TimeInterval
=
0.15
,
delay
:
TimeInterval
=
0
,
usingSpringWithDamping
:
CGFloat
=
0.5
,
initialSpringVelocity
:
CGFloat
=
0
,
options
:
UIViewAnimationOptions
=
[],
animations
:
((
UIView
)
->
Void
)?
=
nil
,
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
if
delegate
?
.
fabMenuShouldClose
?(
fabMenu
:
self
)
==
false
{
return
}
handleCloseCallback
?()
if
isTriggeredByUserInteraction
{
delegate
?
.
fabMenuWillClose
?(
fabMenu
:
self
)
}
spring
.
contract
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
)
{
[
weak
self
,
isTriggeredByUserInteraction
=
isTriggeredByUserInteraction
,
completion
=
completion
]
(
view
)
in
guard
let
`
self
`
=
self
else
{
return
}
(
view
as?
FABMenuItem
)?
.
hideTitleLabel
()
if
isTriggeredByUserInteraction
&&
view
==
self
.
fabMenuItems
.
last
{
self
.
delegate
?
.
fabMenuDidClose
?(
fabMenu
:
self
)
}
completion
?(
view
)
self
.
handleCompletionCallback
?(
view
)
}
spring
.
contract
(
duration
:
duration
,
delay
:
delay
,
usingSpringWithDamping
:
usingSpringWithDamping
,
initialSpringVelocity
:
initialSpringVelocity
,
options
:
options
,
animations
:
animations
)
{
[
weak
self
,
isTriggeredByUserInteraction
=
isTriggeredByUserInteraction
,
completion
=
completion
]
(
view
)
in
guard
let
`
self
`
=
self
else
{
return
}
(
view
as?
FABMenuItem
)?
.
hideTitleLabel
()
if
isTriggeredByUserInteraction
&&
view
==
self
.
fabMenuItems
.
last
{
self
.
delegate
?
.
fabMenuDidClose
?(
fabMenu
:
self
)
}
completion
?(
view
)
self
.
handleCompletionCallback
?(
view
)
}
}
}
...
...
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