Module fullscreenwrapper2 :: Class FullScreenWrapper2App
[hide private]
[frames] | no frames]

Class FullScreenWrapper2App

source code

object --+
         |
        FullScreenWrapper2App

FullScreenWrapper2App implements the "App" incorporating an eventloop & a layout stack with methods to display & close layouts and access SL4A FullScreenUI API functions

You SHOULD NOT instantiate a FullScreenWrapper2App but rather, simply call its class methods. To use the app, you first need to call FullScreenWrapper2App.initialize(android_instance) with the droid = android.Android() object that you have created in you program. This is always subsequently accessible by FullScreenWrapper2App.get_android_instance()

You can then call FullScreenWrapper2App.show_layout() and FullScreenWrapper2App.close_layout() to show and close layouts respectively. FullScreenWrapper2App places layouts in an internal stack. This lets the framework seamlessly handle parent->show child->close child->show parent type of transitions simplifying your code. It also gives you a method to exit the app by calling FullScreenWrapper2App.exit_FullScreenWrapper2App() at any time. This internally works by signalling the eventloop to terminate the loop by posting an internal event

the internal function called by FullScreenWrapper2App.show_layout() and close_layout() actually populates the layout's views once it is shown & also calls the Layout.on_show() function

Once you have called show_layout() and your first layout is displayed on screen with its view properties & event handlers set, you should call FullScreenWrapper2App.eventloop() to start the event loop. The event loop will keep polling for the event queue and dispatch events to the appropriate handler functions

The FullScreenWrapper also defines a few "convenience" functions which are used to set and access fullscreen properties via SL4A api calls

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
initialize(cls, android_instance)
You MUST call this first with your droid = android.Android() instance before calling any other function
source code
 
get_android_instance(cls)
this allows you to access the android.Android() instance set in FullScreenWrapper2App.initialize() at any time
source code
 
show_layout(cls, layout, show_mode=0)
This will show the layout, set the title, clean & re-populate layout's views BaseDict collection & call the Layout.on_show()
source code
 
close_layout(cls)
This will first call a layout's on_close() function to help save state & then close the active layout.
source code
 
exit_FullScreenWrapper2App(cls)
convenience function to exit the app.
source code
 
eventloop(cls)
The main event loop to catch & dispatch events in the active/topmost layout in the _layouts[] stack & its views.
source code
 
set_list_contents(cls, id, list) source code
 
set_property_value(cls, id, property, value)
Set the value of an XML view's property
source code
 
get_property_value(cls, id, property)
Get the value of a given XML view's property
source code
Class Variables [hide private]
  _android_instance = None
hash(x)
  _layouts = []
  SHOW_LAYOUT_PUSH_OVER_CURRENT = 0
  SHOW_LAYOUT_REPLACING_CURRENT = 1
  _SHOW_LAYOUT_POP_CURRENT = 2
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

show_layout(cls, layout, show_mode=0)
Class Method

source code 

This will show the layout, set the title, clean & re-populate layout's views BaseDict collection & call the Layout.on_show()

this will also push the layout to the top FullScreenWrapper2App._layouts[] stack. If there is already a parent layout showing, then this will call the parent layout's on_close() function to let the parent layout save state

close_layout(cls)
Class Method

source code 

This will first call a layout's on_close() function to help save state & then close the active layout.

If the layout being closed is a child layout, then this will pop the child layout from the FullScreenWrapper2App._layouts[] stack and show the parent immediately below the child layout in the stack.

exit_FullScreenWrapper2App(cls)
Class Method

source code 

convenience function to exit the app. this works by signalling the eventloop to stop

eventloop(cls)
Class Method

source code 

The main event loop to catch & dispatch events in the active/topmost layout in the _layouts[] stack & its views.

Call this once your first layout's event handlers are setup from your main() program. This catches & dispatches events by matching EventHandlers in the ACTIVE/TOPMOST layout int he _layouts[] stack & its views.

Note that only the active layout & its views are matched with events. This function also looks for "exit" signal which can be raised by calling exit_FullScreenWrapper2App() to terminate the event loop.