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 +4 -4
- data/lib/project/ext/view.rb +6 -0
- data/lib/project/pro_motion/pm_application.rb +16 -0
- data/lib/project/pro_motion/pm_screen.rb +11 -12
- data/lib/project/pro_motion/pm_screen_module.rb +1 -8
- data/lib/project/version.rb +1 -1
- data/templates/screen/app/screens/name_screen.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8d94399c2e9d10b9b2610cd594612ebe79aa34a
|
4
|
+
data.tar.gz: d4fd79eeba234aec607d8d264431aaee962abd25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fed1b097d48b24177cf2dfcb38f986283f7180950a13ca7360f63158d95fbdfda3f2292c7f6a06bf4a7f4485ed14f0e568fc9d7736af5221449bb946779c6bb
|
7
|
+
data.tar.gz: e4d2b0f568f4e0e50c2f45ee98902f99628fe8d43df249817fd1c9b69c20e6cdc4b35abceec06ccd134d7696bd5ee114b4860247934dde0b6e605f6420bfcbac
|
data/lib/project/ext/view.rb
CHANGED
@@ -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,
|
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
|
53
|
-
return unless
|
53
|
+
def build_and_tag_xml_views
|
54
|
+
return unless @xml_resource
|
54
55
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
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, :
|
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
|
data/lib/project/version.rb
CHANGED
@@ -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
|
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
|
-
#
|
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
|