bluepotion 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/lib/project/blue_potion_net.rb +105 -0
  3. data/lib/project/ext/object.rb +2 -0
  4. data/lib/project/potion.rb +19 -3
  5. data/lib/project/potion_dialog/potion_dialog.rb +46 -0
  6. data/lib/project/pro_motion/{pm_activity.rb → activities/pm_activity.rb} +18 -0
  7. data/lib/project/pro_motion/activities/pm_home_activity.rb +14 -0
  8. data/lib/project/pro_motion/activities/pm_navigation_activity.rb +83 -0
  9. data/lib/project/pro_motion/{pm_single_fragment_activity.rb → activities/pm_single_fragment_activity.rb} +14 -3
  10. data/lib/project/pro_motion/adapters/pm_base_adapter.rb +75 -0
  11. data/lib/project/pro_motion/adapters/pm_cursor_adapter.rb +44 -0
  12. data/lib/project/pro_motion/fragments/pm_list_screen.rb +191 -0
  13. data/lib/project/pro_motion/{pm_screen.rb → fragments/pm_screen.rb} +31 -6
  14. data/lib/project/pro_motion/{pm_screen_module.rb → fragments/pm_screen_module.rb} +72 -20
  15. data/lib/project/pro_motion/pm_application.rb +15 -4
  16. data/lib/project/pro_motion/{pm_hash_bundle.rb → support/pm_hash_bundle.rb} +4 -0
  17. data/lib/project/ruby_motion_query/rmq/base.rb +1 -1
  18. data/lib/project/ruby_motion_query/rmq/data.rb +2 -36
  19. data/lib/project/ruby_motion_query/rmq/subviews.rb +30 -0
  20. data/lib/project/ruby_motion_query/rmq_color.rb +1 -1
  21. data/lib/project/ruby_motion_query/rmq_resource.rb +26 -0
  22. data/lib/project/version.rb +1 -1
  23. data/lib/project/volley_wrap/http_result.rb +98 -0
  24. data/lib/project/volley_wrap/request.rb +98 -0
  25. data/lib/project/volley_wrap/response_listener.rb +49 -0
  26. data/lib/project/volley_wrap/session_client.rb +72 -0
  27. metadata +19 -8
  28. data/lib/project/pro_motion/pm_home_activity.rb +0 -16
@@ -0,0 +1,72 @@
1
+ module VW
2
+ class SessionClient
3
+ attr_accessor :context
4
+ attr_accessor :base_url
5
+ attr_accessor :headers
6
+ attr_accessor :serializer
7
+
8
+ class << self
9
+ attr_accessor :shared
10
+ attr_accessor :debug
11
+
12
+ def build_shared(context, url, &block)
13
+ self.shared = SessionClient.new(context, url)
14
+ self.shared.instance_eval(&block) if block
15
+ end
16
+ end
17
+
18
+ def initialize(context, base_url)
19
+ @context = context
20
+ @base_url = base_url
21
+ @headers = {}
22
+ end
23
+
24
+ def header(name, value)
25
+ headers[name] = value
26
+ end
27
+
28
+ def response_serializer(serializer)
29
+ @serializer = serializer
30
+ end
31
+
32
+ def get(url, opts={}, dummy=nil, &block) # Dummy is to get around RM bug
33
+ request_url = base_url + url
34
+ ser = opts[:serializer] || @serializer
35
+ listener = VW::ResponseListener.new(ser, &block)
36
+ queue VW::Request.get_request(request_url, listener)
37
+ end
38
+
39
+ def post(url, params, opts={}, &block)
40
+ request_url = base_url + url
41
+ ser = opts[:serializer] || @serializer
42
+ listener = VW::ResponseListener.new(serializer, &block)
43
+ queue VW::Request.post_request(request_url, params, listener)
44
+ end
45
+
46
+ def put(url, params, opts={}, &block)
47
+ request_url = base_url + url
48
+ ser = opts[:serializer] || @serializer
49
+ listener = VW::ResponseListener.new(nil, &block)
50
+ queue VW::Request.put_request(request_url, params, listener)
51
+ end
52
+
53
+ def delete(url, params, opts={}, &block)
54
+ request_url = base_url + url
55
+ ser = opts[:serializer] || @serializer
56
+ listener = VW::ResponseListener.new(nil, &block)
57
+ queue VW::Request.delete_request(request_url, params, listener)
58
+ end
59
+
60
+ private
61
+
62
+ def queue(request)
63
+ request.headers = headers
64
+ request_queue.add(request)
65
+ end
66
+
67
+ def request_queue
68
+ @request_queue ||= Com::Android::Volley::Toolbox::Volley.newRequestQueue(context)
69
+ end
70
+
71
+ end
72
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bluepotion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfiniteRed
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-03 00:00:00.000000000 Z
12
+ date: 2015-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -37,6 +37,7 @@ files:
37
37
  - README.md
38
38
  - bin/bluepotion
39
39
  - lib/bluepotion.rb
40
+ - lib/project/blue_potion_net.rb
40
41
  - lib/project/ext/activity.rb
41
42
  - lib/project/ext/array_list.rb
42
43
  - lib/project/ext/fragment.rb
@@ -45,13 +46,18 @@ files:
45
46
  - lib/project/ext/string.rb
46
47
  - lib/project/ext/view.rb
47
48
  - lib/project/potion.rb
48
- - lib/project/pro_motion/pm_activity.rb
49
+ - lib/project/potion_dialog/potion_dialog.rb
50
+ - lib/project/pro_motion/activities/pm_activity.rb
51
+ - lib/project/pro_motion/activities/pm_home_activity.rb
52
+ - lib/project/pro_motion/activities/pm_navigation_activity.rb
53
+ - lib/project/pro_motion/activities/pm_single_fragment_activity.rb
54
+ - lib/project/pro_motion/adapters/pm_base_adapter.rb
55
+ - lib/project/pro_motion/adapters/pm_cursor_adapter.rb
56
+ - lib/project/pro_motion/fragments/pm_list_screen.rb
57
+ - lib/project/pro_motion/fragments/pm_screen.rb
58
+ - lib/project/pro_motion/fragments/pm_screen_module.rb
49
59
  - lib/project/pro_motion/pm_application.rb
50
- - lib/project/pro_motion/pm_hash_bundle.rb
51
- - lib/project/pro_motion/pm_home_activity.rb
52
- - lib/project/pro_motion/pm_screen.rb
53
- - lib/project/pro_motion/pm_screen_module.rb
54
- - lib/project/pro_motion/pm_single_fragment_activity.rb
60
+ - lib/project/pro_motion/support/pm_hash_bundle.rb
55
61
  - lib/project/ruby_motion_query/rmq/actions.rb
56
62
  - lib/project/ruby_motion_query/rmq/base.rb
57
63
  - lib/project/ruby_motion_query/rmq/data.rb
@@ -78,6 +84,7 @@ files:
78
84
  - lib/project/ruby_motion_query/rmq_font.rb
79
85
  - lib/project/ruby_motion_query/rmq_image.rb
80
86
  - lib/project/ruby_motion_query/rmq_rect.rb
87
+ - lib/project/ruby_motion_query/rmq_resource.rb
81
88
  - lib/project/ruby_motion_query/rmq_screen_data.rb
82
89
  - lib/project/ruby_motion_query/rmq_stylesheet.rb
83
90
  - lib/project/ruby_motion_query/rmq_view_data.rb
@@ -90,6 +97,10 @@ files:
90
97
  - lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb
91
98
  - lib/project/ruby_motion_query/stylers/rmq_view_styler.rb
92
99
  - lib/project/version.rb
100
+ - lib/project/volley_wrap/http_result.rb
101
+ - lib/project/volley_wrap/request.rb
102
+ - lib/project/volley_wrap/response_listener.rb
103
+ - lib/project/volley_wrap/session_client.rb
93
104
  - templates/screen/app/screens/name_screen.rb
94
105
  - templates/screen/app/stylesheets/name_screen_stylesheet.rb
95
106
  - templates/screen/spec/screens/name_screen_spec.rb
@@ -1,16 +0,0 @@
1
- # RM-733
2
- #module ProMotion
3
- class PMHomeActivity < PMSingleFragmentActivity
4
- def on_create(saved_instance_state)
5
- super
6
-
7
- mp "PMHomeActivity on_create", debugging_only: true
8
- create_home_screen
9
- end
10
-
11
- def create_home_screen
12
- home_screen_class = PMApplication.current_application.home_screen_class
13
- self.set_fragment home_screen_class.new if home_screen_class
14
- end
15
- end
16
- #end