ProMotion 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be839599d650130f82f0fa241e88bf2b76fc4964
4
- data.tar.gz: b1f0799f8f393b3de1d8b60307b6e256225682c3
3
+ metadata.gz: 22dee782b5f904dab39ce97ce900fe1012daf866
4
+ data.tar.gz: 92a7e426f1d01a67fa8a8431d23f912109e14322
5
5
  SHA512:
6
- metadata.gz: 3fedb2aff2f4df877da8a384599ea6aaec3ef572c479016a7fc84d8447b4089459a88ef1611502df27668bd29a2fa25f597d7c83333ffeae5c26091b43a1e88c
7
- data.tar.gz: 54c0ccb64e0eb8dab7b113efa724ce33e239d2b6464a69107ba5087ec9d6025f6306ddbda274980f944770769d72ff35ff2b6d56d7fc06320e2def33409de071
6
+ metadata.gz: ad1fd5927fa02167ecb552141242827953fc22288e625ab342ec592ff2ef26da757f76c37f7d88657cb5df7968873ca97188fd99f3abd7d545f324d4328cdc0b
7
+ data.tar.gz: 773bb526a2679efdc727e460e59b087cdb8d599c3264c6838279605af19117ba0cbd2bf600c8849cffe2ee90a54732dc39608e67f616033d7edd8cffe6ea0b68
data/README.md CHANGED
@@ -132,10 +132,14 @@ If you need help, feel free to open an issue on GitHub. If we don't respond with
132
132
 
133
133
  See [CONTRIBUTING.md](https://github.com/clearsightstudio/ProMotion/blob/master/CONTRIBUTING.md).
134
134
 
135
- ## Primary Contributors
135
+ ## Core Team
136
136
 
137
137
  * Jamon Holmgren: [@jamonholmgren](https://twitter.com/jamonholmgren)
138
138
  * Silas Matson: [@silasjmatson](https://twitter.com/silasjmatson)
139
139
  * Mark Rickert: [@markrickert](https://twitter.com/markrickert)
140
140
  * Ryan Linton: [@ryanlntn](https://twitter.com/ryanlntn)
141
+ * David Larrabee: [@squidpunch](https://twitter.com/squidpunch)
142
+
143
+ ## Other Contributors
144
+
141
145
  * [Many others](https://github.com/clearsightstudio/ProMotion/graphs/contributors)
@@ -42,9 +42,13 @@ module ProMotion
42
42
  when :light
43
43
  status_bar_hidden false
44
44
  status_bar_style UIStatusBarStyleLightContent
45
- else
45
+ when :dark
46
46
  status_bar_hidden false
47
47
  status_bar_style UIStatusBarStyleDefault
48
+ else
49
+ status_bar_hidden false
50
+ global_style = NSBundle.mainBundle.objectForInfoDictionaryKey("UIStatusBarStyle")
51
+ status_bar_style global_style ? Object.const_get(global_style) : UIStatusBarStyleDefault
48
52
  end
49
53
  end
50
54
 
@@ -20,6 +20,7 @@ module ProMotion
20
20
  set_up_refreshable
21
21
  set_up_longpressable
22
22
  set_up_row_height
23
+ set_up_accessibility
23
24
  end
24
25
 
25
26
  def check_table_data
@@ -89,6 +90,19 @@ module ProMotion
89
90
  end
90
91
  end
91
92
 
93
+ def editable?
94
+ self.promotion_table_data.sections.each do |section|
95
+ section[:cells].each do |cell|
96
+ return true if [:insert,:delete].include?(cell[:editing_style])
97
+ end
98
+ end
99
+ false
100
+ end
101
+
102
+ def set_up_accessibility
103
+ self.extend(Editable) if editable?
104
+ end
105
+
92
106
  def searching?
93
107
  self.promotion_table_data.filtered
94
108
  end
@@ -155,14 +169,22 @@ module ProMotion
155
169
  new_cell.extend(PM::TableViewCellModule) unless new_cell.is_a?(PM::TableViewCellModule)
156
170
  new_cell.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin
157
171
  new_cell.clipsToBounds = true # fix for changed default in 7.1
158
- new_cell.send(:on_load) if new_cell.respond_to?(:on_load)
172
+ on_cell_created new_cell, data_cell
159
173
  new_cell
160
174
  end
161
175
  table_cell.setup(data_cell, self) if table_cell.respond_to?(:setup)
162
- table_cell.send(:on_reuse) if !new_cell && table_cell.respond_to?(:on_reuse)
176
+ on_cell_reused(table_cell, data_cell) if !new_cell
163
177
  table_cell
164
178
  end
165
179
 
180
+ def on_cell_created(new_cell, data_cell)
181
+ new_cell.send(:on_load) if new_cell.respond_to?(:on_load)
182
+ end
183
+
184
+ def on_cell_reused(cell, data)
185
+ cell.send(:on_reuse) if cell.respond_to?(:on_reuse)
186
+ end
187
+
166
188
  def update_table_data(args = {})
167
189
  args = { index_paths: args } unless args.is_a?(Hash)
168
190
 
@@ -235,9 +257,11 @@ module ProMotion
235
257
  map_cell_editing_style(data_cell[:editing_style])
236
258
  end
237
259
 
238
- def tableView(_, commitEditingStyle: editing_style, forRowAtIndexPath: index_path)
239
- if editing_style == UITableViewCellEditingStyleDelete
240
- delete_row(index_path)
260
+ module Editable
261
+ def tableView(_, commitEditingStyle: editing_style, forRowAtIndexPath: index_path)
262
+ if editing_style == UITableViewCellEditingStyleDelete
263
+ delete_row(index_path)
264
+ end
241
265
  end
242
266
  end
243
267
 
@@ -1,3 +1,3 @@
1
1
  module ProMotion
2
- VERSION = "2.3.0" unless defined?(ProMotion::VERSION)
2
+ VERSION = "2.3.1" unless defined?(ProMotion::VERSION)
3
3
  end
@@ -43,6 +43,24 @@ describe "screen properties" do
43
43
  UIApplication.sharedApplication.statusBarStyle.should == UIStatusBarStyleLightContent
44
44
  end
45
45
 
46
+ it "should set the UIStatusBar style to :dark" do
47
+ UIApplication.sharedApplication.statusBarStyle = UIStatusBarStyleLightContent
48
+ @screen.class.status_bar :dark
49
+ @screen.view_will_appear(false)
50
+ UIApplication.sharedApplication.isStatusBarHidden.should == false
51
+ UIApplication.sharedApplication.statusBarStyle.should == UIStatusBarStyleDefault
52
+ end
53
+
54
+ it "should default to a global UIStatusBar style" do
55
+ NSBundle.mainBundle.mock!(:objectForInfoDictionaryKey) do |key|
56
+ "UIStatusBarStyleLightContent"
57
+ end
58
+ @screen.class.status_bar :default
59
+ @screen.view_will_appear(false)
60
+ UIApplication.sharedApplication.isStatusBarHidden.should == false
61
+ UIApplication.sharedApplication.statusBarStyle.should == UIStatusBarStyleLightContent
62
+ end
63
+
46
64
  it "should set the tab bar item with a system item" do
47
65
  @screen.set_tab_bar_item system_item: :contacts
48
66
  comparison = UITabBarItem.alloc.initWithTabBarSystemItem(UITabBarSystemItemContacts, tag: 0)
@@ -63,6 +63,28 @@ describe "table screens" do
63
63
  screen.view.estimatedRowHeight.should == 77
64
64
  end
65
65
 
66
+ it "sets up proper accessibility methods" do
67
+ class NoneditableTableScreen < PM::TableScreen
68
+ def on_load
69
+ end
70
+
71
+ def table_data
72
+ [{
73
+ title: "test",
74
+ cells: [{ title: "Non-editable test" }]
75
+ }]
76
+ end
77
+ end
78
+
79
+ noneditable = NoneditableTableScreen.new
80
+ noneditable.on_load
81
+ noneditable.editable?.should==false
82
+ index_path = NSIndexPath.indexPathForRow(0, inSection: 0)
83
+ lambda { noneditable.tableView(noneditable, commitEditingStyle: UITableViewCellEditingStyleDelete, forRowAtIndexPath: index_path) }.should.raise NoMethodError
84
+ @screen.editable?.should == true
85
+ @screen.should.respond_to(:"tableView:commitEditingStyle:forRowAtIndexPath")
86
+ end
87
+
66
88
  end
67
89
 
68
90
  describe "search functionality" do
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.3.0
4
+ version: 2.3.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: 2015-04-03 00:00:00.000000000 Z
13
+ date: 2015-05-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: methadone