Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

motion-floating-action-button

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

motion-floating-action-button

  • 0.0.4
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Motion-Swipe for RubyMotion

alt tag

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. We've included some of the fixes in the issues and pull requests from his repo and have made some customizations here too, so it is diverged and will likely stay that way. See his source: https://github.com/gizmoboy7/VCFloatingActionButton

We'd like to dedicate this gem to @andrewhavens, may he eschew iOS guidelines in the future.

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


# If you are not using a nav bar, you can ignore these values.
nav_bar_height = self.navigation_controller.navigationBar.frame.size.height
nav_bar = self.navigation_controller.navigationBar
scroll_view = UITableView.new  # haven't played with the scroll view option myself
    
@addButton = MotionFloatingActionButton.new(
      CGRectMake(device.width*3/4, device.height/2+nav_bar_height, device.width*1/4, device.height/2),
      normal_image: rmq.image.resource('icons/plus'),
      pressed_image: rmq.image.resource('icons/plus'),
      scroll_view: scroll_view, #optional
      navigation_bar: nav_bar, #optional
      delegate: self
    )

# Older way but should still work
@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
})  

@addButton.imageArray =  ["Facebook", "Twitter", "Google Plus", "Linked in"]
@addButton.labelArray = ["Facebook", "Twitter", "Google Plus", "Linked in"]

rmq.append(@addButton)

do something after a menu item is pressed

def didSelectMenuOptionAtIndex(index)
  puts index
end

FAQs

Package last updated on 27 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc