SessionCallbacks

interface SessionCallbacks


Class to store callback lambdas associated with the Session.

Summary

Public functions

Closeable

Register a callback to be triggered when the bounds of the app change.

Closeable
onFullSpaceMode(callback: () -> Unit)

Register a callback to be triggered when the app goes into full space mode.

Closeable

Register a callback to be triggered when the app goes into home space mode.

Closeable
onSpaceModeChanged(callback: (spaceMode: SpaceMode) -> Unit)

Register a callback to be triggered when the app changes space mode.

Public functions

onBoundsChanged

Added in 1.0.0-alpha01
fun onBoundsChanged(callback: (Dimensions) -> Unit): Closeable

Register a callback to be triggered when the bounds of the app change. It will be called immediately with the current state if that state is available.

Parameters
callback: (Dimensions) -> Unit

the method that will be called when the application bounds change. The argument passed to the callback represents the current bounds of the application.

Returns
Closeable

a closeable to unregister the callback

onFullSpaceMode

Added in 1.0.0-alpha01
fun onFullSpaceMode(callback: () -> Unit): Closeable

Register a callback to be triggered when the app goes into full space mode. It will be called immediately upon registration if the system is currently in full space mode and its state is known.

Parameters
callback: () -> Unit

the method that will be called when the application enters full space mode.

Returns
Closeable

a closeable to unregister the callback

onHomeSpaceMode

Added in 1.0.0-alpha01
fun onHomeSpaceMode(callback: (Dimensions) -> Unit): Closeable

Register a callback to be triggered when the app goes into home space mode. It will be called immediately upon registration if the system is currently in home space mode and its state is known.

Parameters
callback: (Dimensions) -> Unit

the method that will be called when the application enters home space mode. It will be called with the current application bounds as its argument.

Returns
Closeable

a closeable to unregister the callback

onSpaceModeChanged

Added in 1.0.0-alpha01
fun onSpaceModeChanged(callback: (spaceMode: SpaceMode) -> Unit): Closeable

Register a callback to be triggered when the app changes space mode. It will be called immediately with the current state if that state is available.

Parameters
callback: (spaceMode: SpaceMode) -> Unit

the method that will be called when the space mode changes. It will accept an enum SpaceMode value indicating the current mode.

Returns
Closeable

a closeable to unregister the callback