motion-floating-action-button 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f10a7364a21e88507be36da30afc0a2ff0699e87
4
- data.tar.gz: 10d4dea6b3e04d68a6348fa00f5fcceae67079bc
3
+ metadata.gz: 36a201791e012cee17461f1c130c3fbc71bdd649
4
+ data.tar.gz: 32f1046c5cbd21d3ca57a5695d11b2aa05f2ec89
5
5
  SHA512:
6
- metadata.gz: 777f2821b5e6556a03cc3eeea6d983725e41ad6bdf90c06acf8f899fdfa52d89fafb7b75fdb7072e53fe53b398d278a82b23472a4dd46445286835989bd39687
7
- data.tar.gz: 3a89107ed2055aeb65d4ffcc5702c4da95939a4f67710e9bd516803c4907410c248bc57d437efa30a07c46ca5f31494e5c38be25371019da077611d329af9c95
6
+ metadata.gz: 5a81d2c38848d516b843faf2e93426f33976509050f754862cceaf251381d6040b4593eabed91e5594edd587e6ec5b41b99b56fb92117ef8ce890606421b9128
7
+ data.tar.gz: eb52bfe6557ca58130ea59cecc510ecaa47abaedd6c9d2355f079fb3ccb106c7fe5631b8373c93e4d0ccc674b74b29091e8d67f49d4f0e480e28047e4fbe07c3
data/README.md CHANGED
@@ -1,54 +1,27 @@
1
1
  Motion-Swipe for RubyMotion
2
2
  ====================
3
- ![alt tag](http://imgur.com/4bYw12e.gif)
3
+ ![alt tag](https://camo.githubusercontent.com/eb4b9d9cc51e30254b575cd5b388ad57d0a4bace/687474703a2f2f692e696d6775722e636f6d2f7968344d7743422e676966)
4
4
 
5
- Trying to add a Tinder-like swipe gem for RubyMotion. Not really production ready but useable. PRs for fixes, refactors and features accepted! This is also my first gem - advice/help is welcome.
5
+ Trying to add a Google inbox like floating button gem for RubyMotion. PRs for fixes, refactors and features accepted!
6
6
 
7
- This is a wrapper around Richard Kim's TinderSimpleSwipeCards written in obj-c. He does an excellent job detailing how it all works, so that you customize it easily. Some of that got erased when I was making this, so see his source: https://github.com/cwRichardKim/TinderSimpleSwipeCards
7
+ 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
8
8
 
9
- __create a draggable view background__
10
- ``` ruby
11
- @draggable = MotionSwipe.build({
12
- frame: CGRectMake(0, 0, self.view.frame.width, self.view.frame.height),
13
- delegate: self # Needed if you want to call method of a class with your button
14
- })
15
- ```
16
-
17
- __adjust the draggable view's height and width__
18
- ``` ruby
19
- @draggable.setCardWithHeight(@height, withWidth: width)
20
- ```
21
-
22
- __create a new draggable view, and add it to the draggable view background__
23
- ``` ruby
24
- new_card = @draggable.createDraggableView
25
- @draggable.addCard(new_card)
26
- ```
27
9
 
28
- __now just append views, buttons, or whatever to that draggable view__
29
- ``` ruby
30
- # you can assign an id to the card for identification
31
- new_card.cardId = card_id
32
- ```
10
+ __setup needed for storyboard file usage__
33
11
 
34
- __make sure to load the cards you added into the draggable view background__
35
- ``` ruby
36
- # this method returns the number of cards
37
- count = @draggable.loadCards()
38
- ```
12
+ 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!!!
39
13
 
40
- __methods are available to swipe cards left or right without a gesture__
14
+ __create a floating action button view__
41
15
  ``` ruby
42
- @draggable.swipeRight()
43
- @draggable.swipeLeft()
44
- ```
45
-
46
- __NSUserDefaults are used to track the current card, previously swiped card, and previous swipe direction__
47
- ```
48
- @defaults = NSUserDefaults.standardUserDefaults
49
- @defaults["cardCurrent"]
50
- @defaults["cardSwiped"]
51
- @defaults["cardSwipedDirection"]
52
- ```
16
+ @addButton = MotionFloatingActionButton.build({
17
+ floating_frame: CGRectMake(device.width*3/4, device.height/2, device.width*1/4, device.height/2),
18
+ normal_image: rmq.image.resource('icons/plus'), # or UIImage.imageNamed('plus')
19
+ pressed_image: rmq.image.resource('icons/plus-pressed'), # or UIImage.imageNamed('plus-pressed')
20
+ delegate: self # Needed if you want to call method of a class with your button
21
+ })
53
22
 
23
+ @addButton.imageArray = ["Facebook", "Twitter", "Google Plus", "Linked in"]
24
+ @addButton.labelArray = ["Facebook", "Twitter", "Google Plus", "Linked in"]
54
25
 
26
+ rmq.append(@addButton)
27
+ ```
@@ -4,15 +4,12 @@ module MotionFloatingActionButton
4
4
 
5
5
  def build(args)
6
6
 
7
- @float_frame = args[:float_frame] || CGRectMake(0, 0, device.width, device.height)
8
- # @normal = args[:normal]
9
-
10
- addButton = VCFloatingActionButton.alloc.initWithFrame(@float_frame, normalImage: UIImage.imageNamed('icon-29'), andPressedImage: UIImage.imageNamed('icon-29'), withScrollview: UITableView.new)
11
-
12
- # addButton = [[VCFloatingActionButton alloc]initWithFrame:floatFrame normalImage:[UIImage imageNamed:@"plus"] andPressedImage:[UIImage imageNamed:@"cross"] withScrollview:_dummyTable];
7
+ @floating_frame = args[:floating_frame] || CGRectMake(device.width*3/4, device.height/2, device.width*1/4, device.height/2)
8
+ @normal_image = args[:normal_image]
9
+ @pressed_image = args[:pressed_image]
13
10
 
11
+ addButton = VCFloatingActionButton.alloc.initWithFrame(@floating_frame, normalImage: @normal_image, andPressedImage: @pressed_image, withScrollview: UITableView.new)
14
12
 
15
13
  addButton
16
-
17
14
  end
18
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-floating-action-button
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Sutevski
@@ -11,7 +11,7 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2015-11-26 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: Easily create an interface with swipeable cards.
14
+ description: Easily create a floating action button interface.
15
15
  email: dameyawn@gmail.com
16
16
  executables: []
17
17
  extensions: []
@@ -20,6 +20,7 @@ files:
20
20
  - README.md
21
21
  - lib/motion-floating-action-button.rb
22
22
  - lib/motion-floating-action-button/motion-floating-action-button.rb
23
+ - resources/floatTableViewCell.xib
23
24
  - vendor/motion-floating-action-button/VCFloatingActionButton.h
24
25
  - vendor/motion-floating-action-button/VCFloatingActionButton.m
25
26
  - vendor/motion-floating-action-button/build-iPhoneSimulator/VCFloatingActionButton.m.o
@@ -28,7 +29,6 @@ files:
28
29
  - vendor/motion-floating-action-button/build-iPhoneSimulator/motion-floating-action-button.pch
29
30
  - vendor/motion-floating-action-button/floatTableViewCell.h
30
31
  - vendor/motion-floating-action-button/floatTableViewCell.m
31
- - vendor/motion-floating-action-button/floatTableViewCell.xib
32
32
  homepage: http://github.com/dam13n/motion-floating-action-button
33
33
  licenses:
34
34
  - MIT
@@ -38,6 +38,7 @@ rdoc_options: []
38
38
  require_paths:
39
39
  - lib
40
40
  - vendor
41
+ - resources
41
42
  required_ruby_version: !ruby/object:Gem::Requirement
42
43
  requirements:
43
44
  - - ">="
@@ -53,5 +54,5 @@ rubyforge_project:
53
54
  rubygems_version: 2.2.2
54
55
  signing_key:
55
56
  specification_version: 4
56
- summary: Rubymotion gem to use TinderSimpleSwipeCards
57
+ summary: Cool floating action button feature for RubyMotion iOS
57
58
  test_files: []