motion-prime 0.4.1 → 0.4.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 +14 -6
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/files/Rakefile +1 -0
- data/motion-prime/elements/_content_text_mixin.rb +1 -1
- data/motion-prime/elements/base_element.rb +84 -87
- data/motion-prime/elements/button.rb +1 -1
- data/motion-prime/elements/draw/_draw_background_mixin.rb +2 -1
- data/motion-prime/elements/label.rb +1 -1
- data/motion-prime/sections/_cell_section_mixin.rb +5 -3
- data/motion-prime/sections/_draw_mixin.rb +0 -8
- data/motion-prime/sections/base_section.rb +17 -19
- data/motion-prime/sections/form.rb +2 -2
- data/motion-prime/sections/form/base_header_section.rb +0 -4
- data/motion-prime/sections/table.rb +3 -4
- data/motion-prime/support/tab_bar_controller.rb +1 -0
- data/motion-prime/version.rb +1 -1
- data/motion-prime/views/styles.rb +11 -10
- data/motion-prime/views/view_builder.rb +9 -0
- data/motion-prime/views/view_styler.rb +9 -1
- metadata +27 -27
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MGY2Yjg2ZDEwNTBlN2FjNjNhNDM1YWRjMWZkMGNiMzYyOGMxYWYzZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MmE0Nzg5ZjA2MmQ0OTVjYjQ3MjRmNGZjZmIzMDg3NDAyNWIxNmI1ZQ==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZjM2NjNjMjBmNDcyN2ZkMGRmNzFlZDI4M2E0NWY0MmFiYjU1ZTJlMTk3NDM5
|
10
|
+
MDZiMzQ0NDdjYmRkYmNjZDg3MDVjYjViYTNkMGM3MzMxZThlZmEwYjJjZGVl
|
11
|
+
ZjQ1Y2I5YmNjYzNkZmU2ZDY1NTFiM2VmYWQ5ZWEyNzJkYzYwZDY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OWRmMjk4OTliN2U1OGZiMWNjOTc5NjFjNGMzYjkxZjYyMDM2MWI4MmY5YmI3
|
14
|
+
NTU1MmZiMjAyYTlhY2Y3MzM1NzViMjI4YzA0YjY0OWFmZWVhNjVhMWJmMmRi
|
15
|
+
NjVmM2Q1NTY3OTllNjFiODMzZTY1MzVhZGI4ZmYyYmM2NWMzNjk=
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/files/Rakefile
CHANGED
@@ -39,96 +39,10 @@ module MotionPrime
|
|
39
39
|
|
40
40
|
# Lazy-computing options
|
41
41
|
def computed_options
|
42
|
-
compute_options!
|
42
|
+
compute_options! unless @computed_options
|
43
43
|
@computed_options
|
44
44
|
end
|
45
45
|
|
46
|
-
def compute_options!
|
47
|
-
@computed_options ||= {}
|
48
|
-
block_options = compute_block_options || {}
|
49
|
-
compute_style_options(options, block_options)
|
50
|
-
@computed_options.merge!(options.except(:screen, :name, :block, :view_class))
|
51
|
-
@computed_options.merge!(block_options)
|
52
|
-
normalize_options(@computed_options, section, %w[text placeholder font title_label padding padding_left padding_right min_width min_outer_width max_width max_outer_width width left right])
|
53
|
-
end
|
54
|
-
|
55
|
-
# Compute options sent inside block, e.g.
|
56
|
-
# element :button do
|
57
|
-
# {name: model.name}
|
58
|
-
# end
|
59
|
-
def compute_block_options
|
60
|
-
section.send(:instance_exec, self, &@block) if @block
|
61
|
-
end
|
62
|
-
|
63
|
-
def compute_style_options(*style_sources)
|
64
|
-
has_errors = section.respond_to?(:observing_errors?) && observing_errors? && has_errors?
|
65
|
-
is_cell_section = section.respond_to?(:cell_name)
|
66
|
-
|
67
|
-
@styles = []
|
68
|
-
if is_cell_section
|
69
|
-
base_styles = {common: [], specific: []}
|
70
|
-
suffixes = {common: [], specific: []}
|
71
|
-
|
72
|
-
# following example in Prime::TableSection#cell_styles
|
73
|
-
# form element/cell: <base|user>_form_field, <base|user>_form_string_field, user_form_field_email
|
74
|
-
# table element/cell: <base|categories>_table_cell, categories_table_title
|
75
|
-
section.section_styles.each { |type, values| base_styles[type] += values }
|
76
|
-
if %w[base table_view_cell].exclude?(@view_name.to_s)
|
77
|
-
# form element: _input
|
78
|
-
# table element: _image
|
79
|
-
suffixes[:common] << @view_name.to_sym
|
80
|
-
suffixes[:common] << :"#{@view_name}_with_errors" if has_errors
|
81
|
-
end
|
82
|
-
if name && name.to_s != @view_name.to_s
|
83
|
-
# form element: _input
|
84
|
-
# table element: _icon
|
85
|
-
suffixes[:specific] << name.to_sym
|
86
|
-
suffixes[:specific] << :"#{name}_with_errors" if has_errors
|
87
|
-
end
|
88
|
-
# form cell: base_form_field, base_form_string_field
|
89
|
-
# form element: base_form_field_string_field, base_form_string_field_text_field
|
90
|
-
# table cell: base_table_cell
|
91
|
-
# table element: base_table_cell_image
|
92
|
-
common_styles = if suffixes[:common].any?
|
93
|
-
build_styles_chain(base_styles[:common], suffixes[:common])
|
94
|
-
elsif suffixes[:specific].any?
|
95
|
-
build_styles_chain(base_styles[:common], suffixes[:specific])
|
96
|
-
elsif @view_name.to_s == 'table_view_cell'
|
97
|
-
base_styles[:common]
|
98
|
-
end
|
99
|
-
@styles += Array.wrap(common_styles)
|
100
|
-
|
101
|
-
# form cell: user_form_field, user_form_string_field, user_form_field_email
|
102
|
-
# form element: user_form_field_text_field, user_form_string_field_text_field, user_form_field_email_text_field
|
103
|
-
# table cell: categories_table_cell, categories_table_title
|
104
|
-
# table element: categories_table_cell_image, categories_table_title_image
|
105
|
-
specific_base_common_suffix_styles = if suffixes[:common].any?
|
106
|
-
build_styles_chain(base_styles[:specific], suffixes[:common])
|
107
|
-
elsif suffixes[:specific].empty? && @view_name.to_s == 'table_view_cell'
|
108
|
-
base_styles[:specific]
|
109
|
-
end
|
110
|
-
@styles += Array.wrap(specific_base_common_suffix_styles)
|
111
|
-
# form element: user_form_field_input, user_form_string_field_input, user_form_field_email_input
|
112
|
-
# table element: categories_table_cell_icon, categories_table_title_icon
|
113
|
-
@styles += build_styles_chain(base_styles[:specific], suffixes[:specific])
|
114
|
-
end
|
115
|
-
if section
|
116
|
-
# using for base sections
|
117
|
-
@styles << [section.name, name].compact.join('_').to_sym
|
118
|
-
end
|
119
|
-
# custom style (from options or block options), using for TableViews as well
|
120
|
-
custom_styles = style_sources.map do |source|
|
121
|
-
normalize_object(source.delete(:styles), section)
|
122
|
-
end.compact.flatten
|
123
|
-
@styles += custom_styles
|
124
|
-
# puts @view_class.to_s + @styles.inspect, ''
|
125
|
-
@computed_options.merge!(style_options)
|
126
|
-
end
|
127
|
-
|
128
|
-
def style_options
|
129
|
-
Styles.for(styles)
|
130
|
-
end
|
131
|
-
|
132
46
|
def update_with_options(new_options = {})
|
133
47
|
options.merge!(new_options)
|
134
48
|
compute_options!
|
@@ -152,6 +66,89 @@ module MotionPrime
|
|
152
66
|
view.setUserInteractionEnabled true
|
153
67
|
end
|
154
68
|
|
69
|
+
protected
|
70
|
+
def compute_options!
|
71
|
+
block_options = compute_block_options || {}
|
72
|
+
raw_options = self.options.except(:screen, :name, :block, :view_class).merge(block_options)
|
73
|
+
compute_style_options(raw_options)
|
74
|
+
raw_options = Styles.for(styles).merge(raw_options)
|
75
|
+
|
76
|
+
@computed_options = raw_options
|
77
|
+
normalize_options(@computed_options, section, %w[text placeholder font title_label padding padding_left padding_right min_width min_outer_width max_width max_outer_width width left right])
|
78
|
+
end
|
79
|
+
|
80
|
+
# Compute options sent inside block, e.g.
|
81
|
+
# element :button do
|
82
|
+
# {name: model.name}
|
83
|
+
# end
|
84
|
+
def compute_block_options
|
85
|
+
section.send(:instance_exec, self, &@block) if @block
|
86
|
+
end
|
87
|
+
|
88
|
+
def compute_style_options(*style_sources)
|
89
|
+
has_errors = section.respond_to?(:observing_errors?) && observing_errors? && has_errors?
|
90
|
+
is_cell_section = section.respond_to?(:cell_name)
|
91
|
+
|
92
|
+
@styles = []
|
93
|
+
if is_cell_section
|
94
|
+
base_styles = {common: [], specific: []}
|
95
|
+
suffixes = {common: [], specific: []}
|
96
|
+
|
97
|
+
# following example in Prime::TableSection#cell_styles
|
98
|
+
# form element/cell: <base|user>_form_field, <base|user>_form_string_field, user_form_field_email
|
99
|
+
# table element/cell: <base|categories>_table_cell, categories_table_title
|
100
|
+
section.section_styles.each { |type, values| base_styles[type] += values } if section.section_styles
|
101
|
+
if %w[base table_view_cell].exclude?(@view_name.to_s)
|
102
|
+
# form element: _input
|
103
|
+
# table element: _image
|
104
|
+
suffixes[:common] << @view_name.to_sym
|
105
|
+
suffixes[:common] << :"#{@view_name}_with_errors" if has_errors
|
106
|
+
end
|
107
|
+
if name && name.to_s != @view_name.to_s
|
108
|
+
# form element: _input
|
109
|
+
# table element: _icon
|
110
|
+
suffixes[:specific] << name.to_sym
|
111
|
+
suffixes[:specific] << :"#{name}_with_errors" if has_errors
|
112
|
+
end
|
113
|
+
# form cell: base_form_field, base_form_string_field
|
114
|
+
# form element: base_form_field_string_field, base_form_string_field_text_field
|
115
|
+
# table cell: base_table_cell
|
116
|
+
# table element: base_table_cell_image
|
117
|
+
common_styles = if suffixes[:common].any?
|
118
|
+
build_styles_chain(base_styles[:common], suffixes[:common])
|
119
|
+
elsif suffixes[:specific].any?
|
120
|
+
build_styles_chain(base_styles[:common], suffixes[:specific])
|
121
|
+
elsif @view_name.to_s == 'table_view_cell'
|
122
|
+
base_styles[:common]
|
123
|
+
end
|
124
|
+
@styles += Array.wrap(common_styles)
|
125
|
+
|
126
|
+
# form cell: user_form_field, user_form_string_field, user_form_field_email
|
127
|
+
# form element: user_form_field_text_field, user_form_string_field_text_field, user_form_field_email_text_field
|
128
|
+
# table cell: categories_table_cell, categories_table_title
|
129
|
+
# table element: categories_table_cell_image, categories_table_title_image
|
130
|
+
specific_base_common_suffix_styles = if suffixes[:common].any?
|
131
|
+
build_styles_chain(base_styles[:specific], suffixes[:common])
|
132
|
+
elsif suffixes[:specific].empty? && @view_name.to_s == 'table_view_cell'
|
133
|
+
base_styles[:specific]
|
134
|
+
end
|
135
|
+
@styles += Array.wrap(specific_base_common_suffix_styles)
|
136
|
+
# form element: user_form_field_input, user_form_string_field_input, user_form_field_email_input
|
137
|
+
# table element: categories_table_cell_icon, categories_table_title_icon
|
138
|
+
@styles += build_styles_chain(base_styles[:specific], suffixes[:specific])
|
139
|
+
end
|
140
|
+
if section
|
141
|
+
# using for base sections
|
142
|
+
@styles << [section.name, name].compact.join('_').to_sym
|
143
|
+
end
|
144
|
+
# custom style (from options or block options), using for TableViews as well
|
145
|
+
custom_styles = style_sources.map do |source|
|
146
|
+
normalize_object(source.delete(:styles), section)
|
147
|
+
end.compact.flatten
|
148
|
+
@styles += custom_styles
|
149
|
+
# puts @view_class.to_s + @styles.inspect, ''
|
150
|
+
end
|
151
|
+
|
155
152
|
class << self
|
156
153
|
def factory(type, options = {})
|
157
154
|
class_name = "#{type.classify}Element"
|
@@ -7,8 +7,9 @@ module MotionPrime
|
|
7
7
|
border_width = options[:layer].try(:[], :border_width).to_f
|
8
8
|
border_color = options[:layer].try(:[], :border_color) || bg_color || :black
|
9
9
|
|
10
|
-
rect = CGRectInset(draw_rect, -(border_width - 1)*0.5, -(border_width - 1)*0.5)
|
11
10
|
|
11
|
+
inset = border_width > 0 ? (border_width - 1 )*0.5 : 0
|
12
|
+
rect = CGRectInset(draw_rect, -inset, -inset)
|
12
13
|
if bg_color || border_width > 0
|
13
14
|
if border_radius
|
14
15
|
bezierPath = UIBezierPath.bezierPathWithRoundedRect rect, cornerRadius: border_radius
|
@@ -11,7 +11,7 @@ module MotionPrime
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def size_to_fit
|
14
|
-
if computed_options[:size_to_fit]
|
14
|
+
if computed_options[:size_to_fit]
|
15
15
|
if computed_options[:width]
|
16
16
|
view.setHeight([cached_content_outer_height, computed_options[:height]].compact.min)
|
17
17
|
else
|
@@ -17,9 +17,11 @@ module MotionPrime
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def cell_name
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
self.class.cell_name || begin
|
21
|
+
return name unless table
|
22
|
+
table_name = table.name.gsub('_table', '')
|
23
|
+
name.gsub("#{table_name}_", '')
|
24
|
+
end
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
@@ -41,14 +41,6 @@ module MotionPrime
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
def view_style_options
|
45
|
-
@view_style_options ||= begin
|
46
|
-
options = Styles.for(container_options[:styles])
|
47
|
-
normalize_options(options)
|
48
|
-
options
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
44
|
def draw_background(rect)
|
53
45
|
options = container_element.computed_options
|
54
46
|
|
@@ -20,7 +20,7 @@ module MotionPrime
|
|
20
20
|
include DrawMixin
|
21
21
|
|
22
22
|
attr_accessor :screen, :model, :name, :options, :elements, :section_styles
|
23
|
-
class_attribute :elements_options, :container_options, :keyboard_close_bindings
|
23
|
+
class_attribute :elements_options, :container_options, :keyboard_close_bindings, :cell_name
|
24
24
|
define_callbacks :render
|
25
25
|
|
26
26
|
def initialize(options = {})
|
@@ -32,17 +32,14 @@ module MotionPrime
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def container_options
|
35
|
-
@container_options
|
35
|
+
compute_container_options! unless @container_options
|
36
|
+
@container_options
|
36
37
|
end
|
37
38
|
|
38
39
|
def container_height
|
39
40
|
container_options[:height] || DEFAULT_CONTENT_HEIGHT
|
40
41
|
end
|
41
42
|
|
42
|
-
def container_styles
|
43
|
-
base_container_options[:styles]
|
44
|
-
end
|
45
|
-
|
46
43
|
def default_name
|
47
44
|
self.class_name_without_kvo.demodulize.underscore.gsub(/\_section$/, '')
|
48
45
|
end
|
@@ -234,21 +231,19 @@ module MotionPrime
|
|
234
231
|
end
|
235
232
|
|
236
233
|
private
|
237
|
-
def
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
end
|
244
|
-
end
|
234
|
+
def compute_container_options!
|
235
|
+
raw_options = {}
|
236
|
+
raw_options.merge!(self.class.container_options.try(:clone) || {})
|
237
|
+
raw_options.merge!(options.delete(:container) || {})
|
238
|
+
|
239
|
+
@container_options = raw_options
|
245
240
|
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
container_options.merge
|
250
|
-
normalize_options(container_options)
|
241
|
+
# must be here because section_styles may use container_options for custom styles
|
242
|
+
container_options_from_styles = Styles.for(section_styles.values.flatten)[:container] if section_styles
|
243
|
+
if container_options_from_styles.present?
|
244
|
+
@container_options = container_options_from_styles.merge(@container_options)
|
251
245
|
end
|
246
|
+
normalize_options(@container_options)
|
252
247
|
end
|
253
248
|
|
254
249
|
class << self
|
@@ -272,6 +267,9 @@ module MotionPrime
|
|
272
267
|
def bind_keyboard_close(options)
|
273
268
|
self.keyboard_close_bindings = options
|
274
269
|
end
|
270
|
+
def set_cell_name(value)
|
271
|
+
self.cell_name = value
|
272
|
+
end
|
275
273
|
end
|
276
274
|
after_render :bind_keyboard_events
|
277
275
|
after_render :bind_keyboard_close
|
@@ -156,13 +156,13 @@ module MotionPrime
|
|
156
156
|
def keyboard_will_show
|
157
157
|
return if table_view.contentSize.height + table_view.top <= UIScreen.mainScreen.bounds.size.height - KEYBOARD_HEIGHT_PORTRAIT
|
158
158
|
current_inset = table_view.contentInset
|
159
|
-
current_inset.bottom = KEYBOARD_HEIGHT_PORTRAIT + (self.table_element.computed_options[:
|
159
|
+
current_inset.bottom = KEYBOARD_HEIGHT_PORTRAIT + (self.table_element.computed_options[:bottom_content_inset] || 0)
|
160
160
|
table_view.contentInset = current_inset
|
161
161
|
end
|
162
162
|
|
163
163
|
def keyboard_will_hide
|
164
164
|
current_inset = table_view.contentInset
|
165
|
-
current_inset.bottom = self.table_element.computed_options[:
|
165
|
+
current_inset.bottom = self.table_element.computed_options[:bottom_content_inset] || 0
|
166
166
|
table_view.contentInset = current_inset
|
167
167
|
end
|
168
168
|
|
@@ -63,7 +63,6 @@ module MotionPrime
|
|
63
63
|
# type = `cell` (always true)
|
64
64
|
# table_cell_name = `title`
|
65
65
|
type = cell.respond_to?(:cell_type) ? cell.cell_type : 'cell'
|
66
|
-
|
67
66
|
suffixes = [type]
|
68
67
|
if cell.is_a?(BaseFieldSection)
|
69
68
|
suffixes << cell.default_name
|
@@ -73,7 +72,6 @@ module MotionPrime
|
|
73
72
|
# table: base_table_<type>
|
74
73
|
# form: base_form_<type>, base_form_<field_type>
|
75
74
|
styles[:common] = build_styles_chain(table_styles[:common], suffixes)
|
76
|
-
|
77
75
|
if cell.is_a?(BaseFieldSection)
|
78
76
|
# form cell: _<type>_<field_name> = `_field_email`
|
79
77
|
suffixes << :"#{type}_#{cell.name}" if cell.name
|
@@ -85,8 +83,9 @@ module MotionPrime
|
|
85
83
|
# form: <form_name>_form_<type>, <form_name>_form_<field_type>, user_form_<type>_email = `user_form_field`, `user_form_string_field`, `user_form_field_email`
|
86
84
|
styles[:specific] = build_styles_chain(table_styles[:specific], suffixes)
|
87
85
|
|
88
|
-
|
89
|
-
|
86
|
+
container_options_styles = cell.container_options[:styles]
|
87
|
+
if container_options_styles.present?
|
88
|
+
styles[:specific] += Array.wrap(container_options_styles)
|
90
89
|
end
|
91
90
|
|
92
91
|
styles
|
data/motion-prime/version.rb
CHANGED
@@ -11,17 +11,11 @@ module MotionPrime
|
|
11
11
|
names = Array.wrap(args)
|
12
12
|
options = names.pop if args.last.is_a?(Hash)
|
13
13
|
|
14
|
-
if
|
15
|
-
raise "Only style names are available for nested styles, received: `#{args.inspect}`. Namespace: `#{@namespace}`" if options.present?
|
16
|
-
names.each do |name|
|
17
|
-
namespace = [@namespace, name].compact.join('_')
|
18
|
-
self.class.new(namespace).instance_eval(&block)
|
19
|
-
end
|
20
|
-
else
|
21
|
-
raise "No style rules specified for `#{names.join(', ')}`. Namespace: `#{@namespace}`" unless options
|
14
|
+
if options.present?
|
22
15
|
parent = options.delete(:parent)
|
23
|
-
|
24
|
-
|
16
|
+
if parent_namespace = options.delete(:parent_namespace) || @namespace
|
17
|
+
parent ="#{parent_namespace}_#{parent}".to_sym
|
18
|
+
end
|
25
19
|
mixins = Array.wrap(options.delete(:mixins)).map { |mixin_name| :"_mixin_#{mixin_name}" }
|
26
20
|
|
27
21
|
names.each do |name|
|
@@ -31,7 +25,14 @@ module MotionPrime
|
|
31
25
|
@@repo[name].deep_merge!(self.class.for(mixins)) if mixins.present?
|
32
26
|
@@repo[name].deep_merge! options
|
33
27
|
end
|
28
|
+
elsif !block_given?
|
29
|
+
raise "No style rules specified for `#{names.join(', ')}`. Namespace: `#{@namespace}`"
|
34
30
|
end
|
31
|
+
|
32
|
+
names.each do |name|
|
33
|
+
namespace = [@namespace, name].compact.join('_')
|
34
|
+
self.class.new(namespace).instance_eval(&block)
|
35
|
+
end if block_given?
|
35
36
|
end
|
36
37
|
|
37
38
|
class << self
|
@@ -121,6 +121,15 @@ module MotionPrime
|
|
121
121
|
},
|
122
122
|
'MBProgressHUD' => Proc.new{|klass, options|
|
123
123
|
MBProgressHUD.showHUDAddedTo options.delete(:add_to_view), animated: (options.has_key?(:animated) ? options[:animatetd] : true)
|
124
|
+
},
|
125
|
+
'UIWebView' => Proc.new{|klass, options|
|
126
|
+
web_view = klass.alloc.initWithFrame CGRectZero
|
127
|
+
if url = options.delete(:url)
|
128
|
+
request = NSURLRequest.requestWithURL url.nsurl
|
129
|
+
web_view.loadRequest request
|
130
|
+
end
|
131
|
+
web_view.delegate = options.delete(:delegate)
|
132
|
+
web_view
|
124
133
|
}
|
125
134
|
}
|
126
135
|
end
|
@@ -83,7 +83,7 @@ module MotionPrime
|
|
83
83
|
end
|
84
84
|
elsif key.end_with?('image')
|
85
85
|
view.setValue value.uiimage, forKey: key.camelize
|
86
|
-
elsif key.end_with?('
|
86
|
+
elsif key.end_with?('_content_inset')
|
87
87
|
current_inset = view.contentInset
|
88
88
|
current_inset.send("#{key.partition('_').first}=", value)
|
89
89
|
view.contentInset = current_inset
|
@@ -135,6 +135,14 @@ module MotionPrime
|
|
135
135
|
elsif key == 'gradient'
|
136
136
|
gradient = prepare_gradient(value)
|
137
137
|
view.layer.insertSublayer(gradient, atIndex: 0)
|
138
|
+
elsif key == 'selection_style' && view.is_a?(UITableViewCell) && value.is_a?(Symbol)
|
139
|
+
view.setSelectionStyle value.uitablecellselectionstyle
|
140
|
+
elsif key == 'separator_inset' && (view.is_a?(UITableViewCell) || view.is_a?(UITableView))
|
141
|
+
if value.to_s == 'none'
|
142
|
+
view.separatorInset = UIEdgeInsetsMake(0, 320, 0, 0)
|
143
|
+
elsif value.is_a?(Array) && value.count == 2
|
144
|
+
view.separatorInset = UIEdgeInsetsMake(0, value.first, 0, value.last)
|
145
|
+
end
|
138
146
|
elsif value.is_a?(Hash)
|
139
147
|
self.class.new(view.send(key.camelize(:lower).to_sym), nil, value.merge(parent_frame: options[:frame] || options[:parent_frame])).apply
|
140
148
|
else
|
metadata
CHANGED
@@ -1,167 +1,167 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-prime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iskander Haziev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - '>='
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - '>='
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: motion-stump
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '>='
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - '>='
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: motion-redgreen
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - '>='
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - '>='
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: cocoapods
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - '>='
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - '>='
|
66
|
+
- - ! '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: motion-cocoapods
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - '>='
|
73
|
+
- - ! '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - '>='
|
80
|
+
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: motion-require
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - '>='
|
87
|
+
- - ! '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - '>='
|
94
|
+
- - ! '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: motion-support
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - '>='
|
101
|
+
- - ! '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - '>='
|
108
|
+
- - ! '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: bubble-wrap
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - '>='
|
115
|
+
- - ! '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - '>='
|
122
|
+
- - ! '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: sugarcube
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - '>='
|
129
|
+
- - ! '>='
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - '>='
|
136
|
+
- - ! '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: nano-store
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - '>='
|
143
|
+
- - ! '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - '>='
|
150
|
+
- - ! '>='
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: methadone
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - '>='
|
157
|
+
- - ! '>='
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - '>='
|
164
|
+
- - ! '>='
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
description: RubyMotion apps development framework
|
@@ -332,17 +332,17 @@ require_paths:
|
|
332
332
|
- lib
|
333
333
|
required_ruby_version: !ruby/object:Gem::Requirement
|
334
334
|
requirements:
|
335
|
-
- - '>='
|
335
|
+
- - ! '>='
|
336
336
|
- !ruby/object:Gem::Version
|
337
337
|
version: '0'
|
338
338
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
339
339
|
requirements:
|
340
|
-
- - '>='
|
340
|
+
- - ! '>='
|
341
341
|
- !ruby/object:Gem::Version
|
342
342
|
version: '0'
|
343
343
|
requirements: []
|
344
344
|
rubyforge_project:
|
345
|
-
rubygems_version: 2.0.
|
345
|
+
rubygems_version: 2.0.5
|
346
346
|
signing_key:
|
347
347
|
specification_version: 4
|
348
348
|
summary: RubyMotion apps development framework
|