Motion-Swipe for RubyMotion
Trying to add a Google inbox like floating button gem for RubyMotion. PRs for fixes, refactors and features accepted!
This is a wrapper around gizmoboy7's VCFloatingActionButton written in obj-c. He does an excellent job detailing how it all works, so that you can customize it easily. So see his source: https://github.com/gizmoboy7/VCFloatingActionButton
setup needed for storyboard file usage
You need to move the .xib file resources into your app's resources folder. RubyMotion will compile this into a .nib file, and all should be well. If you know how to avoid having to do this step, please let us know!!!
create a floating action button view
@addButton = MotionFloatingActionButton.build({
floating_frame: CGRectMake(device.width*3/4, device.height/2, device.width*1/4, device.height/2),
normal_image: rmq.image.resource('icons/plus'), # or UIImage.imageNamed('plus')
pressed_image: rmq.image.resource('icons/plus-pressed'), # or UIImage.imageNamed('plus-pressed')
delegate: self # Needed if you want to call method of a class with your button
})
@addButton.imageArray = ["Facebook", "Twitter", "Google Plus", "Linked in"]
@addButton.labelArray = ["Facebook", "Twitter", "Google Plus", "Linked in"]
rmq.append(@addButton)