This is the base view responsible for mixing in functions for focus management, key handling and providing the main framework. It light enough for use as a component; but not recommended for use in RowLists, Grids and other aggregate views which are expected to have a large amount of view items.
This view is intended to be extended by Components, which in turn are aggregates of views; but not whole screens.
isInitialized
- indicates ifinitialize
has yet been calledisShown
, true if the view is on screenname
, useful for loggingstate
, contains the state of the current viewnone|initialized|destroyed
initialize
- must be called to start the view machinery
You can override these methods to safely drive your application behavior
applyStyle(styles, localizations, assets)
- will be called when the view is initialized, so it can apply required styles, etcinitialize(args)
- called when the view has been initializedonFirstShow
- called the first time a view is shownonShow
- called when a view is shown- Note that a view cannot be shown if it is not initialized. This method will be called immediately for a visible view, when
initialize
is invoked
- Note that a view cannot be shown if it is not initialized. This method will be called immediately for a visible view, when
onHide
- called when a view is hidden
In addition you can override the methods in KeyMixin:
isAnyKeyPressLocked()
- returns true if any key press is locked - the default implementation returns the value ofm.isKeyPressLocked
isCapturingAnyKeyPress(key)
, return true if the keykey
is captured
Override the following, to return true, if the applicable key is captured
onKeyPressDown()
onKeyPressUp()
onKeyPressLeft()
onKeyPressRight()
onKeyPressBack()
onKeyPressOption()
onKeyPressOK()
Also, BaseView
allows entry points for overriding abstract methods from FocusMixin
onGainedFocus(isSelfFocused)
onLostFocus()