yoavlt / liquidfloatingactionbutton Goto Github PK
View Code? Open in Web Editor NEWMaterial Design Floating Action Button in liquid state
License: MIT License
Material Design Floating Action Button in liquid state
License: MIT License
How can I get the swift2.0 version via cocoapods? Thank you!
Is possible extend from LiquidFloatingCell for add a UILabel to left of item?
I'm a novice iOS developer and still I do not understand how works the iOS views (I'm android developer)
Hi! This is an awesome component, thank you for creating it. I am trying to incorporate it in one of my apps and the taps are not being detected.
I modified the demo app and it worked beautifully, using the following code:
let rightBarButton:UIBarButtonItem = UIBarButtonItem()
rightBarButton.customView = floatingActionButton
self.navigationItem.rightBarButtonItem = rightBarButton
As I am targeting iOS 9.1 and Swift 2.0, I pulled the swift-2.0 branch and created a blank project with identical code. The menu shows up and expands, but the taps are not detected. If I just follow the addSubview
method to create a floating menu, it works fine.
Can you please confirm that taps from the menu embedded in Navigation Bar should work in swift-2.0 branch?
anyone know how to properly create two buttons and not have animation errors when one is tapped, then the other one is tapped?
am i creating them incorrectly?
`
func createButtons() {
let createButton: (CGRect, LiquidFloatingActionButtonAnimateStyle) -> LiquidFloatingActionButton = { (frame, style) in
let floatingActionButton = LiquidFloatingActionButton(frame: frame)
floatingActionButton.animateStyle = style
floatingActionButton.color = UIColor.whiteColor()
floatingActionButton.dataSource = self
floatingActionButton.delegate = self
return floatingActionButton
}
for var i=1; i<5; i++
{
let buttonFrame = CGRect(x: 0, y: i*50, width: 64, height: 64)
let button = createButton(buttonFrame, .Right)
self.view.addSubview(button)
}
let cellFactory: (String) -> LiquidFloatingCell = { (iconName) in
return LiquidFloatingCell(icon: UIImage(named: iconName)!)
}
cells.append(cellFactory("pencil2")) //edit
cells.append(cellFactory("pencil2")) //edit
cells.append(cellFactory("trash")) // edit
}`
Just thought it would be nice to be able to have a small line of text telling users what the button does inline with the LiquidFloatingCell.
I am going to have a go at implementing it but thought I'd put it here in case anyone else has something for it.
It seems like that I can only create two some buttons at one page for now. "same" here, I mean they have
the same icons in them
I would like to know when the floating action cell is tapped so that i can close it programmatically. However, adding a tap gesture recognizer to the floating cell 'breaks' it. In the sense that it wont open. Is this a know issue? is there a fix around it?
Hi,
See the attached video... I changed your Example code to use AutoLayout... doesn't work well with animations!
Animation Video --> http://cl.ly/151O3K0F3i03
Your Example code modified to worth with AutoLayout --> http://cl.ly/2N0T2t0s323g
After pod installation of LiquidFloatingButtonAction, I am getting "Method does not override any method from its superclass" error in my project multiple times. Can you please whats wrong with my project?
Hi
Im new in coding and can't figure out to add the action to the plus button it self to call a function. Can you please help ? :-)
Im trying this in ViewDidload
floatingActionButton.targetForAction(Selector("plusButton:"), withSender: self)
func plusButton() { print("button tapped") }
Hi, I put a floating button without children but when I click it I see the animation. I think the library should delegate button click and shouldn't call open() if no children buttons.
Really nice animation but I am wondering why is pretty laggy now, same problem for Demo? I'm using swift 2 in iOS 9.
Hi,
I've just integrated the lib in obj-c project;
all works fine, except :
can anyone help with this ?
Thanks,
Following error was encountered when updating pods:
$ pod install
Updating local specs repositories
Analyzing dependencies
[!] Unable to satisfy the following requirements:
LiquidFloatingActionButton (~> 0.1)
required by Podfile
Specs satisfying the LiquidFloatingActionButton (~> 0.1)
dependency were found, but they required a higher minimum deployment target.
Hello,
Great control by the way. I am trying to implement adding a blur and vibrancy effect to this control. I am able to get the blur to occur and the LiquidFloatingActionButton is indeed visible. The issue I am having is that although the floating buttons are visible they are not responding to touch events. I cannot close the control or choose any of the cells.
So far this is what I have done. I have subclasses LiquidFloatingActionButton and have override the open() function as follows.
...
override public func open() {
let window = UIApplication.sharedApplication().windows.first
var darkBlur = UIBlurEffect(style: UIBlurEffectStyle.Dark)
var blurView = UIVisualEffectView(effect: darkBlur)
blurView.frame = (window?.bounds)!
blurView.center = (window?.center)!
window?.addSubview(blurView)
let vibrancyEffect = UIVibrancyEffect(forBlurEffect: darkBlur)
let vibrancyView : UIVisualEffectView = UIVisualEffectView(effect: vibrancyEffect)
vibrancyView.addSubview(self)
blurView.contentView.addSubview(vibrancyView)
super.open()
}
...
Any thoughts on how this might be implemented? Any help to point me in the right direction or adding it to your roadmap would be great. Just not sure why it is no longer responding to touch events.
Thanks,
The following build commands failed:
CompileSwift normal arm64 XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:196:26: error: method does not override any method from its superclass
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:201:26: error: method does not override any method from its superclass
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:207:26: error: method does not override any method from its superclass
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:527:26: error: method does not override any method from its superclass
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:535:26: error: method does not override any method from its superclass
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:542:26: error: method does not override any method from its superclass
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:77:15: error: a non-failable initializer cannot chain to failable initializer 'init(coder:)' written with 'init?'
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:176:13: warning: variable 'paths' was never mutated; consider changing to 'let' constant
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:251:16: warning: value 'source' was defined but never used; consider replacing with boolean test
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:326:61: warning: use '#selector' instead of explicitly constructing a 'Selector'
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:325:13: warning: initialization of immutable value 'distance' was never used; consider replacing with assignment to '' or removing it
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:340:61: warning: use '#selector' instead of explicitly constructing a 'Selector'
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:338:13: warning: initialization of immutable value 'distance' was never used; consider replacing with assignment to '' or removing it
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:446:13: warning: initialization of variable 't2' was never used; consider replacing with assignment to '_' or removing it
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:520:35: warning: conditional cast from 'UIView' to 'UIView' always succeeds
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/SimpleCircleLiquidEngine.swift:121:22: warning: immutable value 'd1' was never used; consider replacing with '' or removing it
XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/SimpleCircleLiquidEngine.swift:122:22: warning: immutable value 'd2' was never used; consider replacing with '' or removing it
A shell task failed with exit code 65:
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64 XX/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
For these functions I'm getting error and error message is "LiquidFloatingActionButton.swift:201:26: Method does not override any method from its superclass"
// MARK: Events
public override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
self.touching = true
setNeedsDisplay()
}
public override func touchesEnded(touches: Set<NSObject>, withEvent event: UIEvent) {
self.touching = false
setNeedsDisplay()
didTapped()
}
public override func touchesCancelled(touches: Set<NSObject>!, withEvent event: UIEvent!) {
self.touching = false
setNeedsDisplay()
}
Hi,
So I added this pretty awesome floating button to my project, and have chose to display the cells to open to the left of the button (which is placed on the bottom right of my screen).
I noticed that, on an iPhone 4/5 screen, if I have more than 3 cells I lose them off the edge of the screen.
How can I accomodate or avoid this? I was hoping/thinking the cells would be either in a scroll view, or they would just form another row below/above the other cells..
This doesnt seem to be much of an active project any more, but if anybody could provide some help or insight it would be greatly appreciated.. thanks!
When trying to install via cocoapods, an error is produced:
Analyzing dependencies
[!] Unable to satisfy the following requirements:
- `LiquidFloatingActionButton` required by `Podfile`
Right now, the first cell always has a bigger space between it and the button, but I need the space to match the space between all of the other cells.
I basically need the same amount of space between all of the cells, and the first cell and the button.
So if all of the cells have 20px between them, I also need to have 20px of space between the button and the first cell.
So far I've been able to tweak the code to fit my needs but I can't seem to figure this one out.
Thanks for the help.
let floatingFrame = CGRect(x: self.view.frame.width - 56 - 16, y: self.view.frame.height - 100 - 16, width: 56, height: 56)
let bottomRightButton = createButton(floatingFrame, .Up)
that code didnt work with when rotating the screen to landscape
Any help?
public override func touchesBegan(touches: Set, withEvent event: UIEvent) {
self.touching = true
setNeedsDisplay()
}
swift:196:26: Method does not override any method from its superclass
Is there something has changed in swift? My Xcode Version 7.2.1 (7C1002).
Created new objective-c project (iOS 9.2, XCode 7.2).
Added as framework using cocoapods.
UIView added to storyboard, added auto layout constraints for bottom, trailing, width and aspect.
Implemented datasource and delegate protocol in view controller, set in viewWillAppear to the buttons properties.
Button displays fine, opens properly the cells.
But neither does it close again nor does it call the delegate whenever I click onto a cell.
Debugging shows the the hitTest is failing for the cells:
if (CGRectContainsPoint(cell.bounds, pointForTargetView)) is always FALSE.
Example values for a button on the lower right corner of an iPad screen:
pointForTargetView:
▿ CGPoint
cell.bounds:
▿ CGRect
▿ origin : CGPoint
- x : 0.0
- y : 0.0 { ... }
▿ size : CGSize
- width : 0.0 { ... }
- height : 0.0 { ... }
The cell returns an empty CGRect, thus the test will fail.
Was able to reproduce it multiple times with different simulators.
Any Ideas ?
Kind Regards,
Oggerschummer
Hi Guys,
Thanks for making such nice animations. I'm not saying this is an issue but curious to find animation in project, I could not find any other way to report about this other than creating new issue.
How can I add this animation on click? The animation which appears on click of plus button(in .gif files) and after this the floating buttons start appearing. Is it already in project? If yes how can I find it?
Regards,
Usman Mughal
Hey,
Im getting no less than 7 fatal errors and 7 warnings when trying to build after importing. Im using Objective C, and importing the swift file into my app - but thats not the problem. the problems are all within the Pod project itself - i get 7 "Method does not override any method from its superclass" - is there a fix? or did i just suck at importing? :-)
I am using this framework to create floating button in my project. I have a requirement to add a button image other than the plus sign in my project. Is it possible,I have tried many ways but failed. Please suggest some codes or ideas to do so? Thanks.
If I use Carthage to install LiquidFloatingActionButton.
There are some errors when build it.
LiquidFloatingActionButton.swift
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
/Carthage/Checkouts/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:196:26: error: method does not override any method from its superclass
Please, check this and fix please.
Thank you.
Swift 2.0 Support please
How can I make the button respect orientation changes if I created it programmatically and not via the storyboard? I don't see this being supported.
Thanks.
I wanna say thank you! This is great, I'm loving it and I appreciate your work. I was just looking through the code but couldn't find a way to change the speed when button is tapped, is there a way to do that?
How can I get the swift2.0 version via cocoa pods? Thank you!
I really love the animation. I just have one question. Does the current implementation support animating from top to bottom? In my use case, the button would be place on the top right of the screen.
The current button behavior is to show the child buttons/cells. But i need just the button, without cells. How can I wire an event or delegate to the button click / select, not the cells.
Thanks,
Alex.
How can I use this library with objective-c? thanks.
6 errors , 8 warnings on 0.1.2 which I thought was the swift 2.0 branch
for example the 3 overrides below are failing with the following message:
/Users/mark/xcode/X2/Pods/LiquidFloatingActionButton/Pod/Classes/LiquidFloatingActionButton.swift:542:26: Method does not override any method from its superclass
//////////////////////////
// MARK: Events
public override func touchesBegan(touches: Set, withEvent event: UIEvent) {
self.touching = true
setNeedsDisplay()
}
public override func touchesEnded(touches: Set<NSObject>, withEvent event: UIEvent) {
self.touching = false
setNeedsDisplay()
didTapped()
}
public override func touchesCancelled(touches: Set<NSObject>!, withEvent event: UIEvent!) {
self.touching = false
setNeedsDisplay()
}
I create a floating button like a pro... ;-)
CGRect floatingFrame = CGRectMake(self.view.frame.size.width - 84, self.view.frame.size.height - 84, 64, 64);
_floatingActionButton = [[LiquidFloatingActionButton alloc] initWithFrame: floatingFrame];
_floatingActionButton.enableShadow = false;
_floatingActionButton.color = ZG_COLOR_BLUE;
_floatingActionButton.dataSource = self;
_floatingActionButton.delegate = self;
[self.view addSubview:_floatingActionButton];
However, the "enableShadow" option does not propagate as it should.
If I manually edit "CircleLiquidBaseView" and change "var enableShadow = true" to "false", it works as expected...
How can I change the animation speed, without making changes in the lib code?
How to give a left or right side title to the buttons?
Thank you for making this. I am using this button kinda side menu. So, i would like to change initial "plus" icon to something more like "list" type icon or something custom i want. I attempted to do that but failed. At least if you can tell where it is initialised, i would try to change.
Hello,
I used the Swift 2.0 branch to check out this awesome library. I received warnings about some variables are not used. Is it possible if I can do some changes to the code and send it as a pull request?
Thank you! 😄
I am using objc and my podfile has :
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
use_frameworks!
target 'Test' do
pod 'LiquidFloatingActionButton'
end
target 'TestTests' do
end
target 'TestUITests' do
end
But not working :(
Thank you.
Is there a way to set the direction of the menu in objective-c ?
animateStyle
is not accessible from Objective-C code
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.