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 +4 -4
- data/README.md +16 -43
- data/lib/motion-floating-action-button/motion-floating-action-button.rb +4 -7
- data/{vendor/motion-floating-action-button → resources}/floatTableViewCell.xib +0 -0
- data/vendor/motion-floating-action-button/build-iPhoneSimulator/libmotion-floating-action-button.a +0 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36a201791e012cee17461f1c130c3fbc71bdd649
|
4
|
+
data.tar.gz: 32f1046c5cbd21d3ca57a5695d11b2aa05f2ec89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-

|
4
4
|
|
5
|
-
Trying to add a
|
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
|
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
|
-
|
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
|
-
|
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
|
-
|
14
|
+
__create a floating action button view__
|
41
15
|
``` ruby
|
42
|
-
@
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
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
|
-
@
|
8
|
-
|
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
|
File without changes
|
data/vendor/motion-floating-action-button/build-iPhoneSimulator/libmotion-floating-action-button.a
CHANGED
Binary file
|
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.
|
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
|
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:
|
57
|
+
summary: Cool floating action button feature for RubyMotion iOS
|
57
58
|
test_files: []
|