motion-prime 0.6.0 → 0.7.0
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 +4 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +6 -1
- data/ROADMAP.md +7 -6
- data/bin/prime +31 -16
- data/doc/code/models.rb +5 -1
- data/doc/code/tables.rb +54 -0
- data/doc/docs/getting_started.html +7 -0
- data/doc/docs/index.html +205 -0
- data/doc/docs/models.html +13 -0
- data/doc/docs/screens.html +7 -0
- data/doc/docs/sections.html +7 -0
- data/doc/docs/tables.html +128 -0
- data/files/Gemfile +3 -3
- data/lib/motion-prime.rb +2 -0
- data/motion-prime.gemspec +3 -2
- data/motion-prime/api_client.rb +35 -36
- data/motion-prime/config/base.rb +0 -2
- data/motion-prime/core_ext/kernel.rb +2 -1
- data/motion-prime/elements/base_element.rb +7 -2
- data/motion-prime/elements/spinner.rb +7 -0
- data/motion-prime/elements/table_view.rb +7 -0
- data/motion-prime/helpers/has_search_bar.rb +11 -5
- data/motion-prime/models/_finder_mixin.rb +5 -12
- data/motion-prime/models/_nano_bag_mixin.rb +1 -1
- data/motion-prime/models/_sync_mixin.rb +52 -37
- data/motion-prime/screens/_base_mixin.rb +4 -0
- data/motion-prime/screens/_navigation_mixin.rb +3 -3
- data/motion-prime/screens/screen.rb +1 -1
- data/motion-prime/sections/base_section.rb +12 -12
- data/motion-prime/sections/form/base_field_section.rb +1 -1
- data/motion-prime/sections/form/date_field_section.rb +5 -0
- data/motion-prime/sections/form/password_field_section.rb +1 -1
- data/motion-prime/sections/form/string_field_section.rb +1 -1
- data/motion-prime/sections/form/text_field_section.rb +1 -1
- data/motion-prime/sections/table.rb +7 -0
- data/motion-prime/sections/table/table_delegate.rb +14 -4
- data/motion-prime/support/mp_spinner.rb +16 -0
- data/motion-prime/support/mp_table_view.rb +6 -0
- data/motion-prime/support/tab_bar_controller.rb +3 -3
- data/motion-prime/support/temp_fixes.rb +6 -0
- data/motion-prime/version.rb +1 -1
- data/motion-prime/views/layout.rb +2 -1
- data/motion-prime/views/view_builder.rb +1 -1
- metadata +24 -2
@@ -0,0 +1,16 @@
|
|
1
|
+
class MPSpinner < MBRoundProgressView
|
2
|
+
def init_animation
|
3
|
+
displayLink = CADisplayLink.displayLinkWithTarget(self, selector: :"handleDisplayLink:")
|
4
|
+
displayLink.addToRunLoop(NSRunLoop.currentRunLoop, forMode:NSDefaultRunLoopMode)
|
5
|
+
end
|
6
|
+
|
7
|
+
def handleDisplayLink(displayLink)
|
8
|
+
@firstTimestamp ||= displayLink.timestamp
|
9
|
+
elapsed = (displayLink.timestamp - @firstTimestamp)
|
10
|
+
rotate(elapsed)
|
11
|
+
end
|
12
|
+
|
13
|
+
def rotate(angle)
|
14
|
+
self.layer.transform = CATransform3DMakeRotation((Math::PI * 2) * angle, 0, 0, 1)
|
15
|
+
end
|
16
|
+
end
|
@@ -7,7 +7,7 @@ module MotionPrime
|
|
7
7
|
|
8
8
|
screens.each_with_index do |options, index|
|
9
9
|
if options.is_a?(Hash)
|
10
|
-
screen = init_screen_with_options(global_options.
|
10
|
+
screen = init_screen_with_options(global_options.deep_merge(options), tag: index)
|
11
11
|
else
|
12
12
|
screen = options
|
13
13
|
screen.tabBarItem.tag = index
|
@@ -16,7 +16,7 @@ module MotionPrime
|
|
16
16
|
screen.send(:on_screen_load) if screen.respond_to?(:on_screen_load)
|
17
17
|
screen.wrap_in_navigation if screen.respond_to?(:wrap_in_navigation)
|
18
18
|
screen.tab_bar = controller if screen.respond_to?(:tab_bar=)
|
19
|
-
view_controllers << screen.main_controller
|
19
|
+
view_controllers << screen.main_controller.strong_ref
|
20
20
|
end
|
21
21
|
|
22
22
|
controller.viewControllers = view_controllers
|
@@ -33,7 +33,7 @@ module MotionPrime
|
|
33
33
|
|
34
34
|
protected
|
35
35
|
def self.init_screen_with_options(options, tag: tag)
|
36
|
-
screen,
|
36
|
+
screen, title = options.delete(:screen), options.delete(:title)
|
37
37
|
screen = Screen.create_with_options(screen, true, options).try(:weak_ref)
|
38
38
|
title ||= screen.title
|
39
39
|
image = extract_image_from_options(options, with_key: :image)
|
data/motion-prime/version.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# TODO: make it part of Sections
|
2
2
|
motion_require '../support/mp_cell_with_section'
|
3
|
+
motion_require '../support/mp_spinner'
|
3
4
|
module MotionPrime
|
4
5
|
module Layout
|
5
6
|
def add_view(klass, options = {}, &block)
|
@@ -41,7 +42,7 @@ module MotionPrime
|
|
41
42
|
[::UIActionSheet, ::UIActivityIndicatorView, ::UIButton, ::UIDatePicker, ::UIImageView, ::UILabel,
|
42
43
|
::UIPageControl, ::UIPickerView, ::UIProgressView, ::UIScrollView, ::UISearchBar, ::UISegmentedControl,
|
43
44
|
::UISlider, ::UIStepper, ::UISwitch, ::UITabBar, ::UITableView, ::UITableViewCell, ::UITextField, ::UITextView,
|
44
|
-
::UIToolbar, ::UIWebView, ::UINavigationBar, ::MPCellWithSection, ::MBProgressHUD].each do |klass|
|
45
|
+
::UIToolbar, ::UIWebView, ::UINavigationBar, ::MPCellWithSection, ::MBProgressHUD, ::MPSpinner].each do |klass|
|
45
46
|
|
46
47
|
shorthand = "#{klass}"[2..-1].underscore.to_sym
|
47
48
|
|
@@ -137,7 +137,7 @@ module MotionPrime
|
|
137
137
|
'UIWebView' => Proc.new{|klass, options|
|
138
138
|
web_view = klass.alloc.initWithFrame CGRectZero
|
139
139
|
if delegate = options.delete(:delegate)
|
140
|
-
web_view.
|
140
|
+
web_view.setDelegate delegate
|
141
141
|
end
|
142
142
|
if url = options.delete(:url)
|
143
143
|
request = NSURLRequest.requestWithURL url.nsurl
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-prime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iskander Haziev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-02-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -137,6 +137,20 @@ dependencies:
|
|
137
137
|
- - ! '>='
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: afmotion
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ~>
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: 2.0.0
|
147
|
+
type: :runtime
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ~>
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 2.0.0
|
140
154
|
- !ruby/object:Gem::Dependency
|
141
155
|
name: methadone
|
142
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -191,8 +205,10 @@ files:
|
|
191
205
|
- doc/code/models.rb
|
192
206
|
- doc/code/screens.rb
|
193
207
|
- doc/code/sections.rb
|
208
|
+
- doc/code/tables.rb
|
194
209
|
- doc/docs/docco.css
|
195
210
|
- doc/docs/getting_started.html
|
211
|
+
- doc/docs/index.html
|
196
212
|
- doc/docs/models.html
|
197
213
|
- doc/docs/public/fonts/aller-bold.eot
|
198
214
|
- doc/docs/public/fonts/aller-bold.ttf
|
@@ -210,6 +226,7 @@ files:
|
|
210
226
|
- doc/docs/public/stylesheets/normalize.css
|
211
227
|
- doc/docs/screens.html
|
212
228
|
- doc/docs/sections.html
|
229
|
+
- doc/docs/tables.html
|
213
230
|
- files/Gemfile
|
214
231
|
- files/Rakefile
|
215
232
|
- files/app/app_delegate.rb
|
@@ -256,6 +273,8 @@ files:
|
|
256
273
|
- motion-prime/elements/label.rb
|
257
274
|
- motion-prime/elements/map.rb
|
258
275
|
- motion-prime/elements/progress_hud.rb
|
276
|
+
- motion-prime/elements/spinner.rb
|
277
|
+
- motion-prime/elements/table_view.rb
|
259
278
|
- motion-prime/elements/table_view_cell.rb
|
260
279
|
- motion-prime/elements/text_field.rb
|
261
280
|
- motion-prime/elements/text_view.rb
|
@@ -319,11 +338,14 @@ files:
|
|
319
338
|
- motion-prime/support/mp_cell_with_section.rb
|
320
339
|
- motion-prime/support/mp_label.rb
|
321
340
|
- motion-prime/support/mp_search_bar_custom.rb
|
341
|
+
- motion-prime/support/mp_spinner.rb
|
342
|
+
- motion-prime/support/mp_table_view.rb
|
322
343
|
- motion-prime/support/mp_text_field.rb
|
323
344
|
- motion-prime/support/mp_text_view.rb
|
324
345
|
- motion-prime/support/mp_view_controller.rb
|
325
346
|
- motion-prime/support/mp_view_with_section.rb
|
326
347
|
- motion-prime/support/tab_bar_controller.rb
|
348
|
+
- motion-prime/support/temp_fixes.rb
|
327
349
|
- motion-prime/support/ui_view.rb
|
328
350
|
- motion-prime/version.rb
|
329
351
|
- motion-prime/views/_frame_calculator_mixin.rb
|