redpotion 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/project/ruby_motion_query/ext.rb +26 -10
- data/lib/project/version.rb +1 -1
- data/lib/redpotion.rb +4 -1
- data/templates/screen/app/screens/name_screen.rb +23 -0
- data/templates/screen/app/stylesheets/name_screen_stylesheet.rb +14 -0
- data/templates/screen/spec/screens/name_screen_spec.rb +8 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0deea12cefd00811de29eb3d9ae59da6b0bca9b
|
4
|
+
data.tar.gz: cbe219de2dcc3feac16fe920fa00bf89dd0125b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44f1b86f590eba11d47f3a25031b57104c6f57466641354d376bd1b7026107a0ea294adcfd9974a43ea0e8ce2eb31fe7f0c6d4a267c6d95c042528040e055ab2
|
7
|
+
data.tar.gz: a8f733ae1ba00bf1d1d4ca5ae91539f6a4ea35d25ae835aaf7cccb2da0e0d7d78725e551f7bc8a37bdb7ae9d3ce9ae7a9e95f27424e05708d4e2cd2df85a1300
|
@@ -50,6 +50,14 @@ class UIView
|
|
50
50
|
def style(&block)
|
51
51
|
rmq(self).style(&block)
|
52
52
|
end
|
53
|
+
|
54
|
+
def color
|
55
|
+
rmq.color
|
56
|
+
end
|
57
|
+
|
58
|
+
def font
|
59
|
+
rmq.font
|
60
|
+
end
|
53
61
|
end
|
54
62
|
|
55
63
|
class UIViewController
|
@@ -60,34 +68,42 @@ end
|
|
60
68
|
|
61
69
|
class ProMotion::Screen
|
62
70
|
def append(view_or_constant, style=nil, opts = {})
|
63
|
-
|
71
|
+
view.append(view_or_constant, style, opts)
|
64
72
|
end
|
65
73
|
def append!(view_or_constant, style=nil, opts = {})
|
66
|
-
|
74
|
+
view.append!(view_or_constant, style, opts)
|
67
75
|
end
|
68
76
|
|
69
77
|
def prepend(view_or_constant, style=nil, opts = {})
|
70
|
-
|
78
|
+
view.prepend(view_or_constant, style, opts)
|
71
79
|
end
|
72
80
|
def prepend!(view_or_constant, style=nil, opts = {})
|
73
|
-
|
81
|
+
view.prepend!(view_or_constant, style, opts)
|
74
82
|
end
|
75
83
|
|
76
84
|
def create(view_or_constant, style=nil, opts = {})
|
77
|
-
|
85
|
+
view.create(view_or_constant, style, opts)
|
78
86
|
end
|
79
87
|
def create!(view_or_constant, style=nil, opts = {})
|
80
|
-
|
88
|
+
view.create!(view_or_constant, style, opts)
|
81
89
|
end
|
82
90
|
|
83
|
-
def build(
|
84
|
-
|
91
|
+
def build(view_or_constant, style = nil, opts = {})
|
92
|
+
view.build(view_or_constant, style, opts)
|
85
93
|
end
|
86
|
-
def build!(
|
87
|
-
|
94
|
+
def build!(view_or_constant, style = nil, opts = {})
|
95
|
+
view.build!(view_or_constant, style, opts)
|
88
96
|
end
|
89
97
|
|
90
98
|
def reapply_styles
|
91
99
|
rmq.all.reapply_styles
|
92
100
|
end
|
101
|
+
|
102
|
+
def color
|
103
|
+
view.color
|
104
|
+
end
|
105
|
+
|
106
|
+
def font
|
107
|
+
view.font
|
108
|
+
end
|
93
109
|
end
|
data/lib/project/version.rb
CHANGED
data/lib/redpotion.rb
CHANGED
@@ -4,7 +4,10 @@ unless defined?(Motion::Project::Config)
|
|
4
4
|
raise "This file must be required within a RubyMotion project Rakefile."
|
5
5
|
end
|
6
6
|
|
7
|
+
require 'ruby_motion_query'
|
8
|
+
require 'ProMotion'
|
9
|
+
|
7
10
|
lib_dir_path = File.dirname(File.expand_path(__FILE__))
|
8
11
|
Motion::Project::App.setup do |app|
|
9
|
-
app.files.
|
12
|
+
app.files.push(Dir.glob(File.join(lib_dir_path, "project/**/*.rb")))
|
10
13
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class <%= @name_camel_case %>Screen < PM::<%= @screen_base %>
|
2
|
+
title "Your title here"
|
3
|
+
stylesheet <%= @name_camel_case %>ScreenStylesheet
|
4
|
+
|
5
|
+
def on_load
|
6
|
+
end
|
7
|
+
|
8
|
+
# You don't have to reapply styles to all UIViews, if you want to optimize,
|
9
|
+
# another way to do it is tag the views you need to restyle in your stylesheet,
|
10
|
+
# then only reapply the tagged views, like so:
|
11
|
+
# def logo(st)
|
12
|
+
# st.frame = {t: 10, w: 200, h: 96}
|
13
|
+
# st.centered = :horizontal
|
14
|
+
# st.image = image.resource('logo')
|
15
|
+
# st.tag(:reapply_style)
|
16
|
+
# end
|
17
|
+
#
|
18
|
+
# # Then in willAnimateRotationToInterfaceOrientation
|
19
|
+
# find(:reapply_style).reapply_styles
|
20
|
+
def willAnimateRotationToInterfaceOrientation(orientation, duration: duration)
|
21
|
+
find.all.reapply_styles
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class <%= @name_camel_case %>ScreenStylesheet < ApplicationStylesheet
|
2
|
+
# Add your view stylesheets here. You can then override styles if needed,
|
3
|
+
# example:
|
4
|
+
# # include FooStylesheet
|
5
|
+
|
6
|
+
def setup
|
7
|
+
# Add sytlesheet specific setup stuff here.
|
8
|
+
# Add application specific setup stuff in application_stylesheet.rb
|
9
|
+
end
|
10
|
+
|
11
|
+
def root_view(st)
|
12
|
+
st.background_color = color.white
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redpotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- InfiniteRed
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-11-
|
12
|
+
date: 2014-11-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby_motion_query
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: motion-cocoapods
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: rake
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -85,6 +99,9 @@ files:
|
|
85
99
|
- lib/project/ruby_motion_query/traverse.rb
|
86
100
|
- lib/project/version.rb
|
87
101
|
- lib/redpotion.rb
|
102
|
+
- templates/screen/app/screens/name_screen.rb
|
103
|
+
- templates/screen/app/stylesheets/name_screen_stylesheet.rb
|
104
|
+
- templates/screen/spec/screens/name_screen_spec.rb
|
88
105
|
homepage: https://github.com/infinitered/redpotion
|
89
106
|
licenses:
|
90
107
|
- MIT
|