bluepotion 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/lib/project/alert_dialog/alert_dialog.rb +26 -4
  4. data/lib/project/benchmark.rb +34 -0
  5. data/lib/project/delayed_execution.rb +16 -0
  6. data/lib/project/ext/object.rb +16 -15
  7. data/lib/project/ext/time.rb +42 -0
  8. data/lib/project/ext/view.rb +26 -5
  9. data/lib/project/potion.rb +9 -0
  10. data/lib/project/pro_motion/activities/pm_activity.rb +15 -0
  11. data/lib/project/pro_motion/activities/pm_navigation_activity.rb +8 -1
  12. data/lib/project/pro_motion/activities/pm_single_fragment_activity.rb +1 -1
  13. data/lib/project/pro_motion/adapters/pm_base_adapter.rb +79 -15
  14. data/lib/project/pro_motion/adapters/pm_cursor_adapter.rb +7 -31
  15. data/lib/project/pro_motion/fragments/pm_list_screen.rb +14 -11
  16. data/lib/project/pro_motion/fragments/pm_screen.rb +3 -0
  17. data/lib/project/pro_motion/fragments/pm_screen_module.rb +41 -2
  18. data/lib/project/pro_motion/pm_application.rb +63 -0
  19. data/lib/project/ruby_motion_query/rmq/actions.rb +10 -0
  20. data/lib/project/ruby_motion_query/rmq/base.rb +79 -25
  21. data/lib/project/ruby_motion_query/rmq/config.rb +9 -0
  22. data/lib/project/ruby_motion_query/rmq/event_wrappers/rmq_keyboard_action.rb +12 -0
  23. data/lib/project/ruby_motion_query/rmq/event_wrappers/rmq_number_picker_change.rb +12 -0
  24. data/lib/project/ruby_motion_query/rmq/events.rb +14 -3
  25. data/lib/project/ruby_motion_query/rmq/factory.rb +10 -5
  26. data/lib/project/ruby_motion_query/rmq/selectors.rb +7 -6
  27. data/lib/project/ruby_motion_query/rmq/styles.rb +33 -10
  28. data/lib/project/ruby_motion_query/rmq/subviews.rb +2 -3
  29. data/lib/project/ruby_motion_query/rmq/traverse.rb +44 -6
  30. data/lib/project/ruby_motion_query/rmq_color.rb +2 -1
  31. data/lib/project/ruby_motion_query/rmq_device.rb +6 -0
  32. data/lib/project/ruby_motion_query/rmq_resource.rb +8 -0
  33. data/lib/project/ruby_motion_query/rmq_screen_data.rb +5 -0
  34. data/lib/project/ruby_motion_query/rmq_stylesheet.rb +30 -4
  35. data/lib/project/ruby_motion_query/rmq_validation.rb +3 -3
  36. data/lib/project/ruby_motion_query/rmq_view_data.rb +33 -1
  37. data/lib/project/ruby_motion_query/stylers/rmq_text_view_styler.rb +11 -3
  38. data/lib/project/ruby_motion_query/stylers/rmq_view_styler.rb +37 -3
  39. data/lib/project/version.rb +1 -1
  40. metadata +10 -4
  41. data/lib/project/compatibility/motion_keychain.rb +0 -14
@@ -5,6 +5,7 @@ class RMQTextViewStyler < RMQViewStyler
5
5
 
6
6
  def font_family=(font_family)
7
7
  @font_family = font_family
8
+ @lazy_typeface = true
8
9
  end
9
10
 
10
11
  def text_style=(text_style)
@@ -19,6 +20,7 @@ class RMQTextViewStyler < RMQViewStyler
19
20
  when "normal"
20
21
  Android::Graphics::Typeface::NORMAL
21
22
  end
23
+ @lazy_typeface = true
22
24
  end
23
25
 
24
26
  def text_color=(text_color)
@@ -41,10 +43,16 @@ class RMQTextViewStyler < RMQViewStyler
41
43
  @view.gravity = convert_gravity(gravity)
42
44
  end
43
45
 
46
+ def enabled=(enabled)
47
+ @view.setEnabled(enabled)
48
+ end
49
+
44
50
  def finalize
45
51
  super
46
- @text_style ||= Android::Graphics::Typeface::NORMAL
47
- typeface = Android::Graphics::Typeface.create(@font_family, @text_style) if @font_family
48
- @view.setTypeface(typeface, @text_style) # ok for typeface to be nil
52
+ if @lazy_typeface
53
+ @text_style ||= Android::Graphics::Typeface::NORMAL
54
+ typeface = Android::Graphics::Typeface.create(@font_family, @text_style) if @font_family
55
+ @view.setTypeface(typeface, @text_style) # ok for typeface to be nil
56
+ end
49
57
  end
50
58
  end
@@ -12,6 +12,17 @@ class RMQViewStyler
12
12
  @corner_radius = nil
13
13
  end
14
14
 
15
+ def cleanup
16
+ @layout_params = nil
17
+ @needs_finalize = nil
18
+ @context = nil
19
+ @bg_color = nil
20
+ @corner_radius = nil
21
+ @margin = nil
22
+ @padding = nil
23
+ @view = nil
24
+ end
25
+
15
26
  def convert_dimension_value(value)
16
27
  case value
17
28
  when :match_parent, :full
@@ -24,11 +35,22 @@ class RMQViewStyler
24
35
  end
25
36
 
26
37
  def layout_params
27
- @layout_params ||= @view.getLayoutParams
38
+ @layout_params ||= begin
39
+ #@view.setMargins(0, 0, 0, 0)
40
+ #mp @view.LayoutParams
41
+ if lp = @view.getLayoutParams
42
+ lp
43
+ else
44
+ #mp 1
45
+ #mp @view
46
+ Android::View::ViewGroup::LayoutParams.new(0,0)
47
+ #Android::Widget::LinearLayout::LayoutParams.new(0,0)
48
+ end
49
+ end
28
50
  end
29
51
 
30
52
  def layout=(value)
31
- lp = layout_params
53
+ return unless lp = layout_params
32
54
 
33
55
  if value == :full
34
56
  lp.width = convert_dimension_value(:full)
@@ -239,13 +261,25 @@ class RMQViewStyler
239
261
  end
240
262
 
241
263
  def density
242
- @density ||= context.getResources.getDisplayMetrics.density
264
+ @density ||= @context.getResources.getDisplayMetrics.density
243
265
  end
244
266
 
245
267
  def create_drawable(corner_radius)
246
268
  createDrawable(corner_radius)
247
269
  end
248
270
 
271
+ def visibility=(value)
272
+ case value
273
+ when :visible, true
274
+ view.setVisibility(Potion::View::VISIBLE)
275
+ when :invisible, false
276
+ view.setVisibility(Potion::View::INVISIBLE)
277
+ when :gone
278
+ view.setVisibility(Potion::View::GONE)
279
+ end
280
+ end
281
+ alias :visible= :visibility=
282
+
249
283
  private
250
284
 
251
285
  def padding
@@ -1,3 +1,3 @@
1
1
  module BluePotion
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  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.6
4
+ version: 0.1.7
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-07-05 00:00:00.000000000 Z
12
+ date: 2015-08-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -42,15 +42,17 @@ files:
42
42
  - bin/bluepotion_remove_line_numbers
43
43
  - lib/bluepotion.rb
44
44
  - lib/project/alert_dialog/alert_dialog.rb
45
+ - lib/project/benchmark.rb
45
46
  - lib/project/blue_potion_net.rb
46
47
  - lib/project/compatibility/dispatch.rb
47
- - lib/project/compatibility/motion_keychain.rb
48
+ - lib/project/delayed_execution.rb
48
49
  - lib/project/ext/activity.rb
49
50
  - lib/project/ext/array_list.rb
50
51
  - lib/project/ext/fragment.rb
51
52
  - lib/project/ext/nil.rb
52
53
  - lib/project/ext/object.rb
53
54
  - lib/project/ext/string.rb
55
+ - lib/project/ext/time.rb
54
56
  - lib/project/ext/view.rb
55
57
  - lib/project/potion.rb
56
58
  - lib/project/potion_dialog/potion_dialog.rb
@@ -68,10 +70,13 @@ files:
68
70
  - lib/project/progress_hud/progress_hud.rb
69
71
  - lib/project/ruby_motion_query/rmq/actions.rb
70
72
  - lib/project/ruby_motion_query/rmq/base.rb
73
+ - lib/project/ruby_motion_query/rmq/config.rb
71
74
  - lib/project/ruby_motion_query/rmq/data.rb
72
75
  - lib/project/ruby_motion_query/rmq/debug.rb
73
76
  - lib/project/ruby_motion_query/rmq/enumerablish.rb
74
77
  - lib/project/ruby_motion_query/rmq/event_wrappers/rmq_click.rb
78
+ - lib/project/ruby_motion_query/rmq/event_wrappers/rmq_keyboard_action.rb
79
+ - lib/project/ruby_motion_query/rmq/event_wrappers/rmq_number_picker_change.rb
75
80
  - lib/project/ruby_motion_query/rmq/event_wrappers/rmq_seek_change.rb
76
81
  - lib/project/ruby_motion_query/rmq/event_wrappers/rmq_text_change.rb
77
82
  - lib/project/ruby_motion_query/rmq/events.rb
@@ -136,9 +141,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
141
  version: '0'
137
142
  requirements: []
138
143
  rubyforge_project:
139
- rubygems_version: 2.4.5
144
+ rubygems_version: 2.4.6
140
145
  signing_key:
141
146
  specification_version: 4
142
147
  summary: BluePotion - Just like RedPotion, but for Android. The best combination of
143
148
  RubyMotion tools and libraries for Android
144
149
  test_files: []
150
+ has_rdoc:
@@ -1,14 +0,0 @@
1
- class MotionKeychain
2
- class << self
3
- def key_store
4
- # TODO store this somewhere real
5
- @_key_store ||= {}
6
- end
7
- def get(key)
8
- key_store[key]
9
- end
10
- def set(key, value)
11
- key_store[key] = value
12
- end
13
- end
14
- end