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
9dc1261d
Commit
9dc1261d
authored
Sep 05, 2017
by
Daniel Dahan
Committed by
GitHub
Sep 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #721 from whitepixelstudios/master
FABMenuItem: add support for labels on opposite side
parents
c3245ef5
cae21143
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
Sources/iOS/FABMenu.swift
+17
-4
Sources/iOS/PulseAnimation.swift
+1
-1
No files found.
Sources/iOS/FABMenu.swift
View file @
9dc1261d
...
...
@@ -75,6 +75,12 @@ open class FABMenuItem: View {
addSubview
(
titleLabel
)
}
}
open
var
titleLabelSide
:
labelSide
=
.
right
public
enum
labelSide
{
case
left
case
right
}
}
extension
FABMenuItem
{
...
...
@@ -86,7 +92,14 @@ extension FABMenuItem {
titleLabel
.
width
+=
1.5
*
interimSpace
titleLabel
.
height
+=
interimSpace
/
2
titleLabel
.
y
=
(
height
-
titleLabel
.
height
)
/
2
switch
(
titleLabelSide
)
{
case
.
left
:
titleLabel
.
x
=
-
titleLabel
.
width
-
interimSpace
case
.
right
:
titleLabel
.
x
=
frame
.
width
+
interimSpace
}
titleLabel
.
alpha
=
0
titleLabel
.
isHidden
=
false
...
...
@@ -211,8 +224,8 @@ open class FABMenu: View {
}
}
/// An
internal
handler for the FABButton.
internal
var
handleFABButtonCallback
:
((
UIButton
)
->
Void
)?
/// An
open
handler for the FABButton.
open
var
handleFABButtonCallback
:
((
UIButton
)
->
Void
)?
/// An internal handler for the open function.
internal
var
handleOpenCallback
:
(()
->
Void
)?
...
...
@@ -334,7 +347,7 @@ extension FABMenu {
- Parameter animations: An animation block to execute on each view's animation.
- Parameter completion: A completion block to execute on each view's animation.
*/
internal
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
)
{
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
)
{
handleOpenCallback
?()
if
isTriggeredByUserInteraction
{
...
...
@@ -383,7 +396,7 @@ extension FABMenu {
- Parameter animations: An animation block to execute on each view's animation.
- Parameter completion: A completion block to execute on each view's animation.
*/
internal
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
)
{
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
)
{
handleCloseCallback
?()
if
isTriggeredByUserInteraction
{
...
...
Sources/iOS/PulseAnimation.swift
View file @
9dc1261d
...
...
@@ -82,7 +82,7 @@ public struct Pulse {
- Parameter pulseView: An optional UIView.
- Parameter pulseLayer: An optional CALayer.
*/
internal
init
(
pulseView
:
UIView
?,
pulseLayer
:
CALayer
?)
{
public
init
(
pulseView
:
UIView
?,
pulseLayer
:
CALayer
?)
{
self
.
pulseView
=
pulseView
self
.
pulseLayer
=
pulseLayer
}
...
...
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