bluepotion 0.0.7 → 0.0.8

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: d6f3f2586907e1d47fe1d01cb1f77bb132ddbf9e
4
- data.tar.gz: 32f91082af4bf994b35f4155323ef13bcc3de509
3
+ metadata.gz: c8d94399c2e9d10b9b2610cd594612ebe79aa34a
4
+ data.tar.gz: d4fd79eeba234aec607d8d264431aaee962abd25
5
5
  SHA512:
6
- metadata.gz: 38206bb411a17e09f01aef1e110485ea140a63d5209e046523e0f37b444d0abc1edf562457c8d88210a1bc69efe578fe62ec2059d88ba594f7fb1283b36448d9
7
- data.tar.gz: d3c256a89df9fabd43f3fa9379bd35b8e12c92a73f6680da6d1fae09c3cf06c9be92c9f71b8e4171cbde828d528add044674f520f818265e5cfcbeeb3c1102ad
6
+ metadata.gz: 6fed1b097d48b24177cf2dfcb38f986283f7180950a13ca7360f63158d95fbdfda3f2292c7f6a06bf4a7f4485ed14f0e568fc9d7736af5221449bb946779c6bb
7
+ data.tar.gz: e4d2b0f568f4e0e50c2f45ee98902f99628fe8d43df249817fd1c9b69c20e6cdc4b35abceec06ccd134d7696bd5ee114b4860247934dde0b6e605f6420bfcbac
@@ -7,6 +7,12 @@ class Android::View::View
7
7
  self.inspect
8
8
  end
9
9
 
10
+ def resource_entry_name
11
+ if self.id > 0
12
+ resources.getResourceEntryName(self.id)
13
+ end
14
+ end
15
+
10
16
  def rmq_data
11
17
  @_rmq_data ||= RMQViewData.new
12
18
  end
@@ -17,6 +17,22 @@
17
17
  self.on_create if respond_to?(:on_create)
18
18
  end
19
19
 
20
+ def application_info
21
+ context.applicationInfo
22
+ end
23
+
24
+ def identifier
25
+ application_info.packageName
26
+ end
27
+
28
+ def package_name
29
+ @package_name ||= application_info.packageName
30
+ end
31
+
32
+ def data_dir
33
+ application_info.dataDir
34
+ end
35
+
20
36
  def window
21
37
  if @current_activity
22
38
  @window ||= @current_activity.getWindow
@@ -9,15 +9,14 @@
9
9
  def onCreateView(inflater, parent, saved_instance_state)
10
10
  super
11
11
 
12
- if self.class.xml_resource
13
- @view = inflater.inflate(r(:layout, self.class.xml_resource), parent, false)
12
+ if @xml_resource = self.class.xml_resource
13
+ @view = inflater.inflate(r(:layout, @xml_resource), parent, false)
14
14
  else
15
15
  @view = load_view
16
16
  @view.setId Potion::ViewIdGenerator.generate
17
17
  end
18
18
 
19
19
  action_bar.hide if hide_action_bar?
20
- tag_xml_widgets_with_their_id
21
20
 
22
21
  @view
23
22
  end
@@ -40,6 +39,8 @@
40
39
  @view.rmq.apply_style(:root_view) #if @view.rmq.stylesheet.respond_to?(:root_view)
41
40
  end
42
41
 
42
+ build_and_tag_xml_views
43
+
43
44
  self.action_bar.title = self.class.bars_title
44
45
  self.activity.title = self.class.bars_title
45
46
 
@@ -49,16 +50,14 @@
49
50
 
50
51
  private
51
52
 
52
- def tag_xml_widgets_with_their_id
53
- return unless (xml_widget_ids = self.class.xml_widget_ids)
53
+ def build_and_tag_xml_views
54
+ return unless @xml_resource
54
55
 
55
- package_name = activity.getApplicationInfo.packageName
56
- key = "id"
57
- xml_widget_ids.each do |id|
58
- id_s = id.to_s
59
- resource_id = resources.getIdentifier(id_s, key, package_name)
60
- view = @view.findViewById(resource_id)
61
- view.rmq_data.tag(id_s.to_sym)
56
+ self.rmq.all.each do |view|
57
+ if ren = view.resource_entry_name
58
+ self.rmq.build(view).tag(ren.to_sym)
59
+ #view.rmq_data.tag(ren.to_sym)
60
+ end
62
61
  end
63
62
  end
64
63
 
@@ -6,7 +6,7 @@
6
6
  end
7
7
 
8
8
  module ClassMethods
9
- attr_reader :xml_resource, :xml_widget_ids, :show_action_bar, :bars_title
9
+ attr_reader :xml_resource, :show_action_bar, :bars_title
10
10
 
11
11
  @show_action_bar = true
12
12
 
@@ -22,13 +22,6 @@
22
22
  @xml_resource = xml_resource ||= deduce_resource_id
23
23
  end
24
24
 
25
- def xml_widgets(*widget_ids)
26
- @xml_widget_ids = widget_ids || []
27
- @xml_widget_ids.each do |id|
28
- attr_accessor id
29
- end
30
- end
31
-
32
25
  def uses_action_bar(show_action_bar)
33
26
  @show_action_bar = show_action_bar
34
27
  end
@@ -1,3 +1,3 @@
1
1
  module BluePotion
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -1,15 +1,15 @@
1
1
  class <%= @name_camel_case %>Screen < PMScreen
2
2
 
3
3
  # If you are using XML for this screen:
4
- #uses_xml :xml_file_name
5
- #xml_widgets :some_widget
6
- #xml_fragments :some_fragment
4
+ #uses_xml :<%= @name %>
7
5
 
8
6
  uses_action_bar true
9
- title "Your title here"
10
7
  stylesheet <%= @name_camel_case %>ScreenStylesheet
11
8
 
12
- # This is optional, it will default to a RelativeView
9
+ # Title is unnecesary if you're using an XML file
10
+ title "Your title here"
11
+
12
+ # This is optional, it will default to a RelativeView or use your XML file
13
13
  #def load_view
14
14
  #Potion::LinearLayout.new(self.activity)
15
15
  #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.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfiniteRed