motion-awesome 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/Gemfile +1 -1
- data/Gemfile.lock +35 -46
- data/README.md +16 -11
- data/Rakefile +6 -5
- data/app/app_delegate.rb +29 -22
- data/app/controllers/a.rb +7 -7
- data/app/controllers/b.rb +2 -2
- data/app/controllers/c.rb +3 -3
- data/app/controllers/d.rb +13 -13
- data/app/controllers/e.rb +21 -15
- data/app/controllers/z.rb +18 -18
- data/lib/assets/fontawesome-webfont.ttf +0 -0
- data/lib/assets/fontawesome-webfont.ttf.old +0 -0
- data/lib/assets/fontawesome.plist +563 -369
- data/lib/assets/fontawesome.plist.old +630 -0
- data/lib/motion-awesome.rb +6 -4
- data/lib/motion-awesome/awesome.rb +13 -13
- data/lib/motion-awesome/version.rb +2 -2
- data/lib/utils/generator.rb +9 -6
- data/motion-awesome.gemspec +5 -5
- metadata +23 -21
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YmRlNDMwMTIwNmVhZTRhMzQ5MDA4YmMwZmIxYzE1ZjA3MmMzYWI0NTk2ZjAx
|
10
|
-
YTNmYjZmNGI1ZDQyNDIxY2FhN2RiYmZiNTYzYjY0OGFlNjY4NDk1ZjA3MzUz
|
11
|
-
YmRmMjA3ODQxMWNhNDA3YTA2NWEyMzg2ZTkyOTI1MDI4NGZlZTg=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MGRhNGFhODUyNzNhYWFlMjJlYmU4NjllNjNkODdiNTBhODQ5ZjRmNWYxOTVj
|
14
|
-
MzcxNWQ5YjU1NmM1YzJiNzdkOTM1ZDBkMTA0NjJlNDRkZmM5MzE0NjBmNTQy
|
15
|
-
NTg5OWEyNmJlOTA5NzkyNWQ2Y2Y4YTY1NTIxM2E5YmM5NTc1OTE=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5fb141e48bfe6efe35a8e9a2e4f27bd1327aae41
|
4
|
+
data.tar.gz: dc90aa49bf4970a90d256962e38e6a4e5eb58627
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6b41ea7c0a2c1369b90a12f2e0fa9f066cb9db81ac9e0a069a9fe4fe16dabd68e8fe1a4740542b88c20fad456a9a90615f4d9f46af4b4ad16c5cc6c94fc444c9
|
7
|
+
data.tar.gz: 0827e4c312ee44d624933712a3438cca34604597f94823fa693c9d929470175aaf30ccc992e160c4bbf5cc50d4c2e79cab4fa0e5490e4b70e9579f177e5aaa7e
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,61 +1,50 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activesupport (3.2.
|
5
|
-
i18n (
|
4
|
+
activesupport (3.2.15)
|
5
|
+
i18n (~> 0.6, >= 0.6.4)
|
6
6
|
multi_json (~> 1.0)
|
7
|
-
addressable (2.3.
|
8
|
-
bubble-wrap (1.
|
9
|
-
claide (0.
|
10
|
-
cocoapods (0.
|
11
|
-
activesupport (
|
12
|
-
claide (~> 0.
|
13
|
-
cocoapods-core (= 0.
|
14
|
-
cocoapods-downloader (~> 0.
|
7
|
+
addressable (2.3.5)
|
8
|
+
bubble-wrap (1.4.0)
|
9
|
+
claide (0.4.0)
|
10
|
+
cocoapods (0.28.0)
|
11
|
+
activesupport (>= 3.2.15, < 4)
|
12
|
+
claide (~> 0.4.0)
|
13
|
+
cocoapods-core (= 0.28.0)
|
14
|
+
cocoapods-downloader (~> 0.2.0)
|
15
15
|
colored (~> 1.2)
|
16
16
|
escape (~> 0.0.4)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
cocoapods-downloader (0.1.1)
|
17
|
+
json_pure (~> 1.8)
|
18
|
+
open4 (~> 1.3)
|
19
|
+
xcodeproj (~> 0.14.1)
|
20
|
+
cocoapods-core (0.28.0)
|
21
|
+
activesupport (>= 3.2.15, < 4)
|
22
|
+
fuzzy_match (~> 2.0.4)
|
23
|
+
json (~> 1.8)
|
24
|
+
nap (~> 0.5)
|
25
|
+
cocoapods-downloader (0.2.0)
|
27
26
|
colored (1.2)
|
28
|
-
css_parser (1.3.
|
27
|
+
css_parser (1.3.5)
|
29
28
|
addressable
|
30
29
|
escape (0.0.4)
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
motion-
|
39
|
-
|
40
|
-
|
41
|
-
motion-stump (0.2.1)
|
42
|
-
multi_json (1.7.3)
|
43
|
-
multipart-post (1.2.0)
|
44
|
-
netrc (0.7.7)
|
45
|
-
octokit (1.24.0)
|
46
|
-
addressable (~> 2.2)
|
47
|
-
faraday (~> 0.8)
|
48
|
-
faraday_middleware (~> 0.9)
|
49
|
-
hashie (~> 2.0)
|
50
|
-
multi_json (~> 1.3)
|
51
|
-
netrc (~> 0.7.7)
|
30
|
+
fuzzy_match (2.0.4)
|
31
|
+
i18n (0.6.5)
|
32
|
+
json (1.8.1)
|
33
|
+
json_pure (1.8.1)
|
34
|
+
motion-cocoapods (1.4.0)
|
35
|
+
cocoapods (>= 0.26.2)
|
36
|
+
motion-map (0.0.4)
|
37
|
+
motion-stump (0.3.0)
|
38
|
+
multi_json (1.8.2)
|
39
|
+
nap (0.5.1)
|
52
40
|
open4 (1.3.0)
|
53
41
|
plist (3.1.0)
|
54
|
-
rake (10.0
|
42
|
+
rake (10.1.0)
|
55
43
|
sugarcube (0.20.21)
|
56
|
-
xcodeproj (0.
|
57
|
-
activesupport (~> 3.
|
44
|
+
xcodeproj (0.14.1)
|
45
|
+
activesupport (~> 3.0)
|
58
46
|
colored (~> 1.2)
|
47
|
+
rake
|
59
48
|
|
60
49
|
PLATFORMS
|
61
50
|
ruby
|
@@ -67,4 +56,4 @@ DEPENDENCIES
|
|
67
56
|
motion-map
|
68
57
|
motion-stump
|
69
58
|
plist
|
70
|
-
sugarcube
|
59
|
+
sugarcube (= 0.20.21)
|
data/README.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
![MotionAwesome Screenshots](http://derailed.github.io/motion-awesome/assets/d.png)
|
4
4
|
|
5
|
-
FontAwesome (http://fortawesome.github.io/Font-Awesome) is a really cool way to bring in some
|
6
|
-
low cost bang! to your web applications.
|
5
|
+
FontAwesome (http://fortawesome.github.io/Font-Awesome) is a really cool way to bring in some
|
6
|
+
low cost bang! to your web applications.
|
7
7
|
Following on that lead, MotionAwesome brings similar awesomeness in the RubyMotion world...
|
8
|
-
|
9
|
-
|
8
|
+
|
9
|
+
|
10
10
|
## For the star-gizzards ;-)
|
11
11
|
|
12
12
|
```
|
@@ -27,8 +27,9 @@ gem install motion-awesome
|
|
27
27
|
|
28
28
|
## Issues? Try this!
|
29
29
|
|
30
|
-
If you are adding motion-awesome to an existing project,
|
31
|
-
RubyMotion where the added font file
|
30
|
+
If you are adding motion-awesome to an existing project,
|
31
|
+
you may run into a common issue with RubyMotion where the added font file
|
32
|
+
is not copied from the resources.
|
32
33
|
To fix this simply run a `rake clean` and then try again.
|
33
34
|
|
34
35
|
## Usage
|
@@ -38,7 +39,7 @@ To fix this simply run a `rake clean` and then try again.
|
|
38
39
|
```ruby
|
39
40
|
class WannaBeCoolController < XXXController
|
40
41
|
include MotionAwesome
|
41
|
-
|
42
|
+
|
42
43
|
def viewDidLoad
|
43
44
|
label( :flag, size: 200 ) do |label|
|
44
45
|
self.view.addSubview(label)
|
@@ -50,7 +51,7 @@ end
|
|
50
51
|
### Creating awesome buttons
|
51
52
|
|
52
53
|
```ruby
|
53
|
-
class WannaBeCoolController < XXXController
|
54
|
+
class WannaBeCoolController < XXXController
|
54
55
|
def viewDidLoad
|
55
56
|
MotionAwesome.button( :legal, size: 40, text:%q{Hit me!} ) do |button|
|
56
57
|
button.titleLabel.textColor = 0xFB3223.uicolor
|
@@ -59,6 +60,7 @@ class WannaBeCoolController < XXXController
|
|
59
60
|
action: "cb:",
|
60
61
|
forControlEvents: UIControlEventTouchUpInside )
|
61
62
|
self.view.addSubview( button )
|
63
|
+
end
|
62
64
|
end
|
63
65
|
end
|
64
66
|
```
|
@@ -81,20 +83,20 @@ icon-star-empty => :star_empty
|
|
81
83
|
|
82
84
|
### Options
|
83
85
|
|
84
|
-
Awesomization is currently in effect for UILabel and UIButton.
|
86
|
+
Awesomization is currently in effect for UILabel and UIButton.
|
85
87
|
|
86
88
|
The method signatures following this strategy:
|
87
89
|
|
88
90
|
```ruby
|
89
91
|
awesome_label = label( :icon_name, opts ) do {|comp| ... }
|
90
|
-
awesome_button = button( :icon_name, opts ) do {|comp| ... }
|
92
|
+
awesome_button = button( :icon_name, opts ) do {|comp| ... }
|
91
93
|
```
|
92
94
|
|
93
95
|
Options are as follows:
|
94
96
|
|
95
97
|
+ size: specifies the size of the icon. To size the text portion you can set the font of your liking.
|
96
98
|
If no size is specified the icon will be sized according to the active font size.
|
97
|
-
+ type: :custom | :rounded. Specifies the type of UIButton to create -- For button only! -
|
99
|
+
+ type: :custom | :rounded. Specifies the type of UIButton to create -- For button only! -
|
98
100
|
+ text: prepends some text to your decorated label or button.
|
99
101
|
+ color: sets the icon color. If this is not set the icon color will match the text color if specified.
|
100
102
|
|
@@ -133,3 +135,6 @@ MotionAwesome is released under the [MIT](http://opensource.org/licenses/MIT) li
|
|
133
135
|
+ 0.0.5:
|
134
136
|
+ Upgrade to RM 2.0
|
135
137
|
+ Upgrade to FontAwesome 3.1.1 - 302 icons. Yeah!
|
138
|
+
+ 0.0.6:
|
139
|
+
+ Upgrade to RM 2.16
|
140
|
+
+ Upgrade to FontAwesome 4.0.3
|
data/Rakefile
CHANGED
@@ -9,12 +9,12 @@ Bundler::GemHelper.install_tasks
|
|
9
9
|
|
10
10
|
Motion::Project::App.setup do |app|
|
11
11
|
app.name = 'Awesome!'
|
12
|
-
|
12
|
+
|
13
13
|
app.development do
|
14
14
|
app.codesign_certificate = ENV['dev_bs_certificate']
|
15
15
|
app.provisioning_profile = ENV['dev_bs_profile']
|
16
|
-
end
|
17
|
-
|
16
|
+
end
|
17
|
+
|
18
18
|
app.pods do
|
19
19
|
pod 'WCAlertView'
|
20
20
|
end
|
@@ -24,6 +24,7 @@ namespace :gen do
|
|
24
24
|
desc 'Generates plist from css'
|
25
25
|
task :plist do
|
26
26
|
require File.expand_path('../lib/utils/generator.rb', __FILE__)
|
27
|
-
MotionAwesome::Generator.gen_plist( File.join( File.dirname(__FILE__),
|
27
|
+
MotionAwesome::Generator.gen_plist( File.join( File.dirname(__FILE__),
|
28
|
+
%w[css font-awesome.css] ) )
|
28
29
|
end
|
29
|
-
end
|
30
|
+
end
|
data/app/app_delegate.rb
CHANGED
@@ -2,15 +2,15 @@ include SugarCube::Adjust
|
|
2
2
|
|
3
3
|
class AppDelegate
|
4
4
|
attr_reader :samples
|
5
|
-
|
5
|
+
|
6
6
|
def application(application, didFinishLaunchingWithOptions:launchOptions)
|
7
7
|
return true if RUBYMOTION_ENV == 'test'
|
8
|
-
|
9
|
-
|
8
|
+
|
9
|
+
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
|
10
10
|
nav = UINavigationController.alloc.initWithRootViewController( A.new )
|
11
|
-
@window.rootViewController = nav
|
11
|
+
@window.rootViewController = nav
|
12
12
|
@window.rootViewController.wantsFullScreenLayout = true
|
13
|
-
|
13
|
+
|
14
14
|
@window.makeKeyAndVisible
|
15
15
|
|
16
16
|
nav.setNavigationBarHidden( true, animated:true )
|
@@ -18,12 +18,12 @@ class AppDelegate
|
|
18
18
|
setup_appearance
|
19
19
|
|
20
20
|
@samples = %w(A B C D E)
|
21
|
-
|
21
|
+
|
22
22
|
true
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def alert( message )
|
26
|
-
WCAlertView.showAlertWithTitle( "Motion-Awesome", message:message,
|
26
|
+
WCAlertView.showAlertWithTitle( "Motion-Awesome", message:message,
|
27
27
|
customizationBlock: ->(alertView) do
|
28
28
|
;
|
29
29
|
end,
|
@@ -32,28 +32,35 @@ class AppDelegate
|
|
32
32
|
end,
|
33
33
|
cancelButtonTitle:"Roger that!", otherButtonTitles:nil )
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
private
|
37
|
-
|
37
|
+
|
38
38
|
def setup_appearance
|
39
39
|
UILabel.appearance.setBackgroundColor( UIColor.clearColor )
|
40
40
|
style_alerts
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
def style_alerts
|
44
44
|
WCAlertView.setDefaultCustomiaztonBlock ->(alertView) do
|
45
|
-
alertView.labelTextColor
|
46
|
-
|
47
|
-
alertView.
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
alertView.labelTextColor =
|
46
|
+
UIColor.colorWithRed( 103, green:135, blue:221, alpha:1.0 )
|
47
|
+
alertView.labelShadowColor =
|
48
|
+
UIColor.colorWithRed(68.0/255, green:114.0/255, blue:221.0/255, alpha:0.2 )
|
49
|
+
alertView.buttonTextColor =
|
50
|
+
UIColor.colorWithRed(103.0, green:135.0, blue:221.0, alpha:1.00 )
|
51
|
+
alertView.buttonShadowColor =
|
52
|
+
UIColor.colorWithRed( 68.0/255, green:114.0/255, blue:221.0/255, alpha:1.0)
|
53
|
+
|
54
|
+
topGradient =
|
55
|
+
UIColor.colorWithRed(50.0/255, green:50.0/255, blue:50.0/255, alpha:0.5 )
|
56
|
+
middleGradient =
|
57
|
+
UIColor.colorWithRed(0.0/255, green:0.0/255, blue:0.0/255, alpha:0.2 )
|
58
|
+
bottomGradient =
|
59
|
+
UIColor.colorWithRed(50.0/255, green:50.0/255, blue:50.0/255, alpha:0.5 )
|
53
60
|
alertView.gradientColors = [topGradient,middleGradient,bottomGradient]
|
54
61
|
|
55
|
-
alertView.outerFrameColor =
|
62
|
+
alertView.outerFrameColor =
|
63
|
+
UIColor.colorWithRed( 103.0/255, green:135.0/255, blue:221.0/255, alpha:1.0)
|
56
64
|
end
|
57
65
|
end
|
58
|
-
|
59
|
-
end
|
66
|
+
end
|
data/app/controllers/a.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
class A < Z
|
2
|
-
def viewDidLoad
|
3
|
-
@comp = label(
|
1
|
+
class A < Z
|
2
|
+
def viewDidLoad
|
3
|
+
@comp = label( 'flag_o', size: 200 ) do |label|
|
4
4
|
label.color = 0x04B0FB.uicolor
|
5
5
|
label.backgroundColor = UIColor.clearColor
|
6
6
|
label.frame = CGRectMake( 0, 0, 200, 200 )
|
7
7
|
label.center = center
|
8
8
|
self.view.addSubview(label)
|
9
|
-
end
|
10
|
-
super
|
11
|
-
end
|
12
|
-
end
|
9
|
+
end
|
10
|
+
super
|
11
|
+
end
|
12
|
+
end
|
data/app/controllers/b.rb
CHANGED
@@ -2,7 +2,7 @@ class B < Z
|
|
2
2
|
def viewDidLoad
|
3
3
|
@comp = label( :volume_up, text:"Simply Awesome!" ) do |label|
|
4
4
|
label.color = UIColor.redColor
|
5
|
-
label.backgroundColor = UIColor.clearColor
|
5
|
+
label.backgroundColor = UIColor.clearColor
|
6
6
|
label.font = UIFont.fontWithName( 'AmericanTypewriter', size:30 )
|
7
7
|
label.textAlignment = NSTextAlignmentCenter
|
8
8
|
label.frame = CGRectMake( 0, 0, 300, 50 )
|
@@ -11,4 +11,4 @@ class B < Z
|
|
11
11
|
end
|
12
12
|
super
|
13
13
|
end
|
14
|
-
end
|
14
|
+
end
|
data/app/controllers/c.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
class C < Z
|
2
2
|
def viewDidLoad
|
3
|
-
@comp
|
3
|
+
@comp=label(:rocket, text:"Rocket Hot!", color:0xB0FB03.uicolor) do |label|
|
4
4
|
label.color = 0x539FFB.uicolor
|
5
|
-
label.backgroundColor = UIColor.clearColor
|
5
|
+
label.backgroundColor = UIColor.clearColor
|
6
6
|
label.font = UIFont.fontWithName( 'copperplate', size:40 )
|
7
7
|
label.textAlignment = NSTextAlignmentCenter
|
8
8
|
label.frame = CGRectMake( 0, 0, 300, 50 )
|
@@ -11,4 +11,4 @@ class C < Z
|
|
11
11
|
end
|
12
12
|
super
|
13
13
|
end
|
14
|
-
end
|
14
|
+
end
|
data/app/controllers/d.rb
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
class D < Z
|
2
|
-
def viewDidLoad
|
2
|
+
def viewDidLoad
|
3
3
|
@comp = button( :legal, size: 40, text:%q{Hit me!} ) do |button|
|
4
4
|
button.titleLabel.textColor = 0xFB3223.uicolor
|
5
5
|
button.titleLabel.font = UIFont.fontWithName( 'GillSans', size:30 )
|
6
|
-
|
7
|
-
button.setBackgroundImage( UIImage.imageNamed( 'button-bg.png'),
|
6
|
+
|
7
|
+
button.setBackgroundImage( UIImage.imageNamed( 'button-bg.png'),
|
8
|
+
forState: UIControlStateNormal )
|
8
9
|
button.layer.cornerRadius = 10
|
9
10
|
button.layer.masksToBounds = true
|
10
|
-
|
11
|
+
|
11
12
|
button.frame = CGRectMake( 0, 0, 180, 60 )
|
12
13
|
button.center = center
|
13
14
|
button.addTarget( self,
|
14
15
|
action: "callback:",
|
15
|
-
forControlEvents: UIControlEventTouchUpInside )
|
16
|
-
self.view.addSubview( button )
|
17
|
-
end
|
16
|
+
forControlEvents: UIControlEventTouchUpInside )
|
17
|
+
self.view.addSubview( button )
|
18
|
+
end
|
18
19
|
super
|
19
20
|
end
|
20
|
-
|
21
|
+
|
21
22
|
private
|
22
|
-
|
23
|
+
|
23
24
|
def callback( button )
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
25
|
+
App.delegate.alert "You're a good citizen..."
|
26
|
+
end
|
27
|
+
end
|
data/app/controllers/e.rb
CHANGED
@@ -1,27 +1,33 @@
|
|
1
1
|
class E < Z
|
2
|
-
def viewDidLoad
|
3
|
-
@comp = button( :github,
|
2
|
+
def viewDidLoad
|
3
|
+
@comp = button( :github,
|
4
|
+
size:35,
|
5
|
+
text:%q{Fork it!},
|
6
|
+
color:0xD6FF18.uicolor,
|
7
|
+
type: :custom ) do |button|
|
4
8
|
button.titleLabel.textColor = 0x2D31CE.uicolor
|
5
|
-
button.titleLabel.font
|
6
|
-
|
7
|
-
|
9
|
+
button.titleLabel.font =
|
10
|
+
UIFont.fontWithName( "Vermin Vibes Out Of Ink", size:55 )
|
11
|
+
|
12
|
+
button.setBackgroundImage( UIImage.imageNamed( 'button-bg.png'),
|
13
|
+
forState: UIControlStateNormal )
|
8
14
|
button.layer.cornerRadius = 5
|
9
15
|
button.layer.masksToBounds = true
|
10
|
-
|
16
|
+
|
11
17
|
button.frame = CGRectMake( 0, 0, 300, 70 )
|
12
18
|
button.center = center
|
13
19
|
button.contentEdgeInsets = UIEdgeInsetsMake( 0, 0, 0, 0 )
|
14
20
|
button.addTarget( self,
|
15
21
|
action: "callback:",
|
16
|
-
forControlEvents: UIControlEventTouchUpInside )
|
17
|
-
self.view.addSubview( button )
|
18
|
-
end
|
22
|
+
forControlEvents: UIControlEventTouchUpInside )
|
23
|
+
self.view.addSubview( button )
|
24
|
+
end
|
19
25
|
super
|
20
26
|
end
|
21
|
-
|
27
|
+
|
22
28
|
private
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
29
|
+
|
30
|
+
def callback( button )
|
31
|
+
App.delegate.alert "github.com/derailed/motion-awesome"
|
32
|
+
end
|
33
|
+
end
|