Class: PMApplication
- Defined in:
- lib/project/pro_motion/pm_application.rb
Overview
RM-773 module ProMotion
Class Attribute Summary collapse
-
.current_application ⇒ Object
Returns the value of attribute current_application.
-
.home_screen_class ⇒ Object
Returns the value of attribute home_screen_class.
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#current_activity ⇒ Object
Returns the value of attribute current_activity.
-
#home_screen_class ⇒ Object
Returns the value of attribute home_screen_class.
Class Method Summary collapse
Instance Method Summary collapse
- #current_screen ⇒ Object
-
#development? ⇒ Boolean
True if the app is running in the :development environment.
-
#environment ⇒ Symbol
Environment the app is running it.
- #guess_current_screen ⇒ Object
- #onCreate ⇒ Object
-
#release? ⇒ Boolean
(also: #production?)
True if the app is running in the :release environment.
-
#test? ⇒ Boolean
True if the app is running in the :test environment.
- #window ⇒ Object
Class Attribute Details
.current_application ⇒ Object
Returns the value of attribute current_application.
62 63 64 |
# File 'lib/project/pro_motion/pm_application.rb', line 62 def current_application @current_application end |
.home_screen_class ⇒ Object
Returns the value of attribute home_screen_class.
62 63 64 |
# File 'lib/project/pro_motion/pm_application.rb', line 62 def home_screen_class @home_screen_class end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
4 5 6 |
# File 'lib/project/pro_motion/pm_application.rb', line 4 def context @context end |
#current_activity ⇒ Object
Returns the value of attribute current_activity.
4 5 6 |
# File 'lib/project/pro_motion/pm_application.rb', line 4 def current_activity @current_activity end |
#home_screen_class ⇒ Object
Returns the value of attribute home_screen_class.
4 5 6 |
# File 'lib/project/pro_motion/pm_application.rb', line 4 def home_screen_class @home_screen_class end |
Class Method Details
.home_screen(hclass) ⇒ Object
64 65 66 67 |
# File 'lib/project/pro_motion/pm_application.rb', line 64 def home_screen(hclass) mp "PMApplication home_screen", debugging_only: true @home_screen_class = hclass end |
Instance Method Details
#current_screen ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/project/pro_motion/pm_application.rb', line 26 def current_screen if @current_activity && (ca = @current_activity) if ca.is_a?(PMSingleFragmentActivity) ca.fragment end end end |
#development? ⇒ Boolean
57 58 59 |
# File 'lib/project/pro_motion/pm_application.rb', line 57 def development? environment == :development end |
#environment ⇒ Symbol
41 42 43 |
# File 'lib/project/pro_motion/pm_application.rb', line 41 def environment @_environment ||= RUBYMOTION_ENV.to_sym end |
#guess_current_screen ⇒ Object
34 35 36 37 38 |
# File 'lib/project/pro_motion/pm_application.rb', line 34 def guess_current_screen # TODO #ca.getFragmentManager.findFragmentById(Android::R::Id.fragment_container) #ca.getFragmentManager.frameTitle end |
#onCreate ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/project/pro_motion/pm_application.rb', line 6 def onCreate mp "PMApplication onCreate", debugging_only: true # We can always get to the current application from PMApplication.current_application # but we set the child class's current_application too, in case someone uses that PMApplication.current_application = self self.class.current_application = self @context = self @home_screen_class = self.class.home_screen_class self.on_create if respond_to?(:on_create) end |
#release? ⇒ Boolean Also known as: production?
46 47 48 |
# File 'lib/project/pro_motion/pm_application.rb', line 46 def release? environment == :release end |
#test? ⇒ Boolean
52 53 54 |
# File 'lib/project/pro_motion/pm_application.rb', line 52 def test? environment == :test end |
#window ⇒ Object
20 21 22 23 24 |
# File 'lib/project/pro_motion/pm_application.rb', line 20 def window if @current_activity @window ||= @current_activity.getWindow end end |