motion-prime 0.3.2 → 0.3.3
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 +8 -8
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +10 -0
- data/doc/code/getting_started.rb +61 -0
- data/doc/docs/docco.css +500 -0
- data/doc/docs/getting_started.html +177 -0
- data/doc/docs/public/fonts/aller-bold.eot +0 -0
- data/doc/docs/public/fonts/aller-bold.ttf +0 -0
- data/doc/docs/public/fonts/aller-bold.woff +0 -0
- data/doc/docs/public/fonts/aller-light.eot +0 -0
- data/doc/docs/public/fonts/aller-light.ttf +0 -0
- data/doc/docs/public/fonts/aller-light.woff +0 -0
- data/doc/docs/public/fonts/novecento-bold.eot +0 -0
- data/doc/docs/public/fonts/novecento-bold.ttf +0 -0
- data/doc/docs/public/fonts/novecento-bold.woff +0 -0
- data/doc/docs/public/stylesheets/normalize.css +375 -0
- data/files/app/sections/sidebar/action.rb +1 -1
- data/motion-prime/app_delegate.rb +8 -2
- data/motion-prime/elements/_content_padding_mixin.rb +12 -12
- data/motion-prime/elements/_content_text_mixin.rb +65 -0
- data/motion-prime/elements/base.rb +51 -19
- data/motion-prime/elements/button.rb +1 -1
- data/motion-prime/elements/draw.rb +26 -113
- data/motion-prime/elements/draw/_draw_background_mixin.rb +26 -0
- data/motion-prime/elements/draw/image.rb +10 -1
- data/motion-prime/elements/draw/label.rb +61 -42
- data/motion-prime/elements/draw/view.rb +14 -0
- data/motion-prime/elements/error_message.rb +1 -1
- data/motion-prime/elements/label.rb +1 -1
- data/motion-prime/elements/text_field.rb +2 -2
- data/motion-prime/elements/text_view.rb +3 -0
- data/motion-prime/helpers/has_style_chain_builder.rb +1 -1
- data/motion-prime/helpers/has_styles.rb +28 -0
- data/motion-prime/models/bag.rb +1 -1
- data/motion-prime/models/sync.rb +4 -4
- data/motion-prime/screens/_base_mixin.rb +1 -1
- data/motion-prime/screens/extensions/_navigation_bar_mixin.rb +7 -0
- data/motion-prime/screens/sidebar_container_screen.rb +8 -2
- data/motion-prime/sections/_cell_section_mixin.rb +25 -0
- data/motion-prime/sections/base.rb +17 -16
- data/motion-prime/sections/draw.rb +32 -10
- data/motion-prime/sections/form.rb +27 -17
- data/motion-prime/sections/form/base_field_section.rb +0 -1
- data/motion-prime/sections/form/base_header_section.rb +3 -2
- data/motion-prime/sections/form/password_field_section.rb +1 -1
- data/motion-prime/sections/table.rb +31 -10
- data/motion-prime/sections/table/base_cell_section.rb +1 -22
- data/motion-prime/sections/table/draw_cell_section.rb +5 -0
- data/motion-prime/styles/form.rb +12 -4
- data/motion-prime/support/_key_value_store.rb +0 -2
- data/motion-prime/support/dm_text_field.rb +2 -2
- data/motion-prime/support/tab_bar_controller.rb +28 -0
- data/motion-prime/version.rb +1 -1
- data/motion-prime/views/_frame_calculator_mixin.rb +75 -0
- data/motion-prime/views/view_styler.rb +36 -94
- metadata +23 -4
- data/motion-prime/elements/_field_dimensions_mixin.rb +0 -59
- data/motion-prime/elements/_text_dimensions_mixin.rb +0 -35
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: motion-prime
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.3
|
|
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-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -185,6 +185,19 @@ files:
|
|
|
185
185
|
- doc/FAQ.md
|
|
186
186
|
- doc/SECTION.md
|
|
187
187
|
- doc/STYLE.md
|
|
188
|
+
- doc/code/getting_started.rb
|
|
189
|
+
- doc/docs/docco.css
|
|
190
|
+
- doc/docs/getting_started.html
|
|
191
|
+
- doc/docs/public/fonts/aller-bold.eot
|
|
192
|
+
- doc/docs/public/fonts/aller-bold.ttf
|
|
193
|
+
- doc/docs/public/fonts/aller-bold.woff
|
|
194
|
+
- doc/docs/public/fonts/aller-light.eot
|
|
195
|
+
- doc/docs/public/fonts/aller-light.ttf
|
|
196
|
+
- doc/docs/public/fonts/aller-light.woff
|
|
197
|
+
- doc/docs/public/fonts/novecento-bold.eot
|
|
198
|
+
- doc/docs/public/fonts/novecento-bold.ttf
|
|
199
|
+
- doc/docs/public/fonts/novecento-bold.woff
|
|
200
|
+
- doc/docs/public/stylesheets/normalize.css
|
|
188
201
|
- files/Gemfile
|
|
189
202
|
- files/Rakefile
|
|
190
203
|
- files/app/app_delegate.rb
|
|
@@ -211,13 +224,14 @@ files:
|
|
|
211
224
|
- motion-prime/config/config.rb
|
|
212
225
|
- motion-prime/core_ext/kernel.rb
|
|
213
226
|
- motion-prime/elements/_content_padding_mixin.rb
|
|
214
|
-
- motion-prime/elements/
|
|
215
|
-
- motion-prime/elements/_text_dimensions_mixin.rb
|
|
227
|
+
- motion-prime/elements/_content_text_mixin.rb
|
|
216
228
|
- motion-prime/elements/base.rb
|
|
217
229
|
- motion-prime/elements/button.rb
|
|
218
230
|
- motion-prime/elements/draw.rb
|
|
231
|
+
- motion-prime/elements/draw/_draw_background_mixin.rb
|
|
219
232
|
- motion-prime/elements/draw/image.rb
|
|
220
233
|
- motion-prime/elements/draw/label.rb
|
|
234
|
+
- motion-prime/elements/draw/view.rb
|
|
221
235
|
- motion-prime/elements/error_message.rb
|
|
222
236
|
- motion-prime/elements/google_map.rb
|
|
223
237
|
- motion-prime/elements/image.rb
|
|
@@ -230,6 +244,7 @@ files:
|
|
|
230
244
|
- motion-prime/helpers/has_normalizer.rb
|
|
231
245
|
- motion-prime/helpers/has_search_bar.rb
|
|
232
246
|
- motion-prime/helpers/has_style_chain_builder.rb
|
|
247
|
+
- motion-prime/helpers/has_styles.rb
|
|
233
248
|
- motion-prime/models/association.rb
|
|
234
249
|
- motion-prime/models/association_collection.rb
|
|
235
250
|
- motion-prime/models/bag.rb
|
|
@@ -251,6 +266,7 @@ files:
|
|
|
251
266
|
- motion-prime/screens/extensions/_indicators_mixin.rb
|
|
252
267
|
- motion-prime/screens/extensions/_navigation_bar_mixin.rb
|
|
253
268
|
- motion-prime/screens/sidebar_container_screen.rb
|
|
269
|
+
- motion-prime/sections/_cell_section_mixin.rb
|
|
254
270
|
- motion-prime/sections/base.rb
|
|
255
271
|
- motion-prime/sections/draw.rb
|
|
256
272
|
- motion-prime/sections/form.rb
|
|
@@ -267,6 +283,7 @@ files:
|
|
|
267
283
|
- motion-prime/sections/tabbed.rb
|
|
268
284
|
- motion-prime/sections/table.rb
|
|
269
285
|
- motion-prime/sections/table/base_cell_section.rb
|
|
286
|
+
- motion-prime/sections/table/draw_cell_section.rb
|
|
270
287
|
- motion-prime/sections/table/refresh_mixin.rb
|
|
271
288
|
- motion-prime/styles/base.rb
|
|
272
289
|
- motion-prime/styles/form.rb
|
|
@@ -280,9 +297,11 @@ files:
|
|
|
280
297
|
- motion-prime/support/dm_view_with_section.rb
|
|
281
298
|
- motion-prime/support/mp_label.rb
|
|
282
299
|
- motion-prime/support/navigation_controller.rb
|
|
300
|
+
- motion-prime/support/tab_bar_controller.rb
|
|
283
301
|
- motion-prime/support/ui_search_bar_custom.rb
|
|
284
302
|
- motion-prime/support/ui_view.rb
|
|
285
303
|
- motion-prime/version.rb
|
|
304
|
+
- motion-prime/views/_frame_calculator_mixin.rb
|
|
286
305
|
- motion-prime/views/layout.rb
|
|
287
306
|
- motion-prime/views/styles.rb
|
|
288
307
|
- motion-prime/views/view_builder.rb
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
module MotionPrime
|
|
2
|
-
module ElementFieldDimensionsMixin
|
|
3
|
-
def text_value
|
|
4
|
-
if button?
|
|
5
|
-
text = view ? view.titleLabel.text : computed_options[:title]
|
|
6
|
-
else
|
|
7
|
-
text = view ? view.text : computed_options[:text]
|
|
8
|
-
end.to_s
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def content_text
|
|
12
|
-
text = text_value
|
|
13
|
-
if !button? && text.empty?
|
|
14
|
-
text = computed_options[:placeholder]
|
|
15
|
-
end
|
|
16
|
-
text.to_s
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def font
|
|
20
|
-
if button?
|
|
21
|
-
font = computed_options[:title_label][:font]
|
|
22
|
-
else
|
|
23
|
-
font = computed_options[:placeholder_font] if text_value.empty?
|
|
24
|
-
font ||= computed_options[:font]
|
|
25
|
-
end
|
|
26
|
-
font || :system.uifont
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def content_width
|
|
30
|
-
min_width = computed_options[:min_width].to_f
|
|
31
|
-
return min_width if content_text.empty?
|
|
32
|
-
|
|
33
|
-
attributed_text = NSAttributedString.alloc.initWithString(content_text, attributes: {NSFontAttributeName => font })
|
|
34
|
-
rect = attributed_text.boundingRectWithSize([Float::MAX, Float::MAX], options:NSStringDrawingUsesLineFragmentOrigin, context:nil)
|
|
35
|
-
|
|
36
|
-
width = rect.size.width.ceil
|
|
37
|
-
[[width, computed_options[:max_width]].compact.min, min_width].max
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def content_height
|
|
41
|
-
min_height = computed_options[:min_height].to_f
|
|
42
|
-
return min_height if content_text.blank?
|
|
43
|
-
|
|
44
|
-
width = computed_options[:width]
|
|
45
|
-
raise "Please set element width for height calculation" unless width
|
|
46
|
-
|
|
47
|
-
attributes = {NSFontAttributeName => font }
|
|
48
|
-
attributed_text = NSAttributedString.alloc.initWithString(content_text, attributes: attributes)
|
|
49
|
-
rect = attributed_text.boundingRectWithSize([width, Float::MAX], options:NSStringDrawingUsesLineFragmentOrigin, context:nil)
|
|
50
|
-
height = rect.size.height.ceil
|
|
51
|
-
[[height, computed_options[:max_height]].compact.min, min_height].max
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
private
|
|
55
|
-
def button?
|
|
56
|
-
self.is_a?(ButtonElement)
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
module MotionPrime
|
|
2
|
-
module ElementTextDimensionsMixin
|
|
3
|
-
def content_height
|
|
4
|
-
text = view.try(:text) || computed_options[:text]
|
|
5
|
-
return 0 if text.blank?
|
|
6
|
-
|
|
7
|
-
width = computed_options[:width]
|
|
8
|
-
font = computed_options[:font] || :system.uifont
|
|
9
|
-
raise "Please set element width for height calculation" unless width
|
|
10
|
-
|
|
11
|
-
attributes = {NSFontAttributeName => font }
|
|
12
|
-
if computed_options[:line_spacing]
|
|
13
|
-
paragrahStyle = NSMutableParagraphStyle.alloc.init
|
|
14
|
-
paragrahStyle.setLineSpacing(computed_options[:line_spacing])
|
|
15
|
-
attributes[NSParagraphStyleAttributeName] = paragrahStyle
|
|
16
|
-
end
|
|
17
|
-
attributed_text = NSAttributedString.alloc.initWithString(computed_options[:text], attributes: attributes)
|
|
18
|
-
rect = attributed_text.boundingRectWithSize([width, Float::MAX], options:NSStringDrawingUsesLineFragmentOrigin, context:nil)
|
|
19
|
-
rect.size.height
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def content_width
|
|
23
|
-
text = view.try(:text) || computed_options[:text]
|
|
24
|
-
return 0 if text.blank?
|
|
25
|
-
|
|
26
|
-
width = computed_options[:width]
|
|
27
|
-
font = computed_options[:font] || :system.uifont
|
|
28
|
-
|
|
29
|
-
attributed_text = NSAttributedString.alloc.initWithString(computed_options[:text], attributes: {NSFontAttributeName => font })
|
|
30
|
-
rect = attributed_text.boundingRectWithSize([Float::MAX, Float::MAX], options:NSStringDrawingUsesLineFragmentOrigin, context:nil)
|
|
31
|
-
|
|
32
|
-
rect.size.width
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|