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

Class View

source code

object --+
         |
        View

Defines a View and provides pythonic access to its properties & a mechanism to define events.

You don't create views yourself. They are created by FullScreenWrapper2App.show_layout() after showing the xml and are populated in the Layout.views which is a BaseDict => ie. a dict that allows access by both [key] and .key

You can access a view's properties simply by Layout.views.viewname.property to get & set property. Doing this calls the appropriate SL4A api function like fullSetProperty()

To add and remove events, use the View.add_event() and View.remove_event() methods. To set the contents of a ListView, use the View.set_listitems() method

Instance Methods [hide private]
 
__init__(self, view_id, view_type)
View constructer called with view_id & view_type.
source code
 
add_event(self, eventhandler)
Used to add an EventHandler to the view.
source code
 
remove_event(self, event_name)
removes an event added previously by matching the event_name.
source code
 
set_listitems(self, listitems)
sets a list for a ListView.
source code
 
__setattr__(self, name, value)
This allows pythonic access to setting a View's properties by calling SL4A api
source code
 
__getattr__(self, name)
This allows pythonic access to getting a View's properties by calling SL4A api
source code
 
__str__(self)
str(View) will return the View.text
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, view_id, view_type)
(Constructor)

source code 

View constructer called with view_id & view_type. DO NOT create a view yourself.

Views are created by FullScreenWrapper2App.show_layout() after showing the xml and are populated in the Layout.views which is a BaseDict => ie. a dict that allows access by both [key] and .key

Overrides: object.__init__

add_event(self, eventhandler)

source code 

Used to add an EventHandler to the view.

You would typically add one of click_EventHandler or itemclick_EventHandler (for List Views) to a view

remove_event(self, event_name)

source code 

removes an event added previously by matching the event_name. Use this to temporarily disable a view's click event

set_listitems(self, listitems)

source code 

sets a list for a ListView. Takes a list of str as input

__setattr__(self, name, value)

source code 

This allows pythonic access to setting a View's properties by calling SL4A api

For eg: Layout.views.viewname.color = "#FFFFFFFF"

Overrides: object.__setattr__

__getattr__(self, name)
(Qualification operator)

source code 

This allows pythonic access to getting a View's properties by calling SL4A api

For eg: buttontext = Layout.views.buttonname.text

__str__(self)
(Informal representation operator)

source code 

str(View) will return the View.text

Overrides: object.__str__