WindowAreaPresentationSessionCallback


@ExperimentalWindowApi
interface WindowAreaPresentationSessionCallback


A callback to notify about the lifecycle of a window area presentation session.

Summary

Public functions

Unit

Notifies about changes in visibility of a container that can hold the app content to show in the window area.

Unit

Notifies about an end of a presentation session.

Unit

Notifies about a start of a presentation session.

Public functions

onContainerVisibilityChanged

Added in 1.2.0
fun onContainerVisibilityChanged(isVisible: Boolean): Unit

Notifies about changes in visibility of a container that can hold the app content to show in the window area. Notification of the container being visible is guaranteed to occur after onSessionStarted has been called. The container being no longer visible is guaranteed to occur before onSessionEnded.

If content was never presented, then this method will never be called.

onSessionEnded

Added in 1.2.0
fun onSessionEnded(t: Throwable?): Unit

Notifies about an end of a presentation session. The presentation and any app-provided content in the window area is removed.

Parameters
t: Throwable?

Throwable to provide information on if the session was ended due to an error. This will only occur if a session is attempted to be enabled when it is not available, but can be expanded to alert for more errors in the future.

onSessionStarted

Added in 1.2.0
fun onSessionStarted(session: WindowAreaSessionPresenter): Unit

Notifies about a start of a presentation session. Provides a reference to WindowAreaSessionPresenter to allow an application to customize a presentation when the session starts. The Context provided from the WindowAreaSessionPresenter should be used to inflate or make any UI decisions around the presentation View that should be shown in that area.