Skip to content
Eric edited this page Dec 11, 2017 · 162 revisions

Popups

Popups are parts of the core, have a size and a view. For the following documentation consider app being an instance of MobileCore. There can only be one popup at a time.

Instantiate

 app.addPopup(_WIDTH_, _HEIGHT_, _VIEW_, _VIEW_CONFIG_, _ANIMATION_, _LISTEN_OVERLAY_);

Example - Create a popup of 400x300px, pass it a view 'MyView', with an empty object, a fade animation and ignore user interactions on the underlying overlay (tapping the overlay won't do anything).

 app.addPopp(400, 300, 'MyView', {}, OGX.MobileCore.POPUP_FADE, false);

Same but with percent instead

 app.addPopp('80%', '80%', 'MyView', {}, OGX.MobileCore.POPUP_FADE, false);

Example - Create a popup of 400x300px, pass it a view 'MyView', with an config object, no animation and close the popup and hide its underlying overlay when the user taps on the overlay

 app.addPopp(400, 300, 'MyView', {content:'Hello World'}, OGX.MobileCore.POPUP_NOANIM, true);

Delete

 app.removePopup(_ANIMATION_);

Deleting a popup will also call the destroy method of a view.

Clone this wiki locally