Common API for orientation change notifications across all platforms.
For browsers or devices that do not provide native support for orientation change events the API simulates them based on the ratio of the document's width and height.
Node | Description |
---|
Method | Description |
---|---|
sap.ui.Device.orientation.attachHandler |
Registers the given event handler to orientation change events of the document's window. The event is fired whenever the screen orientation changes and the width of the document's window becomes greater than its height or the other way round. The event handler is called with a single argument: a map
|
sap.ui.Device.orientation.detachHandler |
Removes a previously attached event handler from the orientation change events. The passed parameters must match those used for registration with #.attachHandler beforehand. |
Registers the given event handler to orientation change events of the document's window.
The event is fired whenever the screen orientation changes and the width of the document's window becomes greater than its height or the other way round.
The event handler is called with a single argument: a map mParams
which provides the following information:
mParams.landscape
: If this flag is set to true
, the screen is currently in landscape mode, otherwise in portrait mode.Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function |
The handler function to call when the event occurs. This function will be called in the context of the |
|
oListener | object |
The object that wants to be notified when the event occurs ( |
Removes a previously attached event handler from the orientation change events.
The passed parameters must match those used for registration with #.attachHandler beforehand.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function |
The handler function to detach from the event |
|
oListener | object |
The object that wanted to be notified when the event occurred |