Class: PMScreen

Inherits:
Android::App::Fragment
  • Object
show all
Includes:
PMScreenModule
Defined in:
lib/project/pro_motion/pm_screen.rb

Overview

hipbyte.myjetbrains.com/youtrack/issue/RM-773 - can’t put this in a module yet :( module ProMotion

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PMScreenModule

#action_bar, #activity, #append_view, #append_view!, #color, #font, #hide_keyboard, #image, included, #on_load, #open, #r, #rmq, #rmq_data, #root_view, #show_toast, #soft_input_mode, #start_activity, #stylesheet, #stylesheet=

Instance Attribute Details

#viewObject

Returns the value of attribute view.



7
8
9
# File 'lib/project/pro_motion/pm_screen.rb', line 7

def view
  @view
end

Instance Method Details

#load_viewObject



26
27
28
# File 'lib/project/pro_motion/pm_screen.rb', line 26

def load_view
  Potion::FrameLayout.new(self.activity)
end

#onActivityCreated(saved_instance_state) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/project/pro_motion/pm_screen.rb', line 30

def onActivityCreated(saved_instance_state)
  mp "PMScreen onActivityCreated" if RMQ.debugging?

  super

  @view.rmq_data.is_screen_root_view = true

  self.rmq.build(@view)

  if self.class.rmq_style_sheet_class
    self.rmq.stylesheet = self.class.rmq_style_sheet_class
    @view.rmq.apply_style(:root_view) #if @view.rmq.stylesheet.respond_to?(:root_view)
  end

  self.action_bar.title = self.class.bars_title
  self.activity.title = self.class.bars_title

  on_load
end

#onCreateView(inflater, parent, saved_instance_state) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/project/pro_motion/pm_screen.rb', line 9

def onCreateView(inflater, parent, saved_instance_state)
  super

  if self.class.xml_resource
    @view = inflater.inflate(r(:layout, self.class.xml_resource), parent, false)
  else
    @view = load_view
    @view.setId Potion::ViewIdGenerator.generate
  end

  action_bar.hide if hide_action_bar?
  setup_xml_widgets

  # TODO: how will we pass this back if we don't use XML?
  @view
end