ProMotion 0.6.5 → 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.
- data/README.md +79 -502
- data/Rakefile +30 -0
- data/app/app_delegate.rb +3 -1
- data/lib/ProMotion.rb +1 -1
- data/lib/ProMotion/cocoatouch/TableViewCell.rb +5 -1
- data/lib/ProMotion/delegate/delegate.rb +16 -0
- data/lib/ProMotion/delegate/delegate_helper.rb +88 -0
- data/lib/ProMotion/delegate/delegate_notifications.rb +61 -0
- data/lib/ProMotion/helpers/console.rb +3 -3
- data/lib/ProMotion/helpers/logger.rb +15 -15
- data/lib/ProMotion/helpers/view_helper.rb +7 -5
- data/lib/ProMotion/push_notifications/push_notification.rb +51 -0
- data/lib/ProMotion/screen_helpers/screen_elements.rb +2 -2
- data/lib/ProMotion/screen_helpers/screen_navigation.rb +5 -1
- data/lib/ProMotion/screen_helpers/screen_tabs.rb +2 -2
- data/lib/ProMotion/screens/_compatibility/formotion_screen.rb +65 -0
- data/lib/ProMotion/screens/_screen_module.rb +33 -20
- data/lib/ProMotion/screens/_table_screen_module.rb +4 -4
- data/lib/ProMotion/{screen_helpers → screens}/_tables/_refreshable_table.rb +2 -2
- data/lib/ProMotion/{screen_helpers → screens}/_tables/_searchable_table.rb +27 -34
- data/lib/ProMotion/screens/_tables/_sectioned_table.rb +5 -0
- data/lib/ProMotion/screens/_tables/_table.rb +149 -0
- data/lib/ProMotion/screens/_tables/grouped_table.rb +16 -0
- data/lib/ProMotion/screens/_tables/plain_table.rb +17 -0
- data/lib/ProMotion/screens/_tables/table_data.rb +148 -0
- data/lib/ProMotion/screens/_tables/table_view_cell_module.rb +156 -0
- data/lib/ProMotion/screens/table_screen.rb +3 -2
- data/lib/ProMotion/version.rb +1 -1
- data/spec/functional/func_screen_spec.rb +66 -0
- data/spec/functional/func_split_screen_spec.rb +66 -0
- data/spec/functional/func_table_screen_spec.rb +52 -0
- data/spec/helpers/functional_screen.rb +15 -0
- data/spec/helpers/table_screen.rb +32 -8
- data/spec/helpers/table_screen_refreshable.rb +1 -1
- data/spec/helpers/table_screen_searchable.rb +1 -1
- data/spec/helpers/test_delegate.rb +2 -0
- data/spec/unit/delegate_spec.rb +38 -0
- data/spec/{ios_version_spec.rb → unit/ios_version_spec.rb} +0 -0
- data/spec/{logger_spec.rb → unit/logger_spec.rb} +0 -0
- data/spec/{main_spec.rb → unit/main_spec.rb} +0 -0
- data/spec/{screen_helpers_spec.rb → unit/screen_helpers_spec.rb} +14 -6
- data/spec/{screen_module_spec.rb → unit/screen_module_spec.rb} +0 -0
- data/spec/{screen_spec.rb → unit/screen_spec.rb} +21 -3
- data/spec/{split_screen_in_tab_bar_spec.rb → unit/split_screen_in_tab_bar_spec.rb} +0 -0
- data/spec/{split_screen_open_screen_spec.rb → unit/split_screen_open_screen_spec.rb} +0 -0
- data/spec/{split_screen_spec.rb → unit/split_screen_spec.rb} +0 -0
- data/spec/unit/tables/table_module_spec.rb +108 -0
- data/spec/unit/tables/table_screen_spec.rb +92 -0
- data/spec/unit/tables/table_view_cell_spec.rb +106 -0
- data/spec/{view_helper_spec.rb → unit/view_helper_spec.rb} +0 -0
- metadata +50 -29
- data/lib/ProMotion/delegate.rb +0 -63
- data/lib/ProMotion/screen_helpers/_tables/_sectioned_table.rb +0 -270
- data/lib/ProMotion/screen_helpers/_tables/grouped_table.rb +0 -14
- data/lib/ProMotion/screen_helpers/_tables/plain_table.rb +0 -15
- data/spec/table_screen_spec.rb +0 -72
@@ -1,14 +0,0 @@
|
|
1
|
-
module ProMotion::MotionTable
|
2
|
-
module GroupedTable
|
3
|
-
include SectionedTable
|
4
|
-
include RefreshableTable
|
5
|
-
|
6
|
-
def table_view
|
7
|
-
@table_view ||= UITableView.alloc.initWithFrame(self.view.frame, style:UITableViewStyleGrouped)
|
8
|
-
@table_view.dataSource = self;
|
9
|
-
@table_view.delegate = self;
|
10
|
-
return @table_view
|
11
|
-
end
|
12
|
-
alias :tableView :table_view
|
13
|
-
end
|
14
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module ProMotion::MotionTable
|
2
|
-
module PlainTable
|
3
|
-
include SectionedTable
|
4
|
-
include SearchableTable
|
5
|
-
include RefreshableTable
|
6
|
-
|
7
|
-
def table_view
|
8
|
-
@table_view ||= UITableView.alloc.initWithFrame(self.view.frame, style:UITableViewStylePlain)
|
9
|
-
@table_view.dataSource = self;
|
10
|
-
@table_view.delegate = self;
|
11
|
-
return @table_view
|
12
|
-
end
|
13
|
-
alias :tableView :table_view
|
14
|
-
end
|
15
|
-
end
|
data/spec/table_screen_spec.rb
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
describe "table screens" do
|
2
|
-
|
3
|
-
describe "basic functionality" do
|
4
|
-
|
5
|
-
before do
|
6
|
-
UIView.setAnimationsEnabled false # avoid animation issues
|
7
|
-
|
8
|
-
@screen = TableScreen.new
|
9
|
-
@screen.on_load
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should display 2 sections" do
|
13
|
-
@screen.tableView.numberOfSections.should == 2
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should have proper cell numbers" do
|
17
|
-
@screen.tableView.numberOfRowsInSection(0).should == 3
|
18
|
-
@screen.tableView.numberOfRowsInSection(1).should == 2
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should have a placeholder image in the last cell" do
|
22
|
-
index_path = NSIndexPath.indexPathForRow(1, inSection: 1)
|
23
|
-
|
24
|
-
@screen.tableView(@screen.tableView, cellForRowAtIndexPath: index_path).imageView.class.should == UIImageView
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
describe "search functionality" do
|
30
|
-
|
31
|
-
before do
|
32
|
-
@screen = TableScreenSearchable.new
|
33
|
-
@screen.on_load
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should be searchable" do
|
37
|
-
@screen.class.get_searchable.should == true
|
38
|
-
end
|
39
|
-
|
40
|
-
it "should create a search header" do
|
41
|
-
@screen.table_view.tableHeaderView.class.should == UISearchBar
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
describe "refresh functionality" do
|
47
|
-
|
48
|
-
# Note this test only works if on iOS 6+ or when using CKRefreshControl.
|
49
|
-
|
50
|
-
before do
|
51
|
-
@screen = TableScreenRefreshable.new
|
52
|
-
@screen.on_load
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should be refreshable" do
|
56
|
-
@screen.class.get_refreshable.should == true
|
57
|
-
end
|
58
|
-
|
59
|
-
it "should create a refresh object" do
|
60
|
-
@screen.instance_variable_get("@refresh_control").class.should == UIRefreshControl
|
61
|
-
end
|
62
|
-
|
63
|
-
it "should respond to start_refreshing and end_refreshing" do
|
64
|
-
@screen.respond_to?(:start_refreshing).should == true
|
65
|
-
@screen.respond_to?(:end_refreshing).should == true
|
66
|
-
end
|
67
|
-
|
68
|
-
# Animations cause the refresh object to fail when tested. Test manually.
|
69
|
-
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|