Class sap.m.SplitAppModule: sap/m/SplitApp


SplitApp is another root element of a UI5 mobile application besides App control. It maintains two NavContainers if running on tablet and one - on phone. The display of master NavContainer depends on the portrait/landscape mode of the device and the mode of SplitApp.

Constructor Summary
new sap.m.SplitApp(sId?, mSettings?)Constructor for a new SplitApp.
Event Summary
orientationChange(oControlEvent)Fires when orientation (portrait/landscape) is changed.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.SplitApp.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.SplitApp with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.SplitApp.getMetadata()Returns a metadata object for class sap.m.SplitApp.
_onOrientationChange()Fires the orientationChange event after SplitApp has reacted to the browser orientationChange event.
attachOrientationChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the orientationChange event of this sap.m.SplitApp.
detachOrientationChange(fnFunction, oListener)Detaches event handler fnFunction from the orientationChange event of this sap.m.SplitApp.
fireOrientationChange(mArguments?)Fires event orientationChange to attached listeners.
getHomeIcon()Gets current value of property homeIcon.
setHomeIcon(oHomeIcon)Sets a new value for property homeIcon.
Methods borrowed from class sap.m.SplitContainer
addDetailPage, addMasterPage, addPage, attachAfterDetailNavigate, attachAfterMasterClose, attachAfterMasterNavigate, attachAfterMasterOpen, attachBeforeMasterClose, attachBeforeMasterOpen, attachDetailNavigate, attachMasterButton, attachMasterNavigate, backDetail, backMaster, backToPage, backToTopDetail, backToTopMaster, destroyDetailPages, destroyMasterPages, detachAfterDetailNavigate, detachAfterMasterClose, detachAfterMasterNavigate, detachAfterMasterOpen, detachBeforeMasterClose, detachBeforeMasterOpen, detachDetailNavigate, detachMasterButton, detachMasterNavigate, fireAfterDetailNavigate, fireAfterMasterClose, fireAfterMasterNavigate, fireAfterMasterOpen, fireBeforeMasterClose, fireBeforeMasterOpen, fireDetailNavigate, fireMasterButton, fireMasterNavigate, getBackgroundColor, getBackgroundImage, getBackgroundOpacity, getBackgroundRepeat, getCurrentDetailPage, getCurrentMasterPage, getCurrentPage, getDefaultTransitionNameDetail, getDefaultTransitionNameMaster, getDetailPage, getDetailPages, getInitialDetail, getInitialMaster, getMasterButtonText, getMasterPage, getMasterPages, getMode, getPage, getPreviousPage, hideMaster, indexOfDetailPage, indexOfMasterPage, insertDetailPage, insertMasterPage, insertPreviousPage, isMasterShown, removeAllDetailPages, removeAllMasterPages, removeDetailPage, removeMasterPage, setBackgroundColor, setBackgroundImage, setBackgroundOpacity, setBackgroundRepeat, setDefaultTransitionNameDetail, setDefaultTransitionNameMaster, setInitialDetail, setInitialMaster, setMasterButtonText, setMode, showMaster, to, toDetail, toMaster
Constructor Detail
new sap.m.SplitApp(sId?, mSettings?)
Constructor for a new SplitApp.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
  • Events
    • orientationChange : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.m.SplitContainer can be used as well.

Parameters:
{string}sId? ID for the new control, generated automatically if no ID is given
{object}mSettings? Initial settings for the new control
Event Detail
orientationChange(oControlEvent)
Fires when orientation (portrait/landscape) is changed.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{boolean}oControlEvent.getParameters.landscape Returns true if the device is in landscape mode.
Method Detail
sap.m.SplitApp.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.SplitApp with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.SplitContainer.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.m.SplitApp.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.SplitApp.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
_onOrientationChange()
Fires the orientationChange event after SplitApp has reacted to the browser orientationChange event.
attachOrientationChange(oData?, fnFunction, oListener?): sap.m.SplitApp
Attaches event handler fnFunction to the orientationChange event of this sap.m.SplitApp.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.m.SplitApp itself.

Fires when orientation (portrait/landscape) is changed.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.m.SplitApp itself
Returns:
{sap.m.SplitApp} Reference to this in order to allow method chaining
detachOrientationChange(fnFunction, oListener): sap.m.SplitApp
Detaches event handler fnFunction from the orientationChange event of this sap.m.SplitApp.

The passed function and listener object must match the ones used for event registration.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.SplitApp} Reference to this in order to allow method chaining
fireOrientationChange(mArguments?): sap.m.SplitApp
Fires event orientationChange to attached listeners.

Expects the following event parameters:

  • landscape of type booleanReturns true if the device is in landscape mode.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.SplitApp} Reference to this in order to allow method chaining
getHomeIcon(): any
Gets current value of property homeIcon.

Represents the icon to be displayed on the home screen of iOS devices after the user does "add to home screen". Note that only the first attempt to set the homeIcon is executed, subsequent settings are ignored. The icon must be in PNG format. The property can either store the URL of one single icon or an object holding icon URLs for the different required sizes. Note that if single icon is used for all devices, when scaled, its quality can regress. A desktop icon (used for bookmarks and overriding the favicon) can also be configured. This requires an object to be given and the "icon" property of this object then defines the desktop bookmark icon. For this icon, PNG is not supported by Internet Explorer. The ICO format is supported by all browsers. ICO is also preferred for this desktop icon setting as the file can contain different images for different resolutions.

One example is:

app.setHomeIcon({ 'phone':'phone-icon.png', 'phone@2':'phone-retina.png', 'tablet':'tablet-icon.png', 'tablet@2':'tablet-retina.png', 'icon':'desktop.ico' });

The image size is 57/114 px for the phone and 72/144 px for the tablet. If an object is given but one of the sizes is not given, the largest given icon will be used for this size.

On Android, these icons may or may not be used by the device. Chances can be improved by adding glare effect, rounded corners, setting the file name to end with "-precomposed.png", and setting the homeIconPrecomposed property to true.

Returns:
{any} Value of property homeIcon
setHomeIcon(oHomeIcon): sap.m.SplitApp
Sets a new value for property homeIcon.

Represents the icon to be displayed on the home screen of iOS devices after the user does "add to home screen". Note that only the first attempt to set the homeIcon is executed, subsequent settings are ignored. The icon must be in PNG format. The property can either store the URL of one single icon or an object holding icon URLs for the different required sizes. Note that if single icon is used for all devices, when scaled, its quality can regress. A desktop icon (used for bookmarks and overriding the favicon) can also be configured. This requires an object to be given and the "icon" property of this object then defines the desktop bookmark icon. For this icon, PNG is not supported by Internet Explorer. The ICO format is supported by all browsers. ICO is also preferred for this desktop icon setting as the file can contain different images for different resolutions.

One example is:

app.setHomeIcon({ 'phone':'phone-icon.png', 'phone@2':'phone-retina.png', 'tablet':'tablet-icon.png', 'tablet@2':'tablet-retina.png', 'icon':'desktop.ico' });

The image size is 57/114 px for the phone and 72/144 px for the tablet. If an object is given but one of the sizes is not given, the largest given icon will be used for this size.

On Android, these icons may or may not be used by the device. Chances can be improved by adding glare effect, rounded corners, setting the file name to end with "-precomposed.png", and setting the homeIconPrecomposed property to true.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{any}oHomeIcon New value for property homeIcon
Returns:
{sap.m.SplitApp} Reference to this in order to allow method chaining