new AppWindow()
AppWindow creates, contains, manages a
mozbrowser
iframe. AppWindow is directly managed by AppWindowManager,
by call resize(), open(), close() on AppWindow.
Basically AppWindow would manipulate all mozbrowser events
fired from the mozbrowser iframe by itself and show relevant UI.
AppWindow is also the parent class of ActivityWindow and HomescreenWindow.
Mostly they do the same thing but is different at some points
like the way transitioning.
About creating an AppWindow,
you need to provide at least the web app/page URL.
If you have also provided the manifest,
then you would get an AppWindow object which is a web app.
Otherwise you would get an AppWindow which is in 'Wrapper' type.
The only one different thing between web app and web page is
just the manifestURL.
Life cycle state machine of an appWindow instance
Example
var app = new AppWindow({
url: 'http://uitest.gaiamobile.org:8080/index.html',
manifestURL: 'http://uitest.gaiamobile.org:8080/manifest.webapp'
});
app.open();
Mixes In
Members
-
CLASS_LIST :string
-
Change this if new window has its own styles.
Events
-
appclose
-
Fired when the app's closing animation is ended.
-
appclosing
-
Fired when the app is doing closing animation.
-
appcreated
-
This is fired when the app window is instantiated.
-
appdestroyed
-
Fired after the instance id destroyed.
-
appopen
-
Fired when the app's opening animation is ended.
-
appopening
-
Fired when the app is doing opening animation.
-
apprendered
-
Fired after the app window element is appended to the DOM tree.
-
apprequestclose
-
Fired once we'd like to be closed.
The one who makes decision to call close() would be AppWindowManager. -
apprequestopen
-
Fired once we'd like to be opened.
The one who makes decision to call open() would be AppWindowManager. -
appresize
-
Fired when the app is resized.
-
appterminated
-
Fired when the instance is terminated.
-
appwilldestroy
-
Fired before the instance id destroyed.
-
appwillrender
-
Fired before this element is appended to the DOM tree.
-
_swipein
-
The event is necessary for edge gesture swiper.
It means the app window is swiped in. -
_swipeout
-
The event is necessary for edge gesture swiper.
It means the app window is swiped out. -
_withkeyboard
-
The event is dispatched on the app window only when keyboard is up.
-
_withoutkeyboard
-
The event is dispatched on the app window only when keyboard is hidden.