motion-templates 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/lib/motion-templates/version.rb +5 -0
  3. data/template/circle/files/Gemfile +18 -0
  4. data/template/circle/files/Gemfile.lock +274 -0
  5. data/template/circle/files/Rakefile +73 -0
  6. data/template/circle/files/app/app_delegate.rb +13 -0
  7. data/template/circle/files/app/helpers/app.rb +7 -0
  8. data/template/circle/files/app/layouts/home_layout.rb +21 -0
  9. data/template/circle/files/app/layouts/menu_layout.rb +90 -0
  10. data/template/circle/files/app/screens/help_screen.rb +34 -0
  11. data/template/circle/files/app/screens/home_screen.rb +27 -0
  12. data/template/circle/files/app/screens/menu_list_screen.rb +59 -0
  13. data/template/circle/files/app/screens/menu_screen.rb +39 -0
  14. data/template/circle/files/resources/Default-568h@2x.png +0 -0
  15. data/template/circle/files/resources/Default-667h@2x.png +0 -0
  16. data/template/circle/files/resources/Default-736h@3x.png +0 -0
  17. data/template/circle/files/resources/en.lproj/InfoPlist.strings +2 -0
  18. data/template/circle/files/resources/en.lproj/Localizable.strings +13 -0
  19. data/template/circle/files/resources/icons/Icon-60.png +0 -0
  20. data/template/circle/files/resources/icons/Icon-60@2x.png +0 -0
  21. data/template/circle/files/resources/icons/Icon-60@3x.png +0 -0
  22. data/template/circle/files/resources/icons/Icon-72.png +0 -0
  23. data/template/circle/files/resources/icons/Icon-72@2x.png +0 -0
  24. data/template/circle/files/resources/icons/Icon-76.png +0 -0
  25. data/template/circle/files/resources/icons/Icon-76@2x.png +0 -0
  26. data/template/circle/files/resources/icons/Icon-76@3x.png +0 -0
  27. data/template/circle/files/resources/icons/Icon-Small-50.png +0 -0
  28. data/template/circle/files/resources/icons/Icon-Small-50@2x.png +0 -0
  29. data/template/circle/files/resources/icons/Icon-Small.png +0 -0
  30. data/template/circle/files/resources/icons/Icon-Small@2x.png +0 -0
  31. data/template/circle/files/resources/icons/Icon-Small@3x.png +0 -0
  32. data/template/circle/files/resources/icons/Icon-Spotlight-40.png +0 -0
  33. data/template/circle/files/resources/icons/Icon-Spotlight-40@2x.png +0 -0
  34. data/template/circle/files/resources/icons/Icon-Spotlight-40@3x.png +0 -0
  35. data/template/circle/files/resources/icons/Icon-iPadPro@2x.png +0 -0
  36. data/template/circle/files/resources/icons/Icon.png +0 -0
  37. data/template/circle/files/resources/icons/Icon@2x.png +0 -0
  38. data/template/circle/files/resources/icons/iTunesArtwork +0 -0
  39. data/template/circle/files/resources/icons/iTunesArtwork@2x +0 -0
  40. data/template/circle/files/resources/zh-Hans.lproj/InfoPlist.strings +2 -0
  41. data/template/circle/files/resources/zh-Hans.lproj/Localizable.strings +13 -0
  42. data/template/circle/files/spec/main_spec.rb +9 -0
  43. data/template/circle/files/spec/screens/home_screen_spec.rb +27 -0
  44. metadata +101 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7f9d8bccc276ff40440f3d0d1b7abdaa8b948db7
4
+ data.tar.gz: 3a93cbd85d315c580390b8c7ddb2b4cc7f404ac1
5
+ SHA512:
6
+ metadata.gz: ed7810bae15763bf6f838f62bcd5982d39a65d62fe7b575e874b3991a788d4fd805a77a595713280f11d16777c881510b9678c422b9357a3b71731f2ddd064d9
7
+ data.tar.gz: 4237d0a53f9932c3b514ed4503ca4db82704193cf03d3502e1704eb290136a7fa76868a64b1a508ac5a324416f56f164c843fd2287355de4f92b10a572062d3a
@@ -0,0 +1,5 @@
1
+ module Motion
2
+ module Templates
3
+ VERSION = '0.0.0'
4
+ end
5
+ end
@@ -0,0 +1,18 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rake'
4
+ gem 'motion-cocoapods'
5
+ gem 'motion-provisioning'
6
+ gem 'motion-settings-bundle', github: 'picapica/motion-settings-bundle'
7
+ gem 'motion-acknowledgements', github: 'picapica/motion-acknowledgements'
8
+ gem 'motion-kit'
9
+ gem 'motion-kit-events'
10
+ gem 'ProMotion'
11
+ gem 'ProMotion-menu'
12
+ gem 'ProMotion-form'
13
+ gem 'ProMotion-push'
14
+ gem 'ProMotion-map'
15
+ gem 'sugarcube', :require => 'sugarcube-all'
16
+ gem 'cdq'
17
+ gem 'afmotion'
18
+ gem 'moticons'
@@ -0,0 +1,274 @@
1
+ GIT
2
+ remote: git://github.com/picapica/motion-acknowledgements.git
3
+ revision: 252a6e528907d04c2bb9fed68d7188a2ec593938
4
+ specs:
5
+ motion-acknowledgements (0.0.3)
6
+
7
+ GIT
8
+ remote: git://github.com/picapica/motion-settings-bundle.git
9
+ revision: 3a9d47b42cd1cedd1d59e2c2e7ceeaa6f80f6b62
10
+ specs:
11
+ motion-settings-bundle (0.3.0)
12
+ plist (>= 3.1.0)
13
+
14
+ GEM
15
+ remote: https://rubygems.org/
16
+ specs:
17
+ CFPropertyList (2.3.5)
18
+ ProMotion (2.6.1)
19
+ methadone (~> 1.7)
20
+ motion_print (~> 1.0)
21
+ ProMotion-form (0.3.2)
22
+ ProMotion (~> 2.0)
23
+ motion-cocoapods (~> 1.4)
24
+ ProMotion-map (0.7.0)
25
+ ProMotion (~> 2.0)
26
+ ProMotion-menu (1.1.0)
27
+ ProMotion (~> 2)
28
+ motion-cocoapods (~> 1)
29
+ ProMotion-push (0.4.0)
30
+ ProMotion (~> 2.0)
31
+ activesupport (4.2.8)
32
+ i18n (~> 0.7)
33
+ minitest (~> 5.1)
34
+ thread_safe (~> 0.3, >= 0.3.4)
35
+ tzinfo (~> 1.1)
36
+ addressable (2.5.0)
37
+ public_suffix (~> 2.0, >= 2.0.2)
38
+ afmotion (2.6)
39
+ motion-cocoapods (>= 1.4.1)
40
+ motion-require (>= 0.1)
41
+ babosa (1.0.2)
42
+ builder (3.2.3)
43
+ cdq (1.0.8)
44
+ motion-yaml (= 1.4)
45
+ ruby-xcdm (>= 0.0.9)
46
+ claide (1.0.1)
47
+ cocoapods (1.2.0)
48
+ activesupport (>= 4.0.2, < 5)
49
+ claide (>= 1.0.1, < 2.0)
50
+ cocoapods-core (= 1.2.0)
51
+ cocoapods-deintegrate (>= 1.0.1, < 2.0)
52
+ cocoapods-downloader (>= 1.1.3, < 2.0)
53
+ cocoapods-plugins (>= 1.0.0, < 2.0)
54
+ cocoapods-search (>= 1.0.0, < 2.0)
55
+ cocoapods-stats (>= 1.0.0, < 2.0)
56
+ cocoapods-trunk (>= 1.1.2, < 2.0)
57
+ cocoapods-try (>= 1.1.0, < 2.0)
58
+ colored (~> 1.2)
59
+ escape (~> 0.0.4)
60
+ fourflusher (~> 2.0.1)
61
+ gh_inspector (~> 1.0)
62
+ molinillo (~> 0.5.5)
63
+ nap (~> 1.0)
64
+ ruby-macho (~> 0.2.5)
65
+ xcodeproj (>= 1.4.1, < 2.0)
66
+ cocoapods-core (1.2.0)
67
+ activesupport (>= 4.0.2, < 5)
68
+ fuzzy_match (~> 2.0.4)
69
+ nap (~> 1.0)
70
+ cocoapods-deintegrate (1.0.1)
71
+ cocoapods-downloader (1.1.3)
72
+ cocoapods-plugins (1.0.0)
73
+ nap
74
+ cocoapods-search (1.0.0)
75
+ cocoapods-stats (1.0.0)
76
+ cocoapods-trunk (1.1.2)
77
+ nap (>= 0.8, < 2.0)
78
+ netrc (= 0.7.8)
79
+ cocoapods-try (1.1.0)
80
+ colored (1.2)
81
+ commander (4.4.3)
82
+ highline (~> 1.7.2)
83
+ credentials_manager (1.0.0)
84
+ colored
85
+ commander (>= 4.3.5)
86
+ fastlane (>= 2.0.0, < 3.0.0)
87
+ highline (>= 1.7.1)
88
+ security
89
+ dbt (1.2.0)
90
+ domain_name (0.5.20170223)
91
+ unf (>= 0.0.5, < 1.0.0)
92
+ dotenv (2.2.0)
93
+ escape (0.0.4)
94
+ excon (0.55.0)
95
+ faraday (0.11.0)
96
+ multipart-post (>= 1.2, < 3)
97
+ faraday-cookie_jar (0.0.6)
98
+ faraday (>= 0.7.4)
99
+ http-cookie (~> 1.0.0)
100
+ faraday_middleware (0.11.0.1)
101
+ faraday (>= 0.7.4, < 1.0)
102
+ fastimage (2.1.0)
103
+ fastlane (2.18.3)
104
+ activesupport (< 5)
105
+ addressable (>= 2.3, < 3.0.0)
106
+ babosa (>= 1.0.2, < 2.0.0)
107
+ bundler (>= 1.12.0, < 2.0.0)
108
+ colored
109
+ commander (>= 4.4.0, < 5.0.0)
110
+ dotenv (>= 2.1.1, < 3.0.0)
111
+ excon (>= 0.45.0, < 1.0.0)
112
+ faraday (~> 0.9)
113
+ faraday-cookie_jar (~> 0.0.6)
114
+ faraday_middleware (~> 0.9)
115
+ fastimage (>= 1.6)
116
+ gh_inspector (>= 1.0.1, < 2.0.0)
117
+ google-api-client (~> 0.9.2)
118
+ highline (>= 1.7.2, < 2.0.0)
119
+ json (< 3.0.0)
120
+ mini_magick (~> 4.5.1)
121
+ multi_json
122
+ multi_xml (~> 0.5)
123
+ multipart-post (~> 2.0.0)
124
+ plist (>= 3.1.0, < 4.0.0)
125
+ rubyzip (>= 1.1.0, < 2.0.0)
126
+ security (= 0.1.3)
127
+ slack-notifier (>= 1.3, < 2.0.0)
128
+ terminal-notifier (>= 1.6.2, < 2.0.0)
129
+ terminal-table (>= 1.4.5, < 2.0.0)
130
+ tty-screen (~> 0.5.0)
131
+ word_wrap (~> 1.0.0)
132
+ xcodeproj (>= 0.20, < 2.0.0)
133
+ xcpretty (>= 0.2.4, < 1.0.0)
134
+ xcpretty-travis-formatter (>= 0.0.3)
135
+ fourflusher (2.0.1)
136
+ fuzzy_match (2.0.4)
137
+ gh_inspector (1.0.3)
138
+ google-api-client (0.9.28)
139
+ addressable (~> 2.3)
140
+ googleauth (~> 0.5)
141
+ httpclient (~> 2.7)
142
+ hurley (~> 0.1)
143
+ memoist (~> 0.11)
144
+ mime-types (>= 1.6)
145
+ representable (~> 2.3.0)
146
+ retriable (~> 2.0)
147
+ googleauth (0.5.1)
148
+ faraday (~> 0.9)
149
+ jwt (~> 1.4)
150
+ logging (~> 2.0)
151
+ memoist (~> 0.12)
152
+ multi_json (~> 1.11)
153
+ os (~> 0.9)
154
+ signet (~> 0.7)
155
+ highline (1.7.8)
156
+ http-cookie (1.0.3)
157
+ domain_name (~> 0.5)
158
+ httpclient (2.8.3)
159
+ hurley (0.2)
160
+ i18n (0.8.1)
161
+ json (2.0.3)
162
+ jwt (1.5.6)
163
+ little-plugger (1.1.4)
164
+ logging (2.1.0)
165
+ little-plugger (~> 1.1)
166
+ multi_json (~> 1.10)
167
+ memoist (0.15.0)
168
+ methadone (1.9.5)
169
+ bundler
170
+ mime-types (3.1)
171
+ mime-types-data (~> 3.2015)
172
+ mime-types-data (3.2016.0521)
173
+ mini_magick (4.5.1)
174
+ minitest (5.10.1)
175
+ molinillo (0.5.6)
176
+ moticons (1.0.0)
177
+ motion-cocoapods
178
+ motion-cocoapods (1.8.1)
179
+ cocoapods (>= 1.0.0)
180
+ motion-kit (1.1.1)
181
+ dbt (~> 1.1, >= 1.1.5)
182
+ motion-kit-events (0.3.1)
183
+ dbt
184
+ motion-kit
185
+ motion-provisioning (0.0.7)
186
+ spaceship (~> 0.38)
187
+ motion-require (0.2.0)
188
+ motion-yaml (1.4)
189
+ motion_print (1.2.0)
190
+ multi_json (1.12.1)
191
+ multi_xml (0.6.0)
192
+ multipart-post (2.0.0)
193
+ nanaimo (0.2.3)
194
+ nap (1.1.0)
195
+ netrc (0.7.8)
196
+ os (0.9.6)
197
+ plist (3.2.0)
198
+ public_suffix (2.0.5)
199
+ rake (12.0.0)
200
+ representable (2.3.0)
201
+ uber (~> 0.0.7)
202
+ retriable (2.1.0)
203
+ rouge (1.11.1)
204
+ ruby-macho (0.2.6)
205
+ ruby-xcdm (0.0.10)
206
+ activesupport (~> 4.1)
207
+ builder (~> 3.2)
208
+ plist (~> 3.1)
209
+ rubyzip (1.2.1)
210
+ security (0.1.3)
211
+ signet (0.7.3)
212
+ addressable (~> 2.3)
213
+ faraday (~> 0.9)
214
+ jwt (~> 1.5)
215
+ multi_json (~> 1.10)
216
+ slack-notifier (1.5.1)
217
+ spaceship (0.39.0)
218
+ babosa (= 1.0.2)
219
+ colored
220
+ credentials_manager (>= 0.16.0)
221
+ faraday (~> 0.9)
222
+ faraday-cookie_jar (~> 0.0.6)
223
+ faraday_middleware (~> 0.9)
224
+ fastimage (>= 1.6)
225
+ multi_xml (~> 0.5)
226
+ plist (>= 3.1.0, < 4.0.0)
227
+ sugarcube (3.4.0)
228
+ terminal-notifier (1.7.1)
229
+ terminal-table (1.7.3)
230
+ unicode-display_width (~> 1.1.1)
231
+ thread_safe (0.3.6)
232
+ tty-screen (0.5.0)
233
+ tzinfo (1.2.2)
234
+ thread_safe (~> 0.1)
235
+ uber (0.0.15)
236
+ unf (0.1.4)
237
+ unf_ext
238
+ unf_ext (0.0.7.2)
239
+ unicode-display_width (1.1.3)
240
+ word_wrap (1.0.0)
241
+ xcodeproj (1.4.2)
242
+ CFPropertyList (~> 2.3.3)
243
+ activesupport (>= 3)
244
+ claide (>= 1.0.1, < 2.0)
245
+ colored (~> 1.2)
246
+ nanaimo (~> 0.2.3)
247
+ xcpretty (0.2.4)
248
+ rouge (~> 1.8)
249
+ xcpretty-travis-formatter (0.0.4)
250
+ xcpretty (~> 0.2, >= 0.0.7)
251
+
252
+ PLATFORMS
253
+ ruby
254
+
255
+ DEPENDENCIES
256
+ ProMotion
257
+ ProMotion-form
258
+ ProMotion-map
259
+ ProMotion-menu
260
+ ProMotion-push
261
+ afmotion
262
+ cdq
263
+ moticons
264
+ motion-acknowledgements!
265
+ motion-cocoapods
266
+ motion-kit
267
+ motion-kit-events
268
+ motion-provisioning
269
+ motion-settings-bundle!
270
+ rake
271
+ sugarcube
272
+
273
+ BUNDLED WITH
274
+ 1.13.6
@@ -0,0 +1,73 @@
1
+ # -*- coding: utf-8 -*-
2
+ $:.unshift("/Library/RubyMotion/lib")
3
+ require 'motion/project/template/ios'
4
+
5
+ begin
6
+ require 'bundler'
7
+ Bundler.require
8
+ rescue LoadError
9
+ end
10
+
11
+ $short_version = '0.0'
12
+ $version = '0.%s' % Time.now.strftime('%y%m.%d%H%M')
13
+ $version_fingerprint = '%s/%s/%s' % [$short_version, $version, `git log -1 --format='format:%h'`.strip]
14
+
15
+ Motion::Project::App.setup do |app|
16
+ # Use `rake config' to see complete project settings.
17
+ app.name = File.basename(File.dirname __FILE__)
18
+ app.identifier = 'cc.mib.%s' % app.name
19
+
20
+ app.info_plist['VersionFingerprint'] = $version_fingerprint
21
+ # app.info_plist['UILaunchStoryboardName'] = 'Launch Screen'
22
+ app.info_plist['ITSAppUsesNonExemptEncryption'] = false
23
+ app.info_plist['UIStatusBarHidden'] = true
24
+
25
+ app.resources_dirs += %w(resources/icons)
26
+ app.icons = Dir.glob("resources/icons/*.png").map{|icon| icon.split("/").last}
27
+
28
+ app.pods do
29
+ pod 'SDWebImage', '~>3.8'
30
+ end
31
+
32
+ app.development do
33
+ app.codesign_certificate = ENV['TRAVIS'] ? nil : MotionProvisioning.certificate(
34
+ type: :development,
35
+ platform: :ios)
36
+
37
+ app.provisioning_profile = ENV['TRAVIS'] ? nil : MotionProvisioning.profile(
38
+ bundle_identifier: app.identifier,
39
+ app_name: app.name,
40
+ platform: :ios,
41
+ type: :development)
42
+ end
43
+
44
+ app.release do
45
+ app.entitlements['get-task-allow'] = false
46
+ app.codesign_certificate = MotionProvisioning.certificate(
47
+ type: :distribution,
48
+ platform: :ios)
49
+
50
+ app.provisioning_profile = MotionProvisioning.profile(
51
+ bundle_identifier: app.identifier,
52
+ app_name: app.name,
53
+ platform: :ios,
54
+ type: :distribution)
55
+
56
+ app.entitlements['beta-reports-active'] = true
57
+
58
+ # app.seed_id = "YOUR_SEED_ID"
59
+ app.entitlements['application-identifier'] = app.seed_id + '.' + app.identifier
60
+ app.entitlements['keychain-access-groups'] = [ app.seed_id + '.' + app.identifier ]
61
+ end
62
+
63
+ puts "Name: #{app.name}"
64
+ puts "Using profile: #{ENV['TRAVIS'] ? nil : app.provisioning_profile}"
65
+ puts "Using certificate: #{ENV['TRAVIS'] ? nil : app.codesign_certificate}"
66
+ end
67
+
68
+ Motion::SettingsBundle.setup do |app|
69
+ app.group 'App', footer: "Version: %s" % $version_fingerprint.split('/').join(' - '), titles: 'titles'
70
+ app.child "Acknowledgements" do |ack|
71
+ ack.child "CocoaPods", Title: 'CocoaPods' do end
72
+ end
73
+ end
@@ -0,0 +1,13 @@
1
+ class AppDelegate < PM::Delegate
2
+
3
+ status_bar true, animation: [:none, :slide, :fade].sample
4
+
5
+ def on_load(app, options)
6
+ return true if RUBYMOTION_ENV == "test"
7
+ open_menu HomeScreen.new(nav_bar: true), left: MenuScreen,
8
+ to_show: [:pan_nav_bar, :pan_bezel], to_hide: :all,
9
+ max_left_width: 240,
10
+ transition_animation: [:slide_and_scale, :swinging_door, :parallax].sample
11
+ end
12
+
13
+ end
@@ -0,0 +1,7 @@
1
+ module App
2
+
3
+ def app
4
+ UIApplication.sharedApplication
5
+ end
6
+
7
+ end
@@ -0,0 +1,21 @@
1
+ class HomeLayout < MK::Layout
2
+
3
+ def layout
4
+ root :main do
5
+ add UILabel, :remove_me
6
+ end
7
+ end
8
+
9
+ def main_style
10
+ background_color '#fff0e6'.uicolor
11
+ end
12
+
13
+ def remove_me_style
14
+ text 'Hello!'
15
+ text_color UIColor.whiteColor
16
+ size_to_fit
17
+ center ['50%', '50%']
18
+ autoresizing_mask :pin_to_center
19
+ end
20
+
21
+ end
@@ -0,0 +1,90 @@
1
+ class MenuLayout < MK::Layout
2
+ view :menu_list
3
+
4
+ def layout
5
+ root :main do
6
+ add UIScrollView, :scroll do
7
+ add UIView, :content_view do
8
+ add UIView, :profile do
9
+ add UIImageView, :profile_avatar
10
+ end
11
+ add menu_list, :menu_list
12
+ add UILabel, :footer_label
13
+ end
14
+ end
15
+ end
16
+ end
17
+
18
+ def main_style
19
+ background_color '#fff0e6'.uicolor
20
+ end
21
+
22
+ def scroll_style
23
+ constraints do
24
+ center_x.equals(:main)
25
+ width.equals(:main)
26
+ top.equals(:main)
27
+ bottom.equals(:main)
28
+ end
29
+ end
30
+
31
+ def content_view_style
32
+ constraints do
33
+ left.equals(:superview)
34
+ top.equals(:superview)
35
+ width.equals(:superview)
36
+ bottom.equals(:footer_label)
37
+ end
38
+ end
39
+
40
+ def profile_style
41
+ constraints do
42
+ center_x.equals(:superview)
43
+ width.equals(:superview)
44
+ top.equals(:superview).plus(24)
45
+ height.equals(:profile_avatar).plus(24)
46
+ end
47
+ end
48
+
49
+ def profile_avatar_style
50
+ layer do
51
+ cornerRadius 6
52
+ masks_to_bounds true
53
+ end
54
+
55
+ constraints do
56
+ center_x.equals(:superview)
57
+ width.is == 72
58
+ top.equals(:superview).plus(12)
59
+ height.is == 72
60
+ end
61
+ end
62
+
63
+ def menu_list_style
64
+ constraints do
65
+ left.equals(:superview)
66
+ width.equals(:superview)
67
+ top.equals(:profile, :bottom)
68
+ @height_constraint = (height.is == 0).deactivate
69
+ end
70
+ end
71
+
72
+ def footer_label_style
73
+ text 'Footer'._
74
+ text_color UIColor.blackColor
75
+ size_to_fit
76
+
77
+ constraints do
78
+ below(:menu_list)
79
+ center_x.equals(:superview)
80
+ end
81
+ end
82
+
83
+ def extend_list_height(height)
84
+ @height_constraint.is == height
85
+ @height_constraint.activate
86
+
87
+ self.view.layoutIfNeeded
88
+ end
89
+
90
+ end
@@ -0,0 +1,34 @@
1
+ class HelpScreen < PM::TableScreen
2
+ title "Help"._
3
+
4
+ def table_data
5
+ [{
6
+ title: "About"._,
7
+ cells: [{
8
+ title: "About app"._,
9
+ action: :about
10
+ }, {
11
+ title: "More about app"._,
12
+ action: :more_about
13
+ }]
14
+ }, {
15
+ title: "Help"._,
16
+ cells: [{
17
+ title: "Help me"._,
18
+ action: :help
19
+ }]
20
+ }]
21
+ end
22
+
23
+ def about
24
+ PM.logger.info "Tapped about"
25
+ end
26
+
27
+ def more_about
28
+ PM.logger.info "Tapped more about"
29
+ end
30
+
31
+ def help
32
+ PM.logger.info "Tapped help"
33
+ end
34
+ end
@@ -0,0 +1,27 @@
1
+ class HomeScreen < PM::Screen
2
+ title "Circle"._
3
+
4
+ def load_view
5
+ self.view = layout.view
6
+ end
7
+
8
+ def on_load
9
+ set_nav_bar_button :left, image: icon_image(:foundation, :list, size: 18), action: :show_menu
10
+ set_nav_bar_button :right, image: icon_image(:foundation, :info, size: 18), action: :show_help
11
+ end
12
+
13
+ private
14
+
15
+ def layout
16
+ @layout ||= HomeLayout.new
17
+ end
18
+
19
+ def show_help
20
+ open HelpScreen
21
+ end
22
+
23
+ def show_menu
24
+ app_delegate.menu.toggle(:left)
25
+ end
26
+
27
+ end
@@ -0,0 +1,59 @@
1
+ class MenuListScreen < PM::TableScreen
2
+ row_height :auto, estimated: 44
3
+
4
+ def on_load
5
+ self.view.backgroundColor = '#fff0e6'.uicolor
6
+ end
7
+
8
+ def table_data
9
+ [{
10
+ title: nil,
11
+ cells: [{
12
+ title: 'Home'._,
13
+ action: :swap_center_controller,
14
+ arguments: HomeScreen
15
+ }, {
16
+ title: 'Profile'._
17
+ }, {
18
+ title: 'Discovery'._
19
+ }]
20
+ }, {
21
+ title: nil,
22
+ cells: [{
23
+ title: 'Help'._,
24
+ action: :swap_center_controller,
25
+ arguments: HelpScreen
26
+ }, {
27
+ title: 'Setting'._,
28
+ action: :open_settings
29
+ }]
30
+ }]
31
+ end
32
+
33
+ def table_header_view
34
+ UIView.new.tap do |view|
35
+ view.frame = [self.view.frame.origin, [self.view.frame.size.width, 20]]
36
+ end
37
+ end
38
+
39
+ def table_footer_view
40
+ UIView.new.tap do |view|
41
+ view.frame = [[self.view.frame.origin.x, self.view.frame.origin.y + self.view.frame.size.height - 20], [self.view.frame.size.width, 20]]
42
+ end
43
+ end
44
+
45
+ private
46
+
47
+ def swap_center_controller(screen_class)
48
+ # Just use screen_class if you don't need a navigation bar
49
+ app_delegate.menu.tap do |menu|
50
+ menu.center_controller = screen_class.new(nav_bar: true)
51
+ menu.hide
52
+ end
53
+ end
54
+
55
+ def open_settings
56
+ UIApplicationOpenSettingsURLString.nsurl.open
57
+ end
58
+
59
+ end
@@ -0,0 +1,39 @@
1
+ class MenuScreen < PM::Screen
2
+
3
+ def load_view
4
+ self.view = layout.view
5
+ end
6
+
7
+ def on_load
8
+ load_avatar
9
+ update_menu_size
10
+ end
11
+
12
+ private
13
+
14
+ def layout
15
+ @layout ||= MenuLayout.new.tap do |layout|
16
+ layout.menu_list = menu_list_screen.view
17
+ layout.menu_list.scrollEnabled = false
18
+ end
19
+ end
20
+
21
+ def menu_list_screen
22
+ @menu_list_screen ||= MenuListScreen.new.tap do |s|
23
+ self.addChildViewController s
24
+ s.parent_screen = self
25
+ end
26
+ end
27
+
28
+ def load_avatar
29
+ layout.get(:profile_avatar).sd_setImageWithURL "https://source.unsplash.com/random/72x72".nsurl, placeholderImage:"Icon-72".uiimage
30
+ end
31
+
32
+ def update_menu_size
33
+ [layout.menu_list, layout.get(:scroll), layout.get(:content_view)].tap do |m, s, c|
34
+ layout.extend_list_height(m.contentSize.height)
35
+ s.contentSize = [s.contentSize.width, c.frame.size.height]
36
+ end
37
+ end
38
+
39
+ end
@@ -0,0 +1,2 @@
1
+ "CFBundleDisplayName" = "Circle";
2
+ "CFBundleName" = "Circle";
@@ -0,0 +1,13 @@
1
+ "Circle" = "Circle";
2
+
3
+ "Home" = "Home";
4
+ "Profile" = "Profile";
5
+ "Discovery" = "Discovery";
6
+ "App" = "App";
7
+ "Setting" = "Setting";
8
+
9
+ "Help" = "Help";
10
+ "About" = "About";
11
+ "About app" = "About app";
12
+ "More about app" = "More about app";
13
+ "Help me" = "Help me";
@@ -0,0 +1,2 @@
1
+ "CFBundleDisplayName" = "圈子";
2
+ "CFBundleName" = "Circle";
@@ -0,0 +1,13 @@
1
+ "Circle" = "圈子";
2
+
3
+ "Home" = "首页";
4
+ "Profile" = "个人";
5
+ "Discovery" = "发现";
6
+ "App" = "应用";
7
+ "Setting" = "系统设置";
8
+
9
+ "Help" = "帮助";
10
+ "About" = "关于";
11
+ "About app" = "关于应用";
12
+ "More about app" = "更多应用信息";
13
+ "Help me" = "个人帮助";
@@ -0,0 +1,9 @@
1
+ describe "Application 'JiangRenQuan'" do
2
+ before do
3
+ @app = UIApplication.sharedApplication
4
+ end
5
+
6
+ it "is a ProMotion app" do
7
+ @app.delegate.should.be.kind_of(PM::Delegate)
8
+ end
9
+ end
@@ -0,0 +1,27 @@
1
+ describe HomeScreen do
2
+ tests HomeScreen
3
+
4
+ def home_screen
5
+ @home_screen ||= HomeScreen.new(nav_bar: true).tap {|home_screen| home_screen.on_load }
6
+ end
7
+
8
+ def controller
9
+ home_screen.navigationController
10
+ end
11
+
12
+ after { @home_screen = nil }
13
+
14
+ it "has a navigationController" do
15
+ home_screen.navigationController.should.be.kind_of(UINavigationController)
16
+ end
17
+
18
+ it "has a right nav bar button" do
19
+ home_screen.navigationItem.rightBarButtonItem.should.be.kind_of(UIBarButtonItem)
20
+ end
21
+
22
+ it "opens the help screen when tapping Help" do
23
+ tap("Help")
24
+ controller.topViewController.should.be.kind_of(HelpScreen)
25
+ end
26
+
27
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: motion-templates
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Liu Lantao
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: rubymotion templates
28
+ email:
29
+ - liulantao@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - lib/motion-templates/version.rb
35
+ - template/circle/files/Gemfile
36
+ - template/circle/files/Gemfile.lock
37
+ - template/circle/files/Rakefile
38
+ - template/circle/files/app/app_delegate.rb
39
+ - template/circle/files/app/helpers/app.rb
40
+ - template/circle/files/app/layouts/home_layout.rb
41
+ - template/circle/files/app/layouts/menu_layout.rb
42
+ - template/circle/files/app/screens/help_screen.rb
43
+ - template/circle/files/app/screens/home_screen.rb
44
+ - template/circle/files/app/screens/menu_list_screen.rb
45
+ - template/circle/files/app/screens/menu_screen.rb
46
+ - template/circle/files/resources/Default-568h@2x.png
47
+ - template/circle/files/resources/Default-667h@2x.png
48
+ - template/circle/files/resources/Default-736h@3x.png
49
+ - template/circle/files/resources/en.lproj/InfoPlist.strings
50
+ - template/circle/files/resources/en.lproj/Localizable.strings
51
+ - template/circle/files/resources/icons/Icon-60.png
52
+ - template/circle/files/resources/icons/Icon-60@2x.png
53
+ - template/circle/files/resources/icons/Icon-60@3x.png
54
+ - template/circle/files/resources/icons/Icon-72.png
55
+ - template/circle/files/resources/icons/Icon-72@2x.png
56
+ - template/circle/files/resources/icons/Icon-76.png
57
+ - template/circle/files/resources/icons/Icon-76@2x.png
58
+ - template/circle/files/resources/icons/Icon-76@3x.png
59
+ - template/circle/files/resources/icons/Icon-Small-50.png
60
+ - template/circle/files/resources/icons/Icon-Small-50@2x.png
61
+ - template/circle/files/resources/icons/Icon-Small.png
62
+ - template/circle/files/resources/icons/Icon-Small@2x.png
63
+ - template/circle/files/resources/icons/Icon-Small@3x.png
64
+ - template/circle/files/resources/icons/Icon-Spotlight-40.png
65
+ - template/circle/files/resources/icons/Icon-Spotlight-40@2x.png
66
+ - template/circle/files/resources/icons/Icon-Spotlight-40@3x.png
67
+ - template/circle/files/resources/icons/Icon-iPadPro@2x.png
68
+ - template/circle/files/resources/icons/Icon.png
69
+ - template/circle/files/resources/icons/Icon@2x.png
70
+ - template/circle/files/resources/icons/iTunesArtwork
71
+ - template/circle/files/resources/icons/iTunesArtwork@2x
72
+ - template/circle/files/resources/zh-Hans.lproj/InfoPlist.strings
73
+ - template/circle/files/resources/zh-Hans.lproj/Localizable.strings
74
+ - template/circle/files/spec/main_spec.rb
75
+ - template/circle/files/spec/screens/home_screen_spec.rb
76
+ homepage: https://github.com/Lax/motion-templates
77
+ licenses:
78
+ - ''
79
+ metadata:
80
+ rubymotion_template_dir: template
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.5.2
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: rubymotion templates
101
+ test_files: []