Class: PMListScreen
- Inherits:
-
Android::App::ListFragment
- Object
- Android::App::ListFragment
- PMListScreen
show all
- Includes:
- PMScreenModule
- Defined in:
- lib/project/pro_motion/fragments/pm_list_screen.rb
Overview
Instance Attribute Summary collapse
Instance Method Summary
collapse
#action_bar, #add_action_bar_button, #append, #append!, #build, #build!, #build_and_tag_xml_views, #cleanup, #close, #color, #create, #create!, #dummy_workaround_for_kind_of, #find, #font, #hide_keyboard, #image, included, #log_tree, #menu, #on_options_item_selected, #on_return, #open, #open_modal, #r, #rmq, #rmq_data, #root_view, #set_title, #set_up_action_bar, #show_keyboard, #show_toast, #soft_input_mode, #start_activity, #stylesheet, #stylesheet=, #title, #title=
Instance Attribute Details
Returns the value of attribute view.
7
8
9
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 7
def view
@view
end
|
Instance Method Details
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 48
def adapter
@adapter ||= begin
td = table_data
if td.is_a?(Array)
cells = td.first[:cells]
PMBaseAdapter.new(data: cells)
elsif td.is_a?(Hash)
mp "Please supply a cursor in #{self.inspect}#table_data." unless td[:cursor]
PMCursorAdapter.new(td)
end
end
end
|
#add_adapter ⇒ Object
44
45
46
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 44
def add_adapter
self.view.setAdapter(adapter)
end
|
#add_empty_view ⇒ Object
35
36
37
38
39
40
41
42
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 35
def add_empty_view
end
|
#add_table_view ⇒ Object
26
27
28
29
30
31
32
33
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 26
def add_table_view
end
|
#load_view ⇒ Object
14
15
16
17
18
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 14
def load_view
v = Potion::View.new(app.context)
lv = rmq(v).create(Potion::ListView).tag(:list)
self.view = lv.get
end
|
#on_activity_created ⇒ Object
131
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 131
def on_activity_created; end
|
#on_attach(activity) ⇒ Object
79
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 79
def on_attach(activity); end
|
#on_create(bundle) ⇒ Object
82
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 82
def on_create(bundle); end
|
140
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 140
def (); end
|
#on_create_view(inflater, parent, saved_instance_state) ⇒ Object
102
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 102
def on_create_view(inflater, parent, saved_instance_state); end
|
#on_destroy ⇒ Object
152
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 152
def on_destroy; end
|
#on_destroy_view ⇒ Object
149
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 149
def on_destroy_view; end
|
#on_detach ⇒ Object
159
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 159
def on_detach; end
|
130
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 130
def on_load; end
|
143
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 143
def on_pause; end
|
#on_resume ⇒ Object
138
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 138
def on_resume; end
|
#on_start ⇒ Object
Also known as:
on_appear
134
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 134
def on_start; end
|
146
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 146
def on_stop; end
|
#onActivityCreated(saved_instance_state) ⇒ Object
def load_view
Potion::FrameLayout.new(self.activity)
end
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 108
def onActivityCreated(saved_instance_state)
mp "PMScreen onActivityCreated" if RMQ.debugging?
super
@view.rmq_data.is_screen_root_view = true
self.rmq.build(@view)
screen_setup
if self.class.rmq_style_sheet_class
self.rmq.stylesheet = self.class.rmq_style_sheet_class
@view.rmq.apply_style(:root_view)
end
build_and_tag_xml_views
set_title
on_load
on_activity_created
end
|
#onAttach(activity) ⇒ Object
Boilerplate from PMScreen ###
74
75
76
77
78
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 74
def onAttach(activity)
super
activity.on_fragment_attached(self) if activity.respond_to?(:on_fragment_attached)
on_attach(activity)
end
|
#onCreate(bundle) ⇒ Object
81
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 81
def onCreate(bundle); super; on_create(bundle); end
|
#onCreateView(inflater, parent, saved_instance_state) ⇒ Object
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 84
def onCreateView(inflater, parent, saved_instance_state)
super
if @xml_resource = self.class.xml_resource
@view = inflater.inflate(r(:layout, @xml_resource), parent, false)
else
v = load_view
mp v
@view ||= v
@view.id = Potion::ViewIdGenerator.generate
end
set_up_action_bar(self.class.action_bar_options)
on_create_view(inflater, parent, saved_instance_state)
@view
end
|
#onDestroy ⇒ Object
151
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 151
def onDestroy; super; on_destroy; end
|
#onDestroyView ⇒ Object
148
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 148
def onDestroyView; super; on_destroy_view; end
|
154
155
156
157
158
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 154
def onDetach
super
on_detach
self.activity.on_fragment_detached(self) if self.activity.respond_to?(:on_fragment_detached)
end
|
142
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 142
def onPause; super; on_pause; end
|
137
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 137
def onResume; super; on_resume; end
|
133
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 133
def onStart; super; on_start; end
|
145
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 145
def onStop; super; on_stop; end
|
#screen_setup ⇒ Object
20
21
22
23
24
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 20
def screen_setup
add_table_view
add_empty_view
add_adapter
end
|
#table_data ⇒ Object
9
10
11
12
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 9
def table_data
mp "Implement a table_data method in #{self.inspect}."
[]
end
|
#update_table_data ⇒ Object
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/project/pro_motion/fragments/pm_list_screen.rb', line 61
def update_table_data
if adapter.instance_of?(PMCursorAdapter)
elsif adapter.is_a?(PMBaseAdapter)
td = table_data
adapter.data = td && td.first && td.first[:cells]
end
adapter.notifyDataSetChanged
end
|