ProMotion 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ProMotion/cocoatouch/navigation_controller.rb +1 -1
- data/lib/ProMotion/delegate/delegate_module.rb +4 -0
- data/lib/ProMotion/ipad/split_screen.rb +22 -2
- data/lib/ProMotion/screen/screen_module.rb +4 -4
- data/lib/ProMotion/screen/screen_navigation.rb +4 -0
- data/lib/ProMotion/table/extensions/longpressable.rb +11 -2
- data/lib/ProMotion/table/extensions/refreshable.rb +1 -1
- data/lib/ProMotion/table/table.rb +11 -6
- data/lib/ProMotion/version.rb +1 -1
- data/lib/ProMotion/web/web_screen_module.rb +30 -26
- data/spec/functional/func_split_screen_spec.rb +28 -33
- data/spec/functional/func_table_screen_spec.rb +13 -17
- data/spec/helpers/test_helper.rb +4 -0
- data/spec/unit/delegate_spec.rb +4 -0
- data/spec/unit/screen_spec.rb +11 -2
- data/spec/unit/split_screen_open_screen_spec.rb +2 -2
- data/spec/unit/tables/table_module_spec.rb +5 -2
- data/spec/unit/tables/table_screen_spec.rb +2 -1
- data/spec/unit/web_spec.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e264307519613c7c1033a8e73a4e42d2083c8b4
|
4
|
+
data.tar.gz: a6e9fb4061d6f0be4f6597636ce498d9322223ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b72a9713c795799f813c1700357852bfcd7f1d09865d7b4ec54f452e77fb76a2f1f141e03f2baa59ba403039e15a38f5caba8b5357e46857b9ff147246a2f743
|
7
|
+
data.tar.gz: 7cd41655578677b3344a4481a29bf4a3c4179ae9e68f6e424277eedaf6c42c67c5e59c83c3f95b840ca988be308fecfd6bc02679be800de0a80932cd7d11769a
|
@@ -16,15 +16,35 @@ module ProMotion
|
|
16
16
|
|
17
17
|
# UISplitViewControllerDelegate methods
|
18
18
|
|
19
|
-
|
19
|
+
# iOS 7 and below
|
20
|
+
def splitViewController(svc, willHideViewController: vc, withBarButtonItem: button, forPopoverController: _)
|
21
|
+
button ||= self.displayModeButtonItem if self.respond_to?(:displayModeButtonItem)
|
22
|
+
return unless button
|
20
23
|
button.title = @pm_split_screen_button_title || vc.title
|
21
24
|
svc.detail_screen.navigationItem.leftBarButtonItem = button
|
22
25
|
end
|
23
26
|
|
24
|
-
def splitViewController(svc, willShowViewController:
|
27
|
+
def splitViewController(svc, willShowViewController: _, invalidatingBarButtonItem: _)
|
25
28
|
svc.detail_screen.navigationItem.leftBarButtonItem = nil
|
26
29
|
end
|
27
30
|
|
31
|
+
# iOS 8 and above
|
32
|
+
def splitViewController(svc, willChangeToDisplayMode: display_mode)
|
33
|
+
vc = svc.viewControllers.first
|
34
|
+
vc = vc.topViewController if vc.respond_to?(:topViewController)
|
35
|
+
case display_mode
|
36
|
+
# when UISplitViewControllerDisplayModeAutomatic then do_something?
|
37
|
+
when UISplitViewControllerDisplayModePrimaryHidden
|
38
|
+
self.splitViewController(svc, willHideViewController: vc, withBarButtonItem: nil, forPopoverController: nil)
|
39
|
+
# TODO: Add `self.master_screen.try(:will_hide_split_screen)` or similar?
|
40
|
+
when UISplitViewControllerDisplayModeAllVisible
|
41
|
+
self.splitViewController(svc, willShowViewController: vc, invalidatingBarButtonItem: nil)
|
42
|
+
# TODO: Add `self.master_screen.try(:will_show_split_screen)` or similar?
|
43
|
+
# when UISplitViewControllerDisplayModePrimaryOverlay
|
44
|
+
# TODO: Add `self.master_screen.try(:will_show_split_screen_overlay)` or similar?
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
28
48
|
private
|
29
49
|
|
30
50
|
def split_screen_controller(master, detail)
|
@@ -166,6 +166,10 @@ module ProMotion
|
|
166
166
|
return self.view_or_self.frame
|
167
167
|
end
|
168
168
|
|
169
|
+
def try(method, *args)
|
170
|
+
send(method, *args) if respond_to?(method)
|
171
|
+
end
|
172
|
+
|
169
173
|
private
|
170
174
|
|
171
175
|
def apply_properties(args)
|
@@ -184,10 +188,6 @@ module ProMotion
|
|
184
188
|
end
|
185
189
|
end
|
186
190
|
|
187
|
-
def try(method, *args)
|
188
|
-
send(method, *args) if respond_to?(method)
|
189
|
-
end
|
190
|
-
|
191
191
|
# Class methods
|
192
192
|
module ClassMethods
|
193
193
|
def title(t=nil)
|
@@ -15,11 +15,20 @@ module ProMotion
|
|
15
15
|
|
16
16
|
def on_long_press(gesture)
|
17
17
|
return unless gesture.state == UIGestureRecognizerStateBegan
|
18
|
-
gesture_point = gesture.locationInView(
|
19
|
-
index_path =
|
18
|
+
gesture_point = gesture.locationInView(pressed_table_view)
|
19
|
+
index_path = pressed_table_view.indexPathForRowAtPoint(gesture_point)
|
20
|
+
return unless index_path
|
20
21
|
data_cell = self.promotion_table_data.cell(index_path: index_path)
|
22
|
+
return unless data_cell
|
21
23
|
trigger_action(data_cell[:long_press_action], data_cell[:arguments], index_path) if data_cell[:long_press_action]
|
22
24
|
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def pressed_table_view
|
29
|
+
searching? ? @table_search_display_controller.searchResultsTableView : table_view
|
30
|
+
end
|
31
|
+
|
23
32
|
end
|
24
33
|
end
|
25
34
|
end
|
@@ -21,7 +21,7 @@ module ProMotion
|
|
21
21
|
@refresh_control.beginRefreshing
|
22
22
|
|
23
23
|
# Scrolls the table down to show the refresh control when invoked programatically
|
24
|
-
|
24
|
+
tableView.setContentOffset(CGPointMake(0, tableView.contentOffset.y-@refresh_control.frame.size.height), animated:true) if tableView.contentOffset.y > -65.0
|
25
25
|
end
|
26
26
|
alias :begin_refreshing :start_refreshing
|
27
27
|
|
@@ -118,8 +118,7 @@ module ProMotion
|
|
118
118
|
|
119
119
|
def delete_row(index_paths, animation = nil)
|
120
120
|
deletable_index_paths = []
|
121
|
-
index_paths
|
122
|
-
index_paths.each do |index_path|
|
121
|
+
Array(index_paths).each do |index_path|
|
123
122
|
delete_cell = false
|
124
123
|
delete_cell = send(:on_cell_deleted, self.promotion_table_data.cell(index_path: index_path)) if self.respond_to?("on_cell_deleted:")
|
125
124
|
unless delete_cell == false
|
@@ -145,8 +144,7 @@ module ProMotion
|
|
145
144
|
end
|
146
145
|
|
147
146
|
def update_table_data(args = {})
|
148
|
-
|
149
|
-
args = { index_paths: args } if args.is_a?(NSIndexPath) || (args.is_a?(Array) && array_all_members_of?(args, NSIndexPath))
|
147
|
+
args = { index_paths: args } unless args.is_a?(Hash)
|
150
148
|
|
151
149
|
self.update_table_view_data(self.table_data, args)
|
152
150
|
self.promotion_table_data.search(search_string) if searching?
|
@@ -280,7 +278,7 @@ module ProMotion
|
|
280
278
|
# Section view methods
|
281
279
|
def tableView(table_view, viewForHeaderInSection: index)
|
282
280
|
section = promotion_table_data.section(index)
|
283
|
-
view =
|
281
|
+
view = section[:title_view]
|
284
282
|
view = section[:title_view].new if section[:title_view].respond_to?(:new)
|
285
283
|
view.title = section[:title] if view.respond_to?(:title=)
|
286
284
|
view
|
@@ -325,7 +323,14 @@ module ProMotion
|
|
325
323
|
end
|
326
324
|
|
327
325
|
def row_height(height, args={})
|
328
|
-
|
326
|
+
if height == :auto
|
327
|
+
if UIDevice.currentDevice.systemVersion.to_f < 8.0
|
328
|
+
height = args[:estimated] || 44.0
|
329
|
+
PM.logger.warn "Using `row_height :auto` is not supported in iOS 7 apps. Setting to #{height}."
|
330
|
+
else
|
331
|
+
height = UITableViewAutomaticDimension
|
332
|
+
end
|
333
|
+
end
|
329
334
|
args[:estimated] ||= height unless height == UITableViewAutomaticDimension
|
330
335
|
@row_height = { height: height, estimated: args[:estimated] || 44.0 }
|
331
336
|
end
|
data/lib/ProMotion/version.rb
CHANGED
@@ -8,26 +8,24 @@ module ProMotion
|
|
8
8
|
self.external_links ||= false
|
9
9
|
self.scale_to_fit ||= false
|
10
10
|
self.detector_types ||= :none
|
11
|
+
|
12
|
+
web_view_setup
|
13
|
+
set_initial_content
|
11
14
|
end
|
12
15
|
|
13
16
|
def on_init
|
14
|
-
|
15
|
-
|
16
|
-
self.detector_types.each { |dt| detectors |= map_detector_symbol(dt) }
|
17
|
-
self.detector_types = detectors
|
18
|
-
else
|
19
|
-
self.detector_types = map_detector_symbol(self.detector_types)
|
20
|
-
end
|
17
|
+
# TODO: Remove in 3.0
|
18
|
+
end
|
21
19
|
|
20
|
+
def web_view_setup
|
22
21
|
self.webview ||= add UIWebView.new, {
|
23
22
|
frame: CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height),
|
24
23
|
delegate: self,
|
25
|
-
data_detector_types:
|
24
|
+
data_detector_types: data_detector_types
|
26
25
|
}
|
27
26
|
self.webview.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight
|
28
27
|
self.webview.scalesPageToFit = self.scale_to_fit
|
29
28
|
self.webview.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal
|
30
|
-
set_initial_content
|
31
29
|
end
|
32
30
|
|
33
31
|
def web
|
@@ -35,10 +33,8 @@ module ProMotion
|
|
35
33
|
end
|
36
34
|
|
37
35
|
def set_initial_content
|
38
|
-
return unless self.respond_to?(:content)
|
39
|
-
|
40
|
-
return unless current_content
|
41
|
-
current_content.is_a?(NSURL) ? open_url(current_content) : set_content(current_content)
|
36
|
+
return unless self.respond_to?(:content) && self.content
|
37
|
+
self.content.is_a?(NSURL) ? open_url(self.content) : set_content(self.content)
|
42
38
|
end
|
43
39
|
|
44
40
|
def set_content(content)
|
@@ -104,32 +100,34 @@ module ProMotion
|
|
104
100
|
def stop; web.stopLoading; end
|
105
101
|
alias :reload :refresh
|
106
102
|
|
107
|
-
def open_in_chrome(
|
103
|
+
def open_in_chrome(in_request)
|
108
104
|
# Add pod 'OpenInChrome' to your Rakefile if you want links to open in Google Chrome for users.
|
109
105
|
# This will fall back to Safari if the user doesn't have Chrome installed.
|
110
106
|
chrome_controller = OpenInChromeController.sharedInstance
|
111
|
-
return open_in_safari(
|
112
|
-
chrome_controller.openInChrome(
|
107
|
+
return open_in_safari(in_request) unless chrome_controller.isChromeInstalled
|
108
|
+
chrome_controller.openInChrome(in_request.URL)
|
113
109
|
end
|
114
110
|
|
115
|
-
def open_in_safari(
|
111
|
+
def open_in_safari(in_request)
|
116
112
|
# Open UIWebView delegate links in Safari.
|
117
|
-
UIApplication.sharedApplication.openURL(
|
113
|
+
UIApplication.sharedApplication.openURL(in_request.URL)
|
118
114
|
end
|
119
115
|
|
120
116
|
# UIWebViewDelegate Methods - Camelcase
|
121
|
-
def webView(
|
122
|
-
if
|
123
|
-
if
|
124
|
-
|
125
|
-
|
126
|
-
|
117
|
+
def webView(in_web, shouldStartLoadWithRequest:in_request, navigationType:in_type)
|
118
|
+
if %w(http https).include?(in_request.URL.scheme)
|
119
|
+
if self.external_links == true && in_type == UIWebViewNavigationTypeLinkClicked
|
120
|
+
if defined?(OpenInChromeController)
|
121
|
+
open_in_chrome in_request
|
122
|
+
else
|
123
|
+
open_in_safari in_request
|
124
|
+
end
|
125
|
+
return false # don't allow the web view to load the link.
|
127
126
|
end
|
128
|
-
return false #don't allow the web view to load the link.
|
129
127
|
end
|
130
128
|
|
131
129
|
load_request_enable = true #return true on default for local file loading.
|
132
|
-
load_request_enable = !!on_request(
|
130
|
+
load_request_enable = !!on_request(in_request, in_type) if self.respond_to?(:on_request)
|
133
131
|
load_request_enable
|
134
132
|
end
|
135
133
|
|
@@ -147,6 +145,12 @@ module ProMotion
|
|
147
145
|
|
148
146
|
protected
|
149
147
|
|
148
|
+
def data_detector_types
|
149
|
+
Array(self.detector_types).reduce(UIDataDetectorTypeNone) do |detectors, dt|
|
150
|
+
detectors | map_detector_symbol(dt)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
150
154
|
def map_detector_symbol(symbol)
|
151
155
|
{
|
152
156
|
phone: UIDataDetectorTypePhoneNumber,
|
@@ -6,11 +6,12 @@ describe "Split screen functionality" do
|
|
6
6
|
@app ||= TestDelegate.new
|
7
7
|
@master = MasterScreen.new(nav_bar: true)
|
8
8
|
@detail = DetailScreen.new(nav_bar: true)
|
9
|
-
@controller ||= @app.create_split_screen @master, @detail
|
9
|
+
@controller ||= @app.create_split_screen @master, @detail, { button_title: "Test Title" }
|
10
10
|
end
|
11
11
|
|
12
12
|
before do
|
13
13
|
UIView.setAnimationDuration 0.01
|
14
|
+
UIView.setAnimationsEnabled false
|
14
15
|
rotate_device to: :landscape, button: :right
|
15
16
|
end
|
16
17
|
|
@@ -20,63 +21,57 @@ describe "Split screen functionality" do
|
|
20
21
|
|
21
22
|
it "should allow opening a detail view from the master view" do
|
22
23
|
|
23
|
-
@master.open BasicScreen.new(nav_bar: true), in_detail: true
|
24
|
+
@master.open BasicScreen.new(nav_bar: true), in_detail: true, animated: false
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
views(UINavigationItemView).each { |v| v.title.should.not == "Detail" }
|
29
|
-
end
|
26
|
+
view("Master").should.be.kind_of UINavigationItemView
|
27
|
+
view("Basic").should.be.kind_of UINavigationItemView
|
28
|
+
views(UINavigationItemView).each { |v| v.title.should.not == "Detail" }
|
30
29
|
|
31
30
|
end
|
32
31
|
|
33
32
|
it "should allow opening another view from the master view" do
|
34
33
|
|
35
|
-
@master.open BasicScreen
|
34
|
+
@master.open BasicScreen, animated: false
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
view("Detail").should.be.kind_of UINavigationItemView
|
40
|
-
end
|
36
|
+
view("Basic").should.be.kind_of UINavigationItemView
|
37
|
+
view("Detail").should.be.kind_of UINavigationItemView
|
41
38
|
|
42
39
|
end
|
43
40
|
|
44
41
|
it "should allow opening a master view from the detail view" do
|
45
42
|
|
46
|
-
@detail.open BasicScreen.new(nav_bar: true), in_master: true
|
43
|
+
@detail.open BasicScreen.new(nav_bar: true), in_master: true, animated: false
|
47
44
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
views(UINavigationItemView).each { |v| v.title.should.not == "Master" }
|
52
|
-
end
|
45
|
+
view("Basic").should.be.kind_of UINavigationItemView
|
46
|
+
view("Detail").should.be.kind_of UINavigationItemView
|
47
|
+
views(UINavigationItemView).each { |v| v.title.should.not == "Master" }
|
53
48
|
|
54
49
|
end
|
55
50
|
|
56
51
|
it "should allow opening another view from the detail view" do
|
57
52
|
|
58
|
-
@detail.open BasicScreen
|
53
|
+
@detail.open BasicScreen, animated: false
|
59
54
|
|
60
|
-
|
61
|
-
|
62
|
-
view("Master").should.be.kind_of UINavigationItemView
|
63
|
-
end
|
55
|
+
view("Basic").should.be.kind_of UINavigationItemView
|
56
|
+
view("Master").should.be.kind_of UINavigationItemView
|
64
57
|
|
65
58
|
end
|
66
59
|
|
67
|
-
|
68
|
-
|
60
|
+
unless ENV['TRAVIS_CI'] # TODO: Why won't Travis pass these tests??
|
61
|
+
it "should override the title on the button" do
|
62
|
+
rotate_device to: :portrait, button: :bottom
|
69
63
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
64
|
+
@detail.navigationItem.should.be.kind_of UINavigationItem
|
65
|
+
@detail.navigationItem.leftBarButtonItem.should.be.kind_of UIBarButtonItem
|
66
|
+
@detail.navigationItem.leftBarButtonItem.title.should == "Test Title"
|
67
|
+
end
|
74
68
|
|
75
|
-
|
76
|
-
|
69
|
+
it "should override the default swipe action, that reveals the menu" do
|
70
|
+
rotate_device to: :portrait, button: :bottom
|
77
71
|
|
78
|
-
|
79
|
-
|
72
|
+
@alt_controller = @app.open_split_screen @master, @detail, swipe: false
|
73
|
+
@app.home_screen.presentsWithGesture.should == false
|
74
|
+
end
|
80
75
|
end
|
81
76
|
|
82
77
|
end
|
@@ -2,15 +2,11 @@ describe "ProMotion::TableScreen functionality" do
|
|
2
2
|
tests PM::TestTableScreen
|
3
3
|
|
4
4
|
def table_screen
|
5
|
-
@table_screen ||=
|
6
|
-
t = TestTableScreen.new(nav_bar: true)
|
7
|
-
t.on_load
|
8
|
-
t
|
9
|
-
end
|
5
|
+
@table_screen ||= TestTableScreen.new(nav_bar: true)
|
10
6
|
end
|
11
7
|
|
12
8
|
def controller
|
13
|
-
rotate_device to: :portrait, button: :bottom
|
9
|
+
# rotate_device to: :portrait, button: :bottom
|
14
10
|
table_screen.navigationController
|
15
11
|
end
|
16
12
|
|
@@ -22,8 +18,6 @@ describe "ProMotion::TableScreen functionality" do
|
|
22
18
|
TestHelper.ios7 ? "UILabel" : "UITableViewLabel"
|
23
19
|
end
|
24
20
|
|
25
|
-
before { UIView.setAnimationDuration 0.01 }
|
26
|
-
|
27
21
|
after { @table_screen = nil }
|
28
22
|
|
29
23
|
it "should have a navigation bar" do
|
@@ -45,16 +39,18 @@ describe "ProMotion::TableScreen functionality" do
|
|
45
39
|
table_screen.should == table_screen
|
46
40
|
end
|
47
41
|
|
48
|
-
|
49
|
-
tap
|
50
|
-
|
51
|
-
|
42
|
+
unless ENV['TRAVIS_CI']
|
43
|
+
it "should increment the tap counter by one on tap" do
|
44
|
+
tap("Increment One")
|
45
|
+
table_screen.tap_counter.should == 1
|
46
|
+
end
|
52
47
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
48
|
+
it "should delete the specified row from the table view on tap" do
|
49
|
+
table_screen.tableView(table_screen.tableView, numberOfRowsInSection:0).should == 7
|
50
|
+
tap("Delete the row below")
|
51
|
+
wait 0.11 do
|
52
|
+
table_screen.tableView(table_screen.tableView, numberOfRowsInSection:0).should == 6
|
53
|
+
end
|
58
54
|
end
|
59
55
|
end
|
60
56
|
|
data/spec/helpers/test_helper.rb
CHANGED
data/spec/unit/delegate_spec.rb
CHANGED
@@ -80,6 +80,10 @@ describe "PM::Delegate" do
|
|
80
80
|
@subject.application(UIApplication.sharedApplication, openURL: url, sourceApplication:sourceApplication, annotation: annotation)
|
81
81
|
end
|
82
82
|
|
83
|
+
it "should have an awesome convenience method for UIApplication.sharedApplication" do
|
84
|
+
@subject.app.should == UIApplication.sharedApplication
|
85
|
+
end
|
86
|
+
|
83
87
|
end
|
84
88
|
|
85
89
|
# iOS 7 ONLY tests
|
data/spec/unit/screen_spec.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
describe "screen properties" do
|
2
2
|
|
3
3
|
before do
|
4
|
-
|
5
4
|
# Simulate AppDelegate setup of main screen
|
6
5
|
@screen = HomeScreen.new modal: true, nav_bar: true
|
7
6
|
@screen.on_load
|
8
|
-
|
9
7
|
end
|
10
8
|
|
11
9
|
it "should store title" do
|
@@ -84,12 +82,23 @@ describe "screen properties" do
|
|
84
82
|
parent_screen.navigationController.shouldAutorotate
|
85
83
|
end
|
86
84
|
|
85
|
+
it "#should_autorotate shouldn't crash when NavigationController's visibleViewController is nil" do
|
86
|
+
parent_screen = BasicScreen.new(nav_bar: true)
|
87
|
+
parent_screen.open @screen, animated: false
|
88
|
+
@screen.navigationController.mock!(:visibleViewController) { nil }
|
89
|
+
parent_screen.navigationController.shouldAutorotate
|
90
|
+
end
|
91
|
+
|
87
92
|
# <= iOS 5 only
|
88
93
|
it "#should_rotate(orientation) should fire when shouldAutorotateToInterfaceOrientation(orientation) fires" do
|
89
94
|
@screen.mock!(:should_rotate) { |orientation| orientation.should == UIInterfaceOrientationMaskPortrait }
|
90
95
|
@screen.shouldAutorotateToInterfaceOrientation(UIInterfaceOrientationMaskPortrait)
|
91
96
|
end
|
92
97
|
|
98
|
+
it "should have an awesome convenience method for UIApplication.sharedApplication" do
|
99
|
+
@screen.app.should == UIApplication.sharedApplication
|
100
|
+
end
|
101
|
+
|
93
102
|
describe "iOS lifecycle methods" do
|
94
103
|
|
95
104
|
it "-viewDidLoad" do
|
@@ -15,7 +15,7 @@ describe "split screen `open` functionality" do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should open a new screen in the detail view" do
|
18
|
-
screen = @master_screen.open @detail_screen_2, in_detail: true
|
18
|
+
screen = @master_screen.open @detail_screen_2, in_detail: true, animated: false
|
19
19
|
@split_screen.detail_screen.should == @detail_screen_2
|
20
20
|
@split_screen.viewControllers.first.should == (@master_screen.navigationController || @master_screen)
|
21
21
|
@split_screen.viewControllers.last.should == (@detail_screen_2.navigationController || @detail_screen_2)
|
@@ -23,7 +23,7 @@ describe "split screen `open` functionality" do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should open a new screen in the master view" do
|
26
|
-
screen = @detail_screen_1.open @detail_screen_2, in_master: true
|
26
|
+
screen = @detail_screen_1.open @detail_screen_2, in_master: true, animated: false
|
27
27
|
@split_screen.master_screen.should == @detail_screen_2
|
28
28
|
@split_screen.viewControllers.first.should == (@detail_screen_2.navigationController || @detail_screen_2)
|
29
29
|
@split_screen.viewControllers.last.should == (@detail_screen_1.navigationController || @detail_screen_1)
|
@@ -43,7 +43,7 @@ describe "PM::Table module" do
|
|
43
43
|
|
44
44
|
def default_cell_height
|
45
45
|
return UITableViewAutomaticDimension if TestHelper.ios8
|
46
|
-
return
|
46
|
+
return 97.0 if TestHelper.ios7 # Normally 44, but 97 because of `row_height` designation
|
47
47
|
end
|
48
48
|
|
49
49
|
def default_header_height
|
@@ -140,7 +140,6 @@ describe "PM::Table module" do
|
|
140
140
|
@subject.tableView(@subject.table_view, didSelectRowAtIndexPath:ip)
|
141
141
|
|
142
142
|
tapped_ip = @subject.got_index_path
|
143
|
-
tapped_ip.should.be.kind_of NSIndexPath
|
144
143
|
tapped_ip.section.should == 6
|
145
144
|
tapped_ip.row.should == 0
|
146
145
|
end
|
@@ -191,6 +190,10 @@ describe "PM::Table module" do
|
|
191
190
|
@subject.tableView(@subject.table_view, heightForHeaderInSection:5).should == 50.0
|
192
191
|
end
|
193
192
|
|
193
|
+
it "should use the instantiated section view if one is specified" do
|
194
|
+
cell = @subject.tableView(@subject.table_view, viewForHeaderInSection: 5)
|
195
|
+
cell.should.be.kind_of(CustomTitleView)
|
196
|
+
end
|
194
197
|
end
|
195
198
|
|
196
199
|
end
|
@@ -51,7 +51,8 @@ describe "table screens" do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it "sets the auto row height and estimated row height properly" do
|
54
|
-
@screen.view.rowHeight.should == UITableViewAutomaticDimension
|
54
|
+
@screen.view.rowHeight.should == UITableViewAutomaticDimension if TestHelper.gte_ios8
|
55
|
+
@screen.view.rowHeight.should == 97 unless TestHelper.gte_ios8
|
55
56
|
@screen.view.estimatedRowHeight.should == 97
|
56
57
|
end
|
57
58
|
|
data/spec/unit/web_spec.rb
CHANGED
@@ -4,6 +4,11 @@ describe "web screen properties" do
|
|
4
4
|
before { disable_network_access! }
|
5
5
|
after { enable_network_access! }
|
6
6
|
|
7
|
+
it "should leave on_init available as a hook" do
|
8
|
+
webscreen = TestWebScreen.new()
|
9
|
+
webscreen.on_init_available?.should == true
|
10
|
+
end
|
11
|
+
|
7
12
|
describe "when open web page with http request" do
|
8
13
|
before do
|
9
14
|
class TestWebScreenWithHTTPRequest < TestWebScreen
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ProMotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamon Holmgren
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2015-01-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: methadone
|
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
183
|
rubyforge_project:
|
184
|
-
rubygems_version: 2.
|
184
|
+
rubygems_version: 2.4.5
|
185
185
|
signing_key:
|
186
186
|
specification_version: 4
|
187
187
|
summary: ProMotion is a fast way to get started building RubyMotion apps. Instead
|