formotion 1.7 → 1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/Formotion.gemspec +3 -3
- data/LIST_OF_ROW_TYPES.md +22 -0
- data/lib/formotion/patch/ui_text_field.rb +2 -2
- data/lib/formotion/row/row.rb +3 -0
- data/lib/formotion/row_type/activity_view_row.rb +34 -0
- data/lib/formotion/row_type/base.rb +36 -1
- data/lib/formotion/row_type/date_row.rb +1 -1
- data/lib/formotion/row_type/map_row.rb +2 -0
- data/lib/formotion/row_type/number_row.rb +2 -2
- data/lib/formotion/row_type/picker_row.rb +1 -33
- data/lib/formotion/row_type/string_row.rb +1 -31
- data/lib/formotion/row_type/subform_row.rb +6 -2
- data/lib/formotion/row_type/text_row.rb +6 -0
- data/lib/formotion/row_type/web_link_row.rb +2 -0
- data/lib/formotion/version.rb +1 -1
- data/spec/functional/activity_vew_row_spec.rb +147 -0
- data/spec/helpers/row_test_helpers.rb +7 -2
- data/spec/row_type/currency_spec.rb +2 -1
- data/spec/row_type/date_spec.rb +3 -3
- data/spec/row_type/string_spec.rb +9 -0
- data/spec/row_type/text_spec.rb +10 -1
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed8446942f6c85ea538307350689da1cafe64b9c
|
4
|
+
data.tar.gz: 6f9d750dcde96960edfcb415f6c94a1ffdd78efc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 999f07ab03dbebaf2061b3e45cada0af5150af28f1c71bd16f60ccf95ebbdd0599d359cf12639543745dd4830ab00b1756a56da95badf168b22e045d71123d57
|
7
|
+
data.tar.gz: 21675bd656d0b7a9c832418f7c8c4ba7a7b52e4312d70ff7b24a1e4b3e7a92c6876b75ebd6c4e64dab0fd6e45802405929b5a0446b64e80cf4060d515b5ab36d
|
data/.travis.yml
CHANGED
@@ -1,3 +1,10 @@
|
|
1
1
|
language: objective-c
|
2
2
|
install: bundle install
|
3
|
+
before_install:
|
4
|
+
- (ruby --version)
|
5
|
+
- sudo chown -R travis ~/Library/RubyMotion
|
6
|
+
- mkdir -p ~/Library/RubyMotion/build
|
7
|
+
- sudo motion update
|
8
|
+
- bundle install
|
9
|
+
- bundle exec rake pod:install
|
3
10
|
script: bundle exec rake spec:units
|
data/Formotion.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.require_paths = ["lib"]
|
16
16
|
s.license = 'MIT'
|
17
17
|
|
18
|
-
s.add_dependency "bubble-wrap", "
|
19
|
-
s.add_dependency "motion-require", "
|
18
|
+
s.add_dependency "bubble-wrap", ">= 1.4.0"
|
19
|
+
s.add_dependency "motion-require", ">= 0.1.0"
|
20
20
|
s.add_development_dependency 'rake'
|
21
|
-
end
|
21
|
+
end
|
data/LIST_OF_ROW_TYPES.md
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
[Currency](#currency)<br/>
|
8
8
|
[Date](#date)<br/>
|
9
9
|
[Object](#object)<br/>
|
10
|
+
[Activity](#activity)<br/>
|
10
11
|
|
11
12
|
**Other**<br/>
|
12
13
|
[Static](#static)<br/>
|
@@ -236,7 +237,28 @@ the default is the Apple default of 1.
|
|
236
237
|
Same as StringRow with the difference that it would not change the row.value to string.
|
237
238
|
The object needs a to_s method.
|
238
239
|
|
240
|
+
### <a name="activity"></a> Activity row
|
239
241
|
|
242
|
+
```ruby
|
243
|
+
{
|
244
|
+
title: "Share something",
|
245
|
+
type: :activity,
|
246
|
+
value: "Something I want to share."
|
247
|
+
}
|
248
|
+
```
|
249
|
+
|
250
|
+
Creates a `UIActivityViewController` for you with the contents of `:value`. You can also pass a Hash to value:
|
251
|
+
|
252
|
+
```ruby
|
253
|
+
{
|
254
|
+
title: "Share something",
|
255
|
+
type: :activity,
|
256
|
+
value: {
|
257
|
+
items: "Something I want to share.", # Can be a String, NSURL, or UIImage or Array of those types
|
258
|
+
excluded: [] # Types of activities to exclude. See the UIActivity class docs for a list of activity types.
|
259
|
+
}
|
260
|
+
}
|
261
|
+
```
|
240
262
|
|
241
263
|
## Other
|
242
264
|
|
@@ -115,7 +115,7 @@ class UITextField_Delegate
|
|
115
115
|
return self.textFieldShouldEndEditing_callback.call(theTextField)
|
116
116
|
end
|
117
117
|
|
118
|
-
if Device.ios_version >= "7.0"
|
118
|
+
if BW::Device.ios_version >= "7.0"
|
119
119
|
theTextField.text = theTextField.text.gsub("\u00a0", " ").strip
|
120
120
|
end
|
121
121
|
|
@@ -134,7 +134,7 @@ class UITextField_Delegate
|
|
134
134
|
end
|
135
135
|
|
136
136
|
# fix for UITextField in iOS7 http://stackoverflow.com/questions/19569688/uitextfield-spacebar-does-not-advance-cursor-in-ios-7/20129483#20129483
|
137
|
-
if Device.ios_version >= "7.0"
|
137
|
+
if BW::Device.ios_version >= "7.0"
|
138
138
|
if range.location == theTextField.text.length && string == " "
|
139
139
|
theTextField.text = theTextField.text.stringByAppendingString("\u00a0")
|
140
140
|
return false
|
data/lib/formotion/row/row.rb
CHANGED
@@ -102,6 +102,9 @@ module Formotion
|
|
102
102
|
# OPTIONS: :done (a black translucent toolbar with a right-aligned "Done" button)
|
103
103
|
# DEFAULT is nil
|
104
104
|
:input_accessory,
|
105
|
+
# Call a method when the input accessory is tapped.
|
106
|
+
# Default is nil
|
107
|
+
:done_action,
|
105
108
|
# Cell selection style
|
106
109
|
# OPTIONS: :blue, :gray, :none
|
107
110
|
# DEFAULT is :blue
|
@@ -0,0 +1,34 @@
|
|
1
|
+
motion_require 'object_row'
|
2
|
+
|
3
|
+
module Formotion
|
4
|
+
module RowType
|
5
|
+
class ActivityRow < ObjectRow
|
6
|
+
|
7
|
+
def after_build(cell)
|
8
|
+
super
|
9
|
+
|
10
|
+
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator
|
11
|
+
self.row.text_field.hidden = true
|
12
|
+
|
13
|
+
row.value = {items:[row.value]} unless row.value.is_a?(Hash)
|
14
|
+
row.value = {
|
15
|
+
excluded: [],
|
16
|
+
animated: true,
|
17
|
+
app_activities: nil,
|
18
|
+
completion: nil
|
19
|
+
}.merge(row.value)
|
20
|
+
row.value[:items] = [row.value[:items]] unless row.value[:items].is_a?(Array)
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
def on_select(tableView, tableViewDelegate)
|
25
|
+
activity_vc = UIActivityViewController.alloc.initWithActivityItems(row.value[:items], applicationActivities:row.value[:app_activities])
|
26
|
+
activity_vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical
|
27
|
+
activity_vc.excludedActivityTypes = row.value[:excluded]
|
28
|
+
|
29
|
+
row.form.controller.presentViewController(activity_vc, animated:row.value[:animated], completion:row.value[:completion])
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -4,7 +4,7 @@ module Formotion
|
|
4
4
|
attr_accessor :row, :tableView
|
5
5
|
|
6
6
|
def self.field_buffer
|
7
|
-
if Device.iphone? or App.window.size.width <= 320
|
7
|
+
if BW::Device.iphone? or App.window.size.width <= 320 or BW::Device.ios_version >= "7.0"
|
8
8
|
20
|
9
9
|
else
|
10
10
|
64
|
@@ -111,6 +111,41 @@ module Formotion
|
|
111
111
|
block.call
|
112
112
|
@semaphore = false
|
113
113
|
end
|
114
|
+
|
115
|
+
# Creates the inputAccessoryView to show
|
116
|
+
# if input_accessory property is set on row.
|
117
|
+
# :done is currently the only supported option.
|
118
|
+
def input_accessory_view(input_accessory)
|
119
|
+
case input_accessory
|
120
|
+
when :done
|
121
|
+
@input_accessory ||= begin
|
122
|
+
tool_bar = UIToolbar.alloc.initWithFrame([[0, 0], [0, 44]])
|
123
|
+
tool_bar.autoresizingMask = UIViewAutoresizingFlexibleWidth
|
124
|
+
tool_bar.translucent = true
|
125
|
+
|
126
|
+
left_space = UIBarButtonItem.alloc.initWithBarButtonSystemItem(
|
127
|
+
UIBarButtonSystemItemFlexibleSpace,
|
128
|
+
target: nil,
|
129
|
+
action: nil)
|
130
|
+
|
131
|
+
done_button = UIBarButtonItem.alloc.initWithBarButtonSystemItem(
|
132
|
+
UIBarButtonSystemItemDone,
|
133
|
+
target: self,
|
134
|
+
action: :done_editing)
|
135
|
+
|
136
|
+
tool_bar.items = [left_space, done_button]
|
137
|
+
|
138
|
+
tool_bar
|
139
|
+
end
|
140
|
+
else
|
141
|
+
nil
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def done_editing
|
146
|
+
NSLog "Please implement the done_editing method in your new cell type."
|
147
|
+
end
|
148
|
+
|
114
149
|
end
|
115
150
|
end
|
116
151
|
end
|
@@ -43,7 +43,7 @@ module Formotion
|
|
43
43
|
# work around an iOS7 bug: http://bit.ly/KcwKSv
|
44
44
|
if row.picker_mode == :countdown
|
45
45
|
self.picker.setDate(self.picker.date, animated:true)
|
46
|
-
picker.countDownDuration = self.row.value
|
46
|
+
picker.countDownDuration = self.row.value.to_f
|
47
47
|
end
|
48
48
|
|
49
49
|
update
|
@@ -8,38 +8,6 @@ module Formotion
|
|
8
8
|
include RowType::ItemsMapper
|
9
9
|
include RowType::MultiChoiceRow
|
10
10
|
|
11
|
-
def input_accessory_view(input_accessory)
|
12
|
-
case input_accessory
|
13
|
-
when :done
|
14
|
-
@input_accessory ||= begin
|
15
|
-
tool_bar = UIToolbar.alloc.initWithFrame([[0, 0], [0, 44]])
|
16
|
-
tool_bar.autoresizingMask = UIViewAutoresizingFlexibleWidth
|
17
|
-
tool_bar.translucent = true
|
18
|
-
|
19
|
-
left_space = UIBarButtonItem.alloc.initWithBarButtonSystemItem(
|
20
|
-
UIBarButtonSystemItemFlexibleSpace,
|
21
|
-
target: nil,
|
22
|
-
action: nil)
|
23
|
-
|
24
|
-
done_button = UIBarButtonItem.alloc.initWithBarButtonSystemItem(
|
25
|
-
UIBarButtonSystemItemDone,
|
26
|
-
target: self,
|
27
|
-
action: :done_editing)
|
28
|
-
|
29
|
-
tool_bar.items = [left_space, done_button]
|
30
|
-
|
31
|
-
tool_bar
|
32
|
-
end
|
33
|
-
else
|
34
|
-
nil
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
# Callback for "Done" button in input_accessory_view
|
39
|
-
def done_editing
|
40
|
-
self.row.text_field.endEditing(true)
|
41
|
-
end
|
42
|
-
|
43
11
|
def after_build(cell)
|
44
12
|
self.row.text_field.inputView = self.picker
|
45
13
|
self.row.text_field.text = name_for_value(row.value).to_s
|
@@ -102,4 +70,4 @@ module Formotion
|
|
102
70
|
end
|
103
71
|
end
|
104
72
|
end
|
105
|
-
end
|
73
|
+
end
|
@@ -147,39 +147,9 @@ module Formotion
|
|
147
147
|
self.row.text_field.text = row_value
|
148
148
|
end
|
149
149
|
|
150
|
-
# Creates the inputAccessoryView to show
|
151
|
-
# if input_accessory property is set on row.
|
152
|
-
# :done is currently the only supported option.
|
153
|
-
def input_accessory_view(input_accessory)
|
154
|
-
case input_accessory
|
155
|
-
when :done
|
156
|
-
@input_accessory ||= begin
|
157
|
-
tool_bar = UIToolbar.alloc.initWithFrame([[0, 0], [0, 44]])
|
158
|
-
tool_bar.autoresizingMask = UIViewAutoresizingFlexibleWidth
|
159
|
-
tool_bar.translucent = true
|
160
|
-
|
161
|
-
left_space = UIBarButtonItem.alloc.initWithBarButtonSystemItem(
|
162
|
-
UIBarButtonSystemItemFlexibleSpace,
|
163
|
-
target: nil,
|
164
|
-
action: nil)
|
165
|
-
|
166
|
-
done_button = UIBarButtonItem.alloc.initWithBarButtonSystemItem(
|
167
|
-
UIBarButtonSystemItemDone,
|
168
|
-
target: self,
|
169
|
-
action: :done_editing)
|
170
|
-
|
171
|
-
tool_bar.items = [left_space, done_button]
|
172
|
-
|
173
|
-
tool_bar
|
174
|
-
end
|
175
|
-
else
|
176
|
-
nil
|
177
|
-
end
|
178
|
-
end
|
179
|
-
|
180
|
-
# Callback for "Done" button in input_accessory_view
|
181
150
|
def done_editing
|
182
151
|
self.row.text_field.endEditing(true)
|
152
|
+
self.row.done_action.call unless self.row.done_action.nil?
|
183
153
|
end
|
184
154
|
|
185
155
|
end
|
@@ -33,8 +33,12 @@ module Formotion
|
|
33
33
|
|
34
34
|
def update_cell(cell)
|
35
35
|
subform = row.subform.to_form
|
36
|
-
if row.display_key
|
37
|
-
|
36
|
+
if row.display_key && render_row = subform.row(row.display_key)
|
37
|
+
rendered_value = render_row.value_for_save_hash
|
38
|
+
if render_row.object && render_row.object.respond_to?('row_value')
|
39
|
+
rendered_value = render_row.object.row_value
|
40
|
+
end
|
41
|
+
self.display_key_label.text = rendered_value
|
38
42
|
end
|
39
43
|
end
|
40
44
|
|
@@ -22,6 +22,7 @@ module Formotion
|
|
22
22
|
field.returnKeyType = row.return_key || UIReturnKeyDefault
|
23
23
|
field.autocapitalizationType = row.auto_capitalization if row.auto_capitalization
|
24
24
|
field.autocorrectionType = row.auto_correction if row.auto_correction
|
25
|
+
field.inputAccessoryView = input_accessory_view(row.input_accessory) if row.input_accessory
|
25
26
|
|
26
27
|
# must be set prior to placeholder!
|
27
28
|
field.font = BW::Font.new(row.font) if row.font
|
@@ -89,6 +90,11 @@ module Formotion
|
|
89
90
|
field.resignFirstResponder
|
90
91
|
end
|
91
92
|
|
93
|
+
def done_editing
|
94
|
+
dismissKeyboard
|
95
|
+
self.row.done_action.call unless self.row.done_action.nil?
|
96
|
+
end
|
97
|
+
|
92
98
|
end
|
93
99
|
end
|
94
100
|
end
|
data/lib/formotion/version.rb
CHANGED
@@ -0,0 +1,147 @@
|
|
1
|
+
describe "FormController/ActivityRow" do
|
2
|
+
tests Formotion::FormController
|
3
|
+
|
4
|
+
# By default, `tests` uses @controller.init
|
5
|
+
# this isn't ideal for our case, so override.
|
6
|
+
def controller
|
7
|
+
row_settings = {
|
8
|
+
title: "Activity View",
|
9
|
+
key: :activity,
|
10
|
+
type: :activity,
|
11
|
+
value: "Share the joys of Rubymotion! http://www.rubymotion.com"
|
12
|
+
}
|
13
|
+
@form ||= Formotion::Form.new(
|
14
|
+
sections: [{
|
15
|
+
rows:[row_settings]
|
16
|
+
}])
|
17
|
+
|
18
|
+
@controller ||= Formotion::FormController.alloc.initWithForm(@form)
|
19
|
+
end
|
20
|
+
|
21
|
+
def activity_row
|
22
|
+
@form.row(:activity)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should initialize with correct settings" do
|
26
|
+
activity_row.object.class.should == Formotion::RowType::ActivityRow
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should initialize with defaults" do
|
30
|
+
activity_row.value[:excluded].should == []
|
31
|
+
activity_row.value[:animated].should == true
|
32
|
+
activity_row.value[:app_activities].should == nil
|
33
|
+
activity_row.value[:completion].should == nil
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should have an array as the items" do
|
37
|
+
activity_row.value[:items].is_a?(Array).should == true
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe "FormController/ActivityRow Hash" do
|
42
|
+
tests Formotion::FormController
|
43
|
+
|
44
|
+
# By default, `tests` uses @controller.init
|
45
|
+
# this isn't ideal for our case, so override.
|
46
|
+
def controller
|
47
|
+
row_settings = {
|
48
|
+
title: "Activity View",
|
49
|
+
key: :activity,
|
50
|
+
type: :activity,
|
51
|
+
value: {
|
52
|
+
items: "Share the joys of Rubymotion! http://www.rubymotion.com"
|
53
|
+
}
|
54
|
+
}
|
55
|
+
@form ||= Formotion::Form.new(
|
56
|
+
sections: [{
|
57
|
+
rows:[row_settings]
|
58
|
+
}])
|
59
|
+
|
60
|
+
@controller ||= Formotion::FormController.alloc.initWithForm(@form)
|
61
|
+
end
|
62
|
+
|
63
|
+
def activity_row
|
64
|
+
@form.row(:activity)
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should turn the items string into an array" do
|
68
|
+
activity_row.value[:items].is_a?(Array).should == true
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe "FormController/ActivityRow Exclusions" do
|
73
|
+
tests Formotion::FormController
|
74
|
+
|
75
|
+
# By default, `tests` uses @controller.init
|
76
|
+
# this isn't ideal for our case, so override.
|
77
|
+
def controller
|
78
|
+
row_settings = {
|
79
|
+
title: "Activity View",
|
80
|
+
key: :activity,
|
81
|
+
type: :activity,
|
82
|
+
value: {
|
83
|
+
items: "Share the joys of Rubymotion! http://www.rubymotion.com",
|
84
|
+
excluded: [
|
85
|
+
UIActivityTypeAddToReadingList,
|
86
|
+
UIActivityTypeAirDrop,
|
87
|
+
UIActivityTypeCopyToPasteboard,
|
88
|
+
UIActivityTypePrint
|
89
|
+
]
|
90
|
+
}
|
91
|
+
}
|
92
|
+
@form ||= Formotion::Form.new(
|
93
|
+
sections: [{
|
94
|
+
rows:[row_settings]
|
95
|
+
}])
|
96
|
+
|
97
|
+
@controller ||= Formotion::FormController.alloc.initWithForm(@form)
|
98
|
+
end
|
99
|
+
|
100
|
+
def activity_row
|
101
|
+
@form.row(:activity)
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should exclude certain activity types" do
|
105
|
+
activity_row.value[:excluded].is_a?(Array).should == true
|
106
|
+
activity_row.value[:excluded].count.should == 4
|
107
|
+
activity_row.value[:excluded][0].should == UIActivityTypeAddToReadingList
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
describe "FormController/ActivityRow MultipleItems" do
|
112
|
+
tests Formotion::FormController
|
113
|
+
|
114
|
+
# By default, `tests` uses @controller.init
|
115
|
+
# this isn't ideal for our case, so override.
|
116
|
+
def controller
|
117
|
+
row_settings = {
|
118
|
+
title: "Activity View",
|
119
|
+
key: :activity,
|
120
|
+
type: :activity,
|
121
|
+
value: {
|
122
|
+
items: ["Share the joys of Rubymotion! http://www.rubymotion.com", UIImage.imageNamed("tags_row-selected")],
|
123
|
+
excluded: [
|
124
|
+
UIActivityTypeAddToReadingList,
|
125
|
+
UIActivityTypeAirDrop,
|
126
|
+
UIActivityTypeCopyToPasteboard,
|
127
|
+
UIActivityTypePrint
|
128
|
+
]
|
129
|
+
}
|
130
|
+
}
|
131
|
+
@form ||= Formotion::Form.new(
|
132
|
+
sections: [{
|
133
|
+
rows:[row_settings]
|
134
|
+
}])
|
135
|
+
|
136
|
+
@controller ||= Formotion::FormController.alloc.initWithForm(@form)
|
137
|
+
end
|
138
|
+
|
139
|
+
def activity_row
|
140
|
+
@form.row(:activity)
|
141
|
+
end
|
142
|
+
|
143
|
+
it "should allow sharing images" do
|
144
|
+
activity_row.value[:items].first.is_a?(String).should == true
|
145
|
+
activity_row.value[:items].last.is_a?(UIImage).should == true
|
146
|
+
end
|
147
|
+
end
|
@@ -14,7 +14,12 @@ module Bacon
|
|
14
14
|
def tests_row(row_settings, &block)
|
15
15
|
if row_settings.is_a? Symbol
|
16
16
|
type = row_settings
|
17
|
-
row_settings = {
|
17
|
+
row_settings = {
|
18
|
+
type: type,
|
19
|
+
key: type,
|
20
|
+
title: type.capitalize.to_s,
|
21
|
+
input_accessory: :done
|
22
|
+
}
|
18
23
|
end
|
19
24
|
before do
|
20
25
|
@row = Formotion::Row.new(row_settings)
|
@@ -23,4 +28,4 @@ module Bacon
|
|
23
28
|
end
|
24
29
|
end
|
25
30
|
end
|
26
|
-
end
|
31
|
+
end
|
@@ -36,7 +36,8 @@ describe "Number Row" do
|
|
36
36
|
cell = @row.make_cell
|
37
37
|
set_formatter_locale("it_IT")
|
38
38
|
@row.value = 3004.35
|
39
|
-
@row.text_field.text.should
|
39
|
+
@row.text_field.text.should.start_with?("€")
|
40
|
+
@row.text_field.text.should.end_with?("3.004,35")
|
40
41
|
end
|
41
42
|
|
42
43
|
it "should work with different locale and setting text_field#text" do
|
data/spec/row_type/date_spec.rb
CHANGED
@@ -15,7 +15,7 @@ describe "Date Row" do
|
|
15
15
|
it "should have no value by default" do
|
16
16
|
cell = @row.make_cell
|
17
17
|
|
18
|
-
@row.text_field.text.should ==
|
18
|
+
@row.text_field.text.to_s.should == ""
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should use custom value" do
|
@@ -35,7 +35,7 @@ describe "Date Row" do
|
|
35
35
|
cell = @row.make_cell
|
36
36
|
|
37
37
|
@row.object.picker.date = Time.at MILLENIUM
|
38
|
-
@row.object.picker.
|
38
|
+
@row.object.picker.sendActionsForControlEvents UIControlEventValueChanged
|
39
39
|
|
40
40
|
@row.value.should == MILLENIUM
|
41
41
|
@row.text_field.text.should == '1/1/00'
|
@@ -73,7 +73,7 @@ describe "Date Row" do
|
|
73
73
|
@row.picker_mode = mode
|
74
74
|
cell = @row.make_cell
|
75
75
|
@row.object.picker.date = Time.at MILLENIUM
|
76
|
-
@row.object.picker.
|
76
|
+
@row.object.picker.sendActionsForControlEvents UIControlEventValueChanged
|
77
77
|
|
78
78
|
@row.text_field.text.should == expected_output
|
79
79
|
end
|
@@ -61,6 +61,15 @@ describe "String Row Type" do
|
|
61
61
|
@row.text_field.keyboardType.should == UIKeyboardTypeDefault
|
62
62
|
end
|
63
63
|
|
64
|
+
# Input Accessory
|
65
|
+
it "should have an input accessory" do
|
66
|
+
cell = @row.make_cell
|
67
|
+
@row.text_field.inputAccessoryView.should != nil
|
68
|
+
end
|
69
|
+
|
70
|
+
it "should call the done_action when hitting the 'done' button" do
|
71
|
+
end
|
72
|
+
|
64
73
|
describe "on_select" do
|
65
74
|
|
66
75
|
it "should call _on_select" do
|
data/spec/row_type/text_spec.rb
CHANGED
@@ -45,4 +45,13 @@ describe "Text Row" do
|
|
45
45
|
@row.text_field.placeholder.should == 'placeholder'
|
46
46
|
end
|
47
47
|
|
48
|
-
|
48
|
+
# Input Accessory
|
49
|
+
it "should have an input accessory" do
|
50
|
+
cell = @row.make_cell
|
51
|
+
@row.text_field.inputAccessoryView.should != nil
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should call the done_action when hitting the 'done' button" do
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clay Allsopp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bubble-wrap
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.4.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: motion-require
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.0
|
33
|
+
version: 0.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.0
|
40
|
+
version: 0.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- lib/formotion/patch/ui_text_view_placeholder.rb
|
139
139
|
- lib/formotion/row/row.rb
|
140
140
|
- lib/formotion/row/row_cell_builder.rb
|
141
|
+
- lib/formotion/row_type/activity_view_row.rb
|
141
142
|
- lib/formotion/row_type/back_row.rb
|
142
143
|
- lib/formotion/row_type/base.rb
|
143
144
|
- lib/formotion/row_type/button.rb
|
@@ -181,6 +182,7 @@ files:
|
|
181
182
|
- spec/formable/kvo_spec.rb
|
182
183
|
- spec/formable/subclass_spec.rb
|
183
184
|
- spec/formable_spec.rb
|
185
|
+
- spec/functional/activity_vew_row_spec.rb
|
184
186
|
- spec/functional/character_spec.rb
|
185
187
|
- spec/functional/check_row_spec.rb
|
186
188
|
- spec/functional/date_row_spec.rb
|
@@ -252,6 +254,7 @@ test_files:
|
|
252
254
|
- spec/formable/kvo_spec.rb
|
253
255
|
- spec/formable/subclass_spec.rb
|
254
256
|
- spec/formable_spec.rb
|
257
|
+
- spec/functional/activity_vew_row_spec.rb
|
255
258
|
- spec/functional/character_spec.rb
|
256
259
|
- spec/functional/check_row_spec.rb
|
257
260
|
- spec/functional/date_row_spec.rb
|